API docs

Kenerate AI API

One endpoint, 10 tools. Send JSON-RPC 2.0 requests with your API key to check credits, browse models and generate images, videos and music. It is the same server AI apps connect to over MCP.

Endpoint

POSThttps://kenerateai.net/api/mcp

Authentication

Send your API key as a Bearer token. Keys start with sk_ and spend credits from your account, so keep them secret. Deleting a key revokes it at once.

HTTP
Authorization: Bearer sk_...

Apps such as Claude and ChatGPT can sign in with OAuth instead. They find it from the 401 response and the metadata at https://kenerateai.net/.well-known/oauth-protected-resource/api/mcp

Making requests

Each POST carries one JSON-RPC message. No session or initialize call is needed. Call tools/list to read the tool list, and tools/call to run a tool.

curl
curl -X POST https://kenerateai.net/api/mcp \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_balance","arguments":{}}}'

The reply is a one-shot event stream. Read the data: line. The tool result is in result.structuredContent, and also as text in result.content.

Response
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"{\"credits\":1200}"}],"structuredContent":{"credits":1200}}}

Generation is asynchronous

Generating returns an id right away. Poll it until the result is ready.

  1. 1estimate_cost

    Optional. See how many credits a job will cost before running it.

  2. 2generate_*

    Start the job. You get a generation id and the credits it cost.

  3. 3wait_for_generation

    Waits up to 50 seconds per call. Call again while status is not success, failed or canceled.

  4. 4url

    When status is success, the result has a url to the image, video or song.

Errors & limits

  • 401Missing or invalid API key. The WWW-Authenticate header points OAuth clients to sign-in.
  • 429Over 120 requests per minute per IP or account. Wait for the Retry-After seconds. Request bodies are capped at 200 KB.
  • isErrorThe tool ran but failed, for example not enough credits or an unknown model. HTTP 200 with result.isError true and the reason in result.content.
  • errorThe request itself is invalid, such as an unknown tool or bad arguments. The reply has a JSON-RPC error object instead of result.

10 tools

Read live from the server, so this list always matches what the API accepts. Tools marked "Spends credits" charge your account.

get_balance

Read-only

Get the remaining credit balance of the account.

Arguments

No arguments.

Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_balance",
    "arguments": {}
  }
}

list_models

Read-only

List the available generation models (slug, name, vendor, starting price). Use the slug with get_model, estimate_cost and generate_*.

Arguments

NameTypeDescription
type"image" | "video" | "audio"
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_models",
    "arguments": {
      "type": "image"
    }
  }
}

get_model

Read-only

Get every parameter a model accepts (names, types, allowed values, defaults) so generate_* options can be filled in correctly.

Arguments

NameTypeDescription
modelrequiredstringModel slug from list_models
mediaTyperequired"image" | "video" | "music"
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_model",
    "arguments": {
      "model": "gpt-image-2.6-flare",
      "mediaType": "image"
    }
  }
}

estimate_cost

Read-only

Estimate how many credits a generation will cost without running it.

Arguments

NameTypeDescription
mediaTyperequired"image" | "video" | "music"
modelrequiredstringModel slug from list_models
promptstring≤ 10000 chars
imageUrlsstring[]≤ 10 items
videoUrlsstring[]≤ 10 items
audioUrlsstring[]≤ 10 items
optionsobjectModel parameters such as aspect_ratio, resolution, duration. Call get_model to see what a model accepts.
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "estimate_cost",
    "arguments": {
      "mediaType": "video",
      "model": "seedance-2.5-flash",
      "prompt": "A red sports car drifting through a neon city at night"
    }
  }
}

generate_image

Spends credits

Generate an image from a prompt, or edit / combine reference images (imageUrls). Spends credits.

Arguments

NameTypeDescription
modelrequiredstringModel slug from list_models
promptrequiredstring≤ 10000 chars
imageUrlsstring[]Optional reference images≤ 10 items
optionsobjectModel parameters such as aspect_ratio, resolution, duration. Call get_model to see what a model accepts.
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "generate_image",
    "arguments": {
      "model": "gpt-image-2.6-flare",
      "prompt": "A banana-shaped yellow sofa in a sunny living room"
    }
  }
}

generate_video

Spends credits

Generate a video from a prompt, a start image (imageUrls) or a reference video. Spends credits; call estimate_cost first.

Arguments

NameTypeDescription
modelrequiredstringModel slug from list_models
promptstring≤ 10000 chars
imageUrlsstring[]≤ 10 items
videoUrlsstring[]≤ 10 items
audioUrlsstring[]≤ 10 items
optionsobjectModel parameters such as aspect_ratio, resolution, duration. Call get_model to see what a model accepts.
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "generate_video",
    "arguments": {
      "model": "seedance-2.5-flash",
      "prompt": "A red sports car drifting through a neon city at night"
    }
  }
}

generate_music

Spends credits

Generate a song or instrumental from a prompt (style, mood, lyrics). Spends credits.

Arguments

NameTypeDescription
modelrequiredstringModel slug from list_models
promptrequiredstring≤ 10000 chars
optionsobjectModel parameters such as aspect_ratio, resolution, duration. Call get_model to see what a model accepts.
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "generate_music",
    "arguments": {
      "model": "suno-v6",
      "prompt": "Upbeat synth-pop about a summer road trip"
    }
  }
}

get_generation

Read-only

Get the status of one generation and its result url once it succeeded.

Arguments

NameTypeDescription
idrequiredstring≤ 128 chars
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_generation",
    "arguments": {
      "id": "GENERATION_ID"
    }
  }
}

wait_for_generation

Read-only

Wait (up to timeoutSeconds) until a generation finishes, then return its status and url. Call again if it is still running.

Arguments

NameTypeDescription
idrequiredstring≤ 128 chars
timeoutSecondsintegerdefault 45 · 5–50
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "wait_for_generation",
    "arguments": {
      "id": "GENERATION_ID",
      "timeoutSeconds": 45
    }
  }
}

list_generations

Read-only

List the most recent generations of the account.

Arguments

NameTypeDescription
mediaType"image" | "video" | "music"
limitintegerdefault 10 · 1–50
Example request body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_generations",
    "arguments": {
      "mediaType": "video",
      "limit": 5
    }
  }
}