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_.
Authorization: Bearer kb_live_xxxxxxxxxxxxxxxxxxxxxxxxKeep 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 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.
curl https://klingobanana.com/api/v1/models?type=video -H "Authorization: Bearer $KB_API_KEY"{
"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): anidfromGET /api/v1/models.prompt(string, required): 1 to 4000 characters.referenceImages(array of strings, optional, max 4):https://URLs ordata:image/URIs. For image-to-video, the first one is the starting frame.duration(integer, video only): one of the model'sdurations. 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. Default1:1for images,16:9for 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.
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"}'{
"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).
curl https://klingobanana.com/api/v1/generations/$ID -H "Authorization: Bearer $KB_API_KEY"{
"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.
{ "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).
{ "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.
- Submit a generation request. You receive a job id and the model id. Credits are charged at this point.
- Poll the status endpoint with that id until the status is a terminal value. A reasonable interval is 3 seconds.
- 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): anhttps://URL or adata:image/URI. Switches to edit mode.aspectRatio(string, optional, default1:1): one of 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4.
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"}'{
"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.
curl "https://klingobanana.com/api/v1/images/generations/$ID?model=fal-ai/gemini-3-pro-image-preview" \
-H "Authorization: Bearer $KB_API_KEY"{ "id": "rw:...", "status": "processing", "progress": 5 }{
"id": "rw:...",
"status": "completed",
"images": [{ "url": "https://firebasestorage.googleapis.com/...", "width": 1024, "height": 1280 }]
}{ "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, default9: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.
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"}'{
"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.
curl "https://klingobanana.com/api/v1/status?modelId=fal-ai/nano-banana-2&requestId=$REQUEST_ID" \
-H "Authorization: Bearer $KB_API_KEY"{ "status": "processing", "progress": 5, "queuePosition": null }{
"status": "done",
"results": [{ "url": "https://firebasestorage.googleapis.com/...", "mediaType": "image", "width": 1024, "height": 1280 }]
}{ "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.
| Status | Message | When |
|---|---|---|
| 400 | Invalid request body | The body is not valid JSON. |
| 400 | First validation message | A 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/). |
| 400 | Unknown 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 image | The duration or reference images do not fit the chosen model (see GET /api/v1/models). |
| 400 | Could not process reference image. Try re-uploading the image. | The reference image could not be read. |
| 400 | modelId and requestId are required / model query parameter is required | A polling request is missing its query parameters. |
| 401 | Unauthorized | No Authorization header was sent at all. |
| 401 | Missing or invalid API key | The key does not start with kb_live_. |
| 401 | Invalid or revoked API key | The key is unknown or has been revoked. |
| 402 | Insufficient credits | The account balance is lower than the cost of the request. Nothing is generated. |
| 403 | API access requires an active Klingobanana subscription | The account has no active paid plan. Checked on every call. |
| 403 | Forbidden | The job id belongs to another account. |
| 404 | Generation job not found or expired | Unknown or already-consumed job id. |
| 410 | Job failed (status: failed, error: ...) | The generation failed. Credits are refunded automatically. |
| 429 | Rate limit exceeded / Too many concurrent generations / Daily credit limit reached | The key exceeded its request rate, concurrency or daily credit cap. Wait for the number of seconds in the Retry-After header, then retry. |
| 502 | Generation failed: ... / Generation service unavailable for this model. Please try again. | The upstream provider rejected or failed the job. Credits are refunded automatically. |
| 503 | Generation 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:
| Model | id | Credits |
|---|---|---|
| FLUX Schnellimage | flux-schnell | 1 / image |
| FLUX Kontext Devimage, needs an image | flux-kontext-dev | 1 / image |
| Gemini 3 Proimage | gemini-3-pro-image-preview | 5 / image |
| Gemini 3 Pro Editimage, needs an image | gemini-3-pro-image-preview-edit | 5 / image |
| Nano Banana 2image | nano-banana-2 | 3 / image |
| Nano Banana 2 Editimage, needs an image | nano-banana-2-edit | 3 / image |
| SeedDream v4.5image | bytedance-seedream-v4.5-text-to-image | 1 / image |
| GPT Image 2.6image | gpt-image-2.6 | 3 / image |
| GPT Image 2.6 Flareimage | gpt-image-2.6-flare | 3 / image |
| Nano Banana 2.1image | nano-banana-2.1 | 2 / image |
| Seedream 5.0 Proimage | seedream-5.0-pro | 2 / image |
| Kling Image O3image | kling-image-o3 | 1 / image |
| FLUX 3 Imageimage | flux-3-image | 2 / image |
| Kling 4.0video | kling-4.0 | 36 / 5s72 / 10s107 / 15s |
| Kling 4.0 I2Vvideo, needs an image | kling-4.0-image-to-video | 36 / 5s72 / 10s107 / 15s |
| Kling 4.0 Flashvideo | kling-4.0-flash | 15 / 5s29 / 10s43 / 15s58 / 20s |
| Kling 4.0 Flash I2Vvideo, needs an image | kling-4.0-flash-image-to-video | 15 / 5s29 / 10s43 / 15s58 / 20s |
| Seedance 2.5video | seedance-2.5 | 35 / 5s56 / 8s70 / 10s105 / 15s |
| Seedance 2.5 I2Vvideo, needs an image | seedance-2.5-image-to-video | 35 / 5s56 / 8s70 / 10s105 / 15s |
| Gemini Omni Flash 1.2video | gemini-omni-flash-1.2 | 9 / 4s13 / 6s17 / 8s22 / 10s26 / 12s32 / 15s |
| Wan 3.0video | wan-3.0 | 16 / 5s31 / 10s46 / 15s |
| Seedance 2.0video | bytedance-seedance-2.0-text-to-video | 104 / 5s166 / 8s207 / 10s310 / 15s |
| Seedance 2.0 Fastvideo | bytedance-seedance-2.0-fast-text-to-video | 37 / 5s59 / 8s74 / 10s111 / 15s |
| Seedance 2.0 I2Vvideo, needs an image | bytedance-seedance-2.0-image-to-video | 104 / 5s166 / 8s207 / 10s310 / 15s |
| Seedance 2.0 Fast I2Vvideo, needs an image | bytedance-seedance-2.0-fast-image-to-video | 37 / 5s59 / 8s74 / 10s111 / 15s |
| Kling 3.0 Provideo | kling-video-v3-pro-text-to-video | 26 / 5s51 / 10s |
| Kling 3.0 Pro I2Vvideo, needs an image | kling-video-v3-pro-image-to-video | 26 / 5s51 / 10s |
| Kling 2.6 Provideo | kling-video-v2.6-pro-text-to-video | 22 / 5s43 / 10s |
| Veo 3.1 Fastvideo | veo3.1-fast | 19 / 4s28 / 6s37 / 8s |
| Gemini Omni Flash 1.1video | gemini-omni-flash-1.1 | 10 / 3s13 / 4s16 / 5s19 / 6s22 / 7s25 / 8s28 / 9s31 / 10s |
| Wan 2.7video | wan-v2.7-text-to-video | 16 / 5s |
| LTX 2.3 Provideo | ltx-2.3-text-to-video | 8 / 3s13 / 5s |
POST /api/v1/images/generations uses a fixed model pair, priced per request:
| Model | modelId | Credits per image |
|---|---|---|
| Gemini 3 Pro | fal-ai/gemini-3-pro-image-preview | 5 |
| Gemini 3 Pro Edit | fal-ai/gemini-3-pro-image-preview/edit | 5 |
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).
| Model | modelId | Credits per image |
|---|---|---|
| FLUX Schnell | fal-ai/flux/schnell | 1 |
| FLUX Kontext Dev | fal-ai/flux-kontext/dev | 1 |
| Gemini 3 Pro | fal-ai/gemini-3-pro-image-preview | 5 |
| Gemini 3 Pro Edit | fal-ai/gemini-3-pro-image-preview/edit | 5 |
| Nano Banana 2 | fal-ai/nano-banana-2 | 3 |
| Nano Banana 2 Edit | fal-ai/nano-banana-2/edit | 3 |
| SeedDream v4.5 | fal-ai/bytedance/seedream/v4.5/text-to-image | 1 |
| GPT Image 2.6 | runware/gpt-image-2.6 | 3 |
| GPT Image 2.6 Flare | runware/gpt-image-2.6-flare | 3 |
| Nano Banana 2.1 | runware/nano-banana-2.1 | 2 |
| Seedream 5.0 Pro | runware/seedream-5.0-pro | 2 |
| Kling Image O3 | runware/kling-image-o3 | 1 |
| FLUX 3 Image | runware/flux-3-image | 2 |
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.