Public docs
Kubflow API Docs
This page is public so AI tools can read it without logging in. The API itself still requires a Kubflow API key from a Growth plan or higher. API calls spend the key owner's Kubflow credits.
Base URL
https://kubflow.com
Authentication
Use a bearer token API key created in Settings.
Generation Flow
Create async generation, then poll status for result_url.
OpenAPI Schema
Import this URL into a Custom GPT action or another AI tool that supports OpenAPI actions.
Open OpenAPI schemahttps://kubflow.com/api/v1/openapi.jsonConnect your AI agent
Generate images and videos in Claude Code, Cursor, Codex, and other local MCP agents. Our setup guide includes copyable instructions, a standalone connector, and a connection check. You only need a Kubflow API key and uv; no repository checkout is required.
Open MCP setup guide →Headers
Authorization: Bearer kf_live_YOUR_KEY
Content-Type: application/jsonAlternative key headers also work: X-Kubflow-API-Key or X-API-Key.
Create Generation Body
Send category, model, prompt, and params. The model-specific fields go inside params. If category is omitted, Kubflow tries to infer it from the model ID.
{
"category": "image",
"model": "gpt-image-2",
"prompt": "Describe what to generate",
"params": {
"aspect_ratio": "9:16",
"resolution": "1K",
"image_url": "https://example.com/optional-reference.png"
}
}Examples
Image generation
curl -X POST https://kubflow.com/api/v1/generations \
-H "Authorization: Bearer kf_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "image",
"model": "gpt-image-2",
"prompt": "A premium product photo of an orange running shoe on a clean studio background",
"params": {
"aspect_ratio": "1:1",
"resolution": "1K"
}
}'Video generation
curl -X POST https://kubflow.com/api/v1/generations \
-H "Authorization: Bearer kf_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "video",
"model": "kling-3.0",
"prompt": "A cinematic slow push-in on a glass perfume bottle with orange light reflections",
"params": {
"duration": 5,
"aspect_ratio": "9:16",
"mode": "pro",
"sound": true
}
}'Image-to-video
curl -X POST https://kubflow.com/api/v1/generations \
-H "Authorization: Bearer kf_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "video",
"model": "veo3",
"prompt": "Animate the subject with a smooth camera move and realistic motion",
"params": {
"image_url": "https://example.com/source-image.png",
"model": "veo3_fast",
"resolution": "720p",
"aspect_ratio": "9:16"
}
}'Polling Status
Generations are async. Store generation_id from createGeneration and poll until status is succeeded or failed. On success, use result_url.
curl https://kubflow.com/api/v1/generations/GENERATION_ID \
-H "Authorization: Bearer kf_live_YOUR_KEY"{
"generation_id": "GENERATION_ID",
"status": "succeeded",
"progress": 100,
"result_url": "https://..."
}Endpoints
| GET | /api/v1/openapi.json | Public OpenAPI schema. No account required. |
| GET | /api/v1/me | Check account plan and credits. Requires API key. |
| GET | /api/v1/models?category=image | List live image models and schemas. Requires API key. |
| GET | /api/v1/models?category=video | List live video models and schemas. Requires API key. |
| POST | /api/v1/generations | Start an image or video generation. |
| GET | /api/v1/generations/:id | Check status and result URL. |
Image Models
| Model ID | Name | Credits | Required | Params |
|---|---|---|---|---|
| gpt-image-2.5-flare | GPT Image 2.5 Fast | 6-16 credits | prompt (up to 20,000 characters) | image_url or input_urls (up to 16 references), aspect_ratio, resolution: 1K, 2K, 4K; background: auto, opaque, transparent. 27:16, 16:27, 9:8 and 8:9 support 1K only. |
| gpt-image-2.5-sunburst | GPT Image 2.5 | 6-16 credits | prompt (up to 20,000 characters) | image_url or input_urls (up to 16 references), aspect_ratio, resolution: 1K, 2K, 4K; background: auto, opaque, transparent. 27:16, 16:27, 9:8 and 8:9 support 1K only. |
| nano-banana-pro | Nano Banana Pro | 18-24 credits | prompt | image_url optional, aspect_ratio, resolution: 1K, 2K, 4K |
| nano-banana-2 | Nano Banana 2 | 8-18 credits | prompt | image_url optional, aspect_ratio, resolution: 1K, 2K, 4K |
| gpt-image-2 | GPT Image 2 | 6-16 credits | prompt | image_url optional for image-to-image, aspect_ratio: auto, 1:1, 16:9, 9:16, 4:3, 3:4; resolution: 1K, 2K, 4K. 4K cannot use 1:1. |
| grok-imagine-text-to-image | Grok Image | 4 credits | prompt | image_url optional, aspect_ratio: 1:1, 2:3, 3:2, 16:9, 9:16 |
| z-image | Z-Image | 0.8 credits | prompt | aspect_ratio: 1:1, 4:3, 3:4, 16:9, 9:16 |
| seedream-5-pro | Seedream 5.0 Pro | 7 credits (1K) / 14 credits (2K), plus 0.5 per reference after the first | prompt (3-5000 characters) | image_url or input_urls (up to 10 references); aspect_ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 2:3, 3:2, 21:9; quality: basic (1K), high (2K); output_format: png, jpeg |
| seedream-5-lite | Seedream 5 Lite | 5.5 credits | prompt | image_url optional, aspect_ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 2:3, 3:2, 21:9; quality: basic, high |
| topaz-image-upscale | Topaz Image Upscale | 10-40 credits | image_url | image_url is the image to upscale. Input max is currently 10MB. |
| recraft-remove-background | Remove Background | 1 credit | image_url | image_url is the image to process. Supports PNG, JPG, WebP up to provider limits. |
| image-passthrough | Input Image | 0 credits | image_url | Utility/input model. Usually not needed for direct API generation. |
Video Models
| Model ID | Name | Credits | Required | Params |
|---|---|---|---|---|
| veo3 | Google Veo 3.1 | 30-370 credits | prompt | image_url optional, image_file_1 through image_file_4 optional, model: veo3, veo3_fast, veo3_lite; resolution: 720p, 1080p, 4k; aspect_ratio: 16:9, 9:16 |
| kling-2.6 | Kling 2.6 | 55-220 credits | prompt | image_url optional for image-to-video, duration: 5 or 10, aspect_ratio: 1:1, 16:9, 9:16, sound: true or false (default true) |
| kling-3.0 | Kling 3.0 | 14-67 credits/s | prompt | image_url optional first frame, last_image optional, duration: 3-15, aspect_ratio: 1:1, 16:9, 9:16, mode: std, pro, 4K, sound: true or false (default true) |
| seedance-2.0-kie | Seedance 2.0 | 11.5-208 credits/s | prompt | image_url first frame optional, last_image optional, image_file_1 through image_file_9, video_file_1 through video_file_3, audio_file_1 through audio_file_3, duration: 4-15, resolution: 480p, 720p, 1080p, 4K |
| seedance-2.0-fast | Seedance 2.0 Fast | 6.8-24.8 credits/s | prompt | Same as seedance-2.0-kie but faster and lower cost. duration: 4-15, resolution: 480p or 720p. Current KIE promotional rates run until October 7, 2026 at 06:00 UTC. |
| seedance-2.0-mini | Seedance 2.0 Mini | 2.4-8.2 credits/s | prompt | image_url first frame optional, last_image optional, image_file_1 through image_file_9, video_file_1 through video_file_3, audio_file_1 through audio_file_3, duration: 4-15, resolution: 480p or 720p. Current KIE promotional rates run until October 7, 2026 at 06:00 UTC. |
| gemini-omni-1.1-flash | Gemini Omni 1.1 Flash | 63-252 credits | prompt | duration: 4, 6, 8, 10; resolution: 360p, 720p, 1080p, 4k; aspect_ratio: 16:9, 9:16. Use image_url plus optional last_image, or up to 7 reference images, one video, and existing audio_ids/character_ids. Video consumes two reference slots. Video input uses fixed pricing and automatic output duration; video_start/video_end select up to 10 seconds from an input up to 30 seconds. Supply video_file_1_duration when using a video reference. |
| wan-3.0 | Wan 3.0 | 8-32 credits/s | prompt or reference media | duration: 2-30 explicit seconds; resolution: 480P (8/s), 720P (16/s), 1080P (32/s). Use image_url/last_image or up to 10 image_file, 5 video_file and 5 audio_file references. reference_link_urls or reference_file_urls: at most one each, mutually exclusive. audio defaults true. Input videos: 1-15 seconds each, 15 seconds total; input plus output duration at most 30 seconds. Supply video_file_N_duration or reference_video_durations; billing includes input and output seconds. |
| seedance-2.5 | Seedance 2.5 | 17-114 credits/s | prompt optional | prompt optional, max 30000 characters. Use image_url as the first frame with optional last_image, or multimodal references, not both. Up to 30 image_file, 10 video_file, and 10 audio_file references; duration: 4-30 explicit seconds (automatic duration is unavailable); resolution: 480p, 720p, or 1080p; aspect_ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, adaptive; output_format: mp4 or mov; generate_audio defaults true; return_last_frame, web_search, and nsfw_checker are optional booleans. Video-reference billing includes input and output seconds: supply matching video_file_N_duration, video_url_duration, or reference_video_durations metadata. Reference videos must be 2-30 seconds each and at most 30 seconds combined. Current 1080p pricing includes KIE's promotion ending October 17, 2026 at 06:00 UTC. |
| grok-imagine-text-to-video | Grok Video Text | 2.4-4.5 credits/s | prompt | aspect_ratio: 2:3, 3:2, 1:1, 16:9, 9:16; mode: normal, fun, spicy; duration: 6 or 10; resolution: 480p or 720p |
| grok-imagine-image-to-video | Grok Video | 2.4-4.5 credits/s | prompt | image_url optional source image, aspect_ratio, mode: normal or fun, duration: 6 or 10, resolution: 480p or 720p |
| grok-imagine-video-1-5-preview | Grok Video 1.5 | 2.4-4.5 credits/s | prompt or images_list | prompt optional, max 4096 characters; images_list optional, up to 7 images; aspect_ratio: 1:1, 16:9, 9:16, 3:2, 2:3, auto (ignored with one image); duration 1-15 integer seconds; resolution: 480p or 720p. 1080p is unavailable until its pricing is verified. |
| topaz-video-upscale | Topaz Video Upscale | 8 credits/s for 1x/2x, 14 credits/s for 4x | video_url | video_url is the video to upscale. Input max is currently 10MB. |
| kling-2.6/motion-control | Kling 2.6 Motion | 11-18 credits/s | image_url, video_url | image_url character image, video_url motion reference, prompt optional, mode: 720p or 1080p |
| kling-3.0/motion-control | Kling 3.0 Motion | 20-27 credits/s | image_url, video_url | image_url character image, video_url motion reference, prompt optional, mode: 720p or 1080p |
| stitch-videos | Stitch Videos | 2 credits | video_url | Utility model for joining videos. Usually not needed for a simple AI generation action. |
| add-audio | Add Audio | 2 credits | video_url | Utility model for mixing audio onto a video. |
| add-subtitles | Add Subtitles | 2 credits | video_url | Utility model for transcribing and burning subtitles onto a video. |
| video-passthrough | Input Video | 0 credits | video_url | Utility/input model. Usually not needed for direct API generation. |
Common Errors
| 401 | Missing or invalid API key. |
| 403 | API access requires Growth plan or higher, or the account is blocked. |
| 400 | Invalid category, model, prompt, or params. |
| 402/403 | Not enough credits or plan does not allow the requested generation. |
Suggested GPT Instructions
Use the Kubflow API when the user asks to generate an image or video.
Choose category image or video.
Choose a model from the docs or call listModels.
Start with createGeneration.
Then call getGeneration repeatedly until status is succeeded or failed.
When status is succeeded, return result_url to the user.
Never invent a completed URL before getGeneration returns result_url.
If the API returns not enough credits, tell the user to add credits or upgrade in Kubflow.