Developers

Klingobanana API

Generate images and videos from your own code, or let Claude, ChatGPT and Cursor do it for you through our MCP server. Same models as the studio, same credits.

Overview

Base URL: https://klingobanana.com. All requests and responses are JSON.

An active subscription is required. There is no free tier and no free credits: every request spends credits from your plan or a top-up. Every subscriber can create keys in Account → API (up to 5 active keys).

Use the /api/v1/generations endpoints below for images and videos with any model. The older image-only endpoints further down keep working.

Authentication

Send your key as a bearer token in the Authorization header. Keys begin with kb_live_.

Header
Authorization: Bearer kb_live_xxxxxxxxxxxxxxxxxxxxxxxx

Keep keys server-side. A revoked key stops working immediately, as does removing API access from the account.

Use it from Claude (MCP)

The MCP server at https://klingobanana.com/api/mcp lets AI assistants generate for you: "make 3 images of this character, then a 5-second video of the best one". In claude.ai, add it as a custom connector and click Connect; in Claude Code, Cursor and other tools, use an API key. See the MCP setup guide.

Claude Code
claude mcp add --transport http klingobanana https://klingobanana.com/api/mcp   --header "Authorization: Bearer $KB_API_KEY"

GET /api/v1/models

The models you can use, with their type, accepted durations, reference-image support and credit cost. Optional ?type=image or ?type=video.

Request
curl https://klingobanana.com/api/v1/models?type=video -H "Authorization: Bearer $KB_API_KEY"
Response, 200
{
  "models": [{
    "id": "kling-video-v3-pro-image-to-video",
    "name": "Kling 3.0 Pro I2V",
    "type": "video",
    "requiresImage": true,
    "maxReferenceImages": 2,
    "durations": [5, 10],
    "defaultDuration": 5,
    "credits": { "5s": 26, "10s": 51 }
  }]
}

POST /api/v1/generations

Create an image or a video with any model. Credits are charged when the request is accepted and refunded automatically if the generation fails.

  • model (string, required): an id from GET /api/v1/models.
  • prompt (string, required): 1 to 4000 characters.
  • referenceImages (array of strings, optional, max 4): https:// URLs or data:image/ URIs. For image-to-video, the first one is the starting frame.
  • duration (integer, video only): one of the model's durations. Defaults to the model default.
  • aspectRatio (string, optional): one of 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4. Default 1:1 for images, 16:9 for videos.
  • numImages (integer 1 to 4, images only).

Images are finished when the call returns (HTTP 200, status: "completed"). Videos return HTTP 202 with status: "processing": poll the id every 10 to 20 seconds.

Request
curl -X POST https://klingobanana.com/api/v1/generations   -H "Authorization: Bearer $KB_API_KEY"   -H "Content-Type: application/json"   -d '{"model": "kling-video-v3-pro-image-to-video", "prompt": "Slow push-in, she turns and smiles", "referenceImages": ["https://example.com/frame.jpg"], "duration": 5, "aspectRatio": "9:16"}'
Response, 202
{
  "id": "rw:0b6f4e0e-5b1c-4c52-9a43-1f0a2f9b7c11",
  "model": "kling-video-v3-pro-image-to-video",
  "type": "video",
  "status": "processing",
  "credits": 26
}

GET /api/v1/generations/{id}

Status of a generation. Safe to call again after it completed. status is processing, completed or failed (credits refunded).

Request
curl https://klingobanana.com/api/v1/generations/$ID -H "Authorization: Bearer $KB_API_KEY"
Response, completed
{
  "id": "rw:...",
  "model": "kling-video-v3-pro-image-to-video",
  "type": "video",
  "status": "completed",
  "outputs": [{ "url": "https://firebasestorage.googleapis.com/...", "type": "video" }]
}

GET /api/v1/generations

Your most recent creations, newest first. Query parameters: limit (1 to 50, default 10) and type (image or video). Handy to reuse an image as a reference.

GET /api/v1/account

Credit balance, plan, the key's daily credit cap and how much of it was used today.

Response, 200
{ "credits": 870, "plan": "pro", "planRenewsAt": "2026-11-21T00:00:00.000Z", "dailyCreditCap": 200, "creditsUsedToday": 29 }

POST /api/v1/prompts/enhance

Turn a short idea into a detailed prompt. Free. Body: idea (string) and type (image or video).

Response, 200
{ "prompt": "Full body shot of a woman jogging on a misty beach at dawn, ..." }

Legacy: async flow

The endpoints below predate /api/v1/generations. They keep working for existing integrations but only cover images.

  1. Submit a generation request. You receive a job id and the model id. Credits are charged at this point.
  2. Poll the status endpoint with that id until the status is a terminal value. A reasonable interval is 3 seconds.
  3. On success the response contains result URLs. Download them promptly and store your own copies.

Image jobs are produced while the submit request is open, so the submit call can take several seconds and the first poll will usually already return the result.

POST /api/v1/images/generations

