Back to Settings

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 schema
https://kubflow.com/api/v1/openapi.json

Connect 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/json

Alternative 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.jsonPublic OpenAPI schema. No account required.
GET/api/v1/meCheck account plan and credits. Requires API key.
GET/api/v1/models?category=imageList live image models and schemas. Requires API key.
GET/api/v1/models?category=videoList live video models and schemas. Requires API key.
POST/api/v1/generationsStart an image or video generation.
GET/api/v1/generations/:idCheck status and result URL.

Image Models

Model IDNameCreditsRequiredParams
gpt-image-2.5-flareGPT Image 2.5 Fast6-16 creditsprompt (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-sunburstGPT Image 2.56-16 creditsprompt (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-proNano Banana Pro18-24 creditspromptimage_url optional, aspect_ratio, resolution: 1K, 2K, 4K
nano-banana-2Nano Banana 28-18 creditspromptimage_url optional, aspect_ratio, resolution: 1K, 2K, 4K
gpt-image-2GPT Image 26-16 creditspromptimage_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-imageGrok Image4 creditspromptimage_url optional, aspect_ratio: 1:1, 2:3, 3:2, 16:9, 9:16
z-imageZ-Image0.8 creditspromptaspect_ratio: 1:1, 4:3, 3:4, 16:9, 9:16
seedream-5-proSeedream 5.0 Pro7 credits (1K) / 14 credits (2K), plus 0.5 per reference after the firstprompt (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-liteSeedream 5 Lite5.5 creditspromptimage_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-upscaleTopaz Image Upscale10-40 creditsimage_urlimage_url is the image to upscale. Input max is currently 10MB.
recraft-remove-backgroundRemove Background1 creditimage_urlimage_url is the image to process. Supports PNG, JPG, WebP up to provider limits.
image-passthroughInput Image0 creditsimage_urlUtility/input model. Usually not needed for direct API generation.

Video Models

Model IDNameCreditsRequiredParams
veo3Google Veo 3.130-370 creditspromptimage_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.6Kling 2.655-220 creditspromptimage_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.0Kling 3.014-67 credits/spromptimage_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-kieSeedance 2.011.5-208 credits/spromptimage_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-fastSeedance 2.0 Fast6.8-24.8 credits/spromptSame 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-miniSeedance 2.0 Mini2.4-8.2 credits/spromptimage_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-flashGemini Omni 1.1 Flash63-252 creditspromptduration: 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.0Wan 3.08-32 credits/sprompt or reference mediaduration: 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.5Seedance 2.517-114 credits/sprompt optionalprompt 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-videoGrok Video Text2.4-4.5 credits/spromptaspect_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-videoGrok Video2.4-4.5 credits/spromptimage_url optional source image, aspect_ratio, mode: normal or fun, duration: 6 or 10, resolution: 480p or 720p
grok-imagine-video-1-5-previewGrok Video 1.52.4-4.5 credits/sprompt or images_listprompt 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-upscaleTopaz Video Upscale8 credits/s for 1x/2x, 14 credits/s for 4xvideo_urlvideo_url is the video to upscale. Input max is currently 10MB.
kling-2.6/motion-controlKling 2.6 Motion11-18 credits/simage_url, video_urlimage_url character image, video_url motion reference, prompt optional, mode: 720p or 1080p
kling-3.0/motion-controlKling 3.0 Motion20-27 credits/simage_url, video_urlimage_url character image, video_url motion reference, prompt optional, mode: 720p or 1080p
stitch-videosStitch Videos2 creditsvideo_urlUtility model for joining videos. Usually not needed for a simple AI generation action.
add-audioAdd Audio2 creditsvideo_urlUtility model for mixing audio onto a video.
add-subtitlesAdd Subtitles2 creditsvideo_urlUtility model for transcribing and burning subtitles onto a video.
video-passthroughInput Video0 creditsvideo_urlUtility/input model. Usually not needed for direct API generation.

Common Errors

401Missing or invalid API key.
403API access requires Growth plan or higher, or the account is blocked.
400Invalid category, model, prompt, or params.
402/403Not 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.