Single-image generation or edit with a fixed model pair. Text-to-image by default; pass imageUrl to edit an existing image.

  • prompt (string, required): 1 to 2000 characters.
  • imageUrl (string, optional): an https:// URL or a data:image/ URI. Switches to edit mode.
  • aspectRatio (string, optional, default 1:1): one of 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4.
Request
curl -X POST https://klingobanana.com/api/v1/images/generations \
  -H "Authorization: Bearer $KB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A ceramic teapot on a linen cloth, soft window light", "aspectRatio": "4:5"}'
Response, 202
{
  "id": "rw:0b6f4e0e-5b1c-4c52-9a43-1f0a2f9b7c11",
  "model": "fal-ai/gemini-3-pro-image-preview",
  "status": "processing"
}

GET /api/v1/images/generations/{id}

Poll a job created above. The model query parameter is required: pass back the model value from the submit response.

Request
curl "https://klingobanana.com/api/v1/images/generations/$ID?model=fal-ai/gemini-3-pro-image-preview" \
  -H "Authorization: Bearer $KB_API_KEY"
Response, processing
{ "id": "rw:...", "status": "processing", "progress": 5 }
Response, completed
{
  "id": "rw:...",
  "status": "completed",
  "images": [{ "url": "https://firebasestorage.googleapis.com/...", "width": 1024, "height": 1280 }]
}
Response, failed (HTTP 410)
{ "id": "rw:...", "status": "failed", "error": "..." }

POST /api/v1/generate/image

Lower-level image endpoint where you choose the model. Poll with GET /api/v1/status.

  • prompt (string, required): 1 to 2000 characters.
  • modelId (string, required): a model from the pricing tables below.
  • referenceImageUrl, faceImageUrl (string or null, optional): reference images, used only by models that accept image input.
  • aspectRatio (string, default 9:16).
  • numImages (integer 1 to 8, default 1).
  • negativePrompt (string), numInferenceSteps (integer 1 to 100), seed (integer), sizeMultiplier (number 0.5 to 2, default 1): optional tuning fields.
Request
curl -X POST https://klingobanana.com/api/v1/generate/image \
  -H "Authorization: Bearer $KB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Studio portrait, 85mm, shallow depth of field", "modelId": "fal-ai/nano-banana-2", "aspectRatio": "4:5"}'
Response, 200
{
  "requestId": "rw:0b6f4e0e-5b1c-4c52-9a43-1f0a2f9b7c11",
  "modelId": "fal-ai/nano-banana-2"
}

GET /api/v1/status

Query parameters modelId and requestId are both required.

Request
curl "https://klingobanana.com/api/v1/status?modelId=fal-ai/nano-banana-2&requestId=$REQUEST_ID" \
  -H "Authorization: Bearer $KB_API_KEY"
Response, processing
{ "status": "processing", "progress": 5, "queuePosition": null }
Response, done
{
  "status": "done",
  "results": [{ "url": "https://firebasestorage.googleapis.com/...", "mediaType": "image", "width": 1024, "height": 1280 }]
}
Response, failed (HTTP 410)
{ "status": "failed", "error": "..." }

Rate limits

Limits apply per API key. Exceeding any of them returns 429 with a Retry-After header (seconds).

  • 30 requests per minute, including status polling.
  • 3 concurrent generations in flight at once.
  • Daily credit cap per key: 200 credits per UTC day for new keys, adjustable from 50 to 2000 in Account → API.

Errors

Errors return a JSON body of the form { "error": "message" } with the HTTP status below.

API error responses
StatusMessageWhen
400Invalid request bodyThe body is not valid JSON.
400First validation messageA field fails validation (for example an empty prompt, a prompt over 2000 characters, an unsupported aspectRatio, or an imageUrl that is not https:// or data:image/).
400Unknown model: {id} / Model not available: {id}The model id is not in the catalog, or is not enabled for new generations.
400{model} supports these durations: ... / needs a reference imageThe duration or reference images do not fit the chosen model (see GET /api/v1/models).
400Could not process reference image. Try re-uploading the image.The reference image could not be read.
400modelId and requestId are required / model query parameter is requiredA polling request is missing its query parameters.
401UnauthorizedNo Authorization header was sent at all.
401Missing or invalid API keyThe key does not start with kb_live_.
401Invalid or revoked API keyThe key is unknown or has been revoked.
402Insufficient creditsThe account balance is lower than the cost of the request. Nothing is generated.
403API access requires an active Klingobanana subscriptionThe account has no active paid plan. Checked on every call.
403ForbiddenThe job id belongs to another account.
404Generation job not found or expiredUnknown or already-consumed job id.
410Job failed (status: failed, error: ...)The generation failed. Credits are refunded automatically.
429Rate limit exceeded / Too many concurrent generations / Daily credit limit reachedThe key exceeded its request rate, concurrency or daily credit cap. Wait for the number of seconds in the Retry-After header, then retry.
502Generation failed: ... / Generation service unavailable for this model. Please try again.The upstream provider rejected or failed the job. Credits are refunded automatically.
503Generation service unavailable for this model.The model is not currently routable to a provider.

Pricing

Each request is charged in credits when it is submitted, and refunded automatically if the job fails.

POST /api/v1/generations and the MCP server accept these models:

Credits per generation for every model of the v1 generations endpoint
ModelidCredits
FLUX Schnellimageflux-schnell1 / image
FLUX Kontext Devimage, needs an imageflux-kontext-dev1 / image
Gemini 3 Proimagegemini-3-pro-image-preview5 / image
Gemini 3 Pro Editimage, needs an imagegemini-3-pro-image-preview-edit5 / image
Nano Banana 2imagenano-banana-23 / image
Nano Banana 2 Editimage, needs an imagenano-banana-2-edit3 / image
SeedDream v4.5imagebytedance-seedream-v4.5-text-to-image1 / image
GPT Image 2.6imagegpt-image-2.63 / image
GPT Image 2.6 Flareimagegpt-image-2.6-flare3 / image
Nano Banana 2.1imagenano-banana-2.12 / image
Seedream 5.0 Proimageseedream-5.0-pro2 / image
Kling Image O3imagekling-image-o31 / image
FLUX 3 Imageimageflux-3-image2 / image
Kling 4.0videokling-4.036 / 5s72 / 10s107 / 15s
Kling 4.0 I2Vvideo, needs an imagekling-4.0-image-to-video36 / 5s72 / 10s107 / 15s
Kling 4.0 Flashvideokling-4.0-flash15 / 5s29 / 10s43 / 15s58 / 20s
Kling 4.0 Flash I2Vvideo, needs an imagekling-4.0-flash-image-to-video15 / 5s29 / 10s43 / 15s58 / 20s
Seedance 2.5videoseedance-2.535 / 5s56 / 8s70 / 10s105 / 15s
Seedance 2.5 I2Vvideo, needs an imageseedance-2.5-image-to-video35 / 5s56 / 8s70 / 10s105 / 15s
Gemini Omni Flash 1.2videogemini-omni-flash-1.29 / 4s13 / 6s17 / 8s22 / 10s26 / 12s32 / 15s
Wan 3.0videowan-3.016 / 5s31 / 10s46 / 15s
Seedance 2.0videobytedance-seedance-2.0-text-to-video104 / 5s166 / 8s207 / 10s310 / 15s
Seedance 2.0 Fastvideobytedance-seedance-2.0-fast-text-to-video37 / 5s59 / 8s74 / 10s111 / 15s
Seedance 2.0 I2Vvideo, needs an imagebytedance-seedance-2.0-image-to-video104 / 5s166 / 8s207 / 10s310 / 15s
Seedance 2.0 Fast I2Vvideo, needs an imagebytedance-seedance-2.0-fast-image-to-video37 / 5s59 / 8s74 / 10s111 / 15s
Kling 3.0 Provideokling-video-v3-pro-text-to-video26 / 5s51 / 10s
Kling 3.0 Pro I2Vvideo, needs an imagekling-video-v3-pro-image-to-video26 / 5s51 / 10s
Kling 2.6 Provideokling-video-v2.6-pro-text-to-video22 / 5s43 / 10s
Veo 3.1 Fastvideoveo3.1-fast19 / 4s28 / 6s37 / 8s
Gemini Omni Flash 1.1videogemini-omni-flash-1.110 / 3s13 / 4s16 / 5s19 / 6s22 / 7s25 / 8s28 / 9s31 / 10s
Wan 2.7videowan-v2.7-text-to-video16 / 5s
LTX 2.3 Provideoltx-2.3-text-to-video8 / 3s13 / 5s

POST /api/v1/images/generations uses a fixed model pair, priced per request:

Credits per request for the v1 images/generations model pair
ModelmodelIdCredits per image
Gemini 3 Profal-ai/gemini-3-pro-image-preview5
Gemini 3 Pro Editfal-ai/gemini-3-pro-image-preview/edit5

POST /api/v1/generate/image accepts any of the models below via modelId. Cost is charged per image, multiplied by numImages (Gemini and GPT image models always produce one image).

Credits per image for models accepted by v1 generate/image
ModelmodelIdCredits per image
FLUX Schnellfal-ai/flux/schnell1
FLUX Kontext Devfal-ai/flux-kontext/dev1
Gemini 3 Profal-ai/gemini-3-pro-image-preview5
Gemini 3 Pro Editfal-ai/gemini-3-pro-image-preview/edit5
Nano Banana 2fal-ai/nano-banana-23
Nano Banana 2 Editfal-ai/nano-banana-2/edit3
SeedDream v4.5fal-ai/bytedance/seedream/v4.5/text-to-image1
GPT Image 2.6runware/gpt-image-2.63
GPT Image 2.6 Flarerunware/gpt-image-2.6-flare3
Nano Banana 2.1runware/nano-banana-2.12
Seedream 5.0 Prorunware/seedream-5.0-pro2
Kling Image O3runware/kling-image-o31
FLUX 3 Imagerunware/flux-3-image2

Credits come from your subscription: starter includes 100 per cycle, pro includes 300 per cycle, business includes 900 per cycle. Top-ups are available in the studio.