Media tools

    Generate images and videos using 40+ AI models. Always call get_models first to see available models, costs, and whether a model needs an input image.

    REST HTTP clients: the same limits are documented in one place in REST API model requirements (and returned per model from GET /v1/models).

    #generate_media

    Starts an image or video generation.

    Parameters:

    ParameterTypeRequiredDescription
    promptstringYesWhat to generate (e.g. “A red car on a mountain road”).
    modelstringYesModel ID (from get_models). Examples: nano-banana, kling-2-6-image-to-video.
    generation_typestringNotext-to-image, text-to-video, image-to-video, or image-to-image. Default: text-to-image.
    negative_promptstringNoWhat to avoid in the output.
    source_media_urlsstring or arrayNoRequired for image-to-video and image-to-image. URL(s) to image(s), or for some models (e.g. Kling 2.6 Motion) image + video. See input limits below. Omit for text-to-image and text-to-video.
    aspect_ratiostringNoe.g. 1:1, 16:9, 9:16, 4:5, 21:9. Default: 1:1. Note: each model only accepts a subset — get_models returns the allowed list.
    durationstringNoVideo length. Only certain video models use this. See below.
    qualitystringNoe.g. fast, standard, pro. Default: standard.
    resolutionstringNoOutput resolution tier. Only certain image models use this: gpt-image-2 (1K/2K/4K), gpt-image-2-5-flare/gpt-image-2-5-sunburst (1K/2K/4K), nano-banana-pro/nano-banana-2/nano-banana-2-1 (1K/2K/4K), flux-2 (1K/2K), flux-3-klein (1K/2K/4K). Each tier is a separate pricing SKU; get_models returns the per-tier credit cost. A concrete tier id such as nano-banana-2-1-4K keeps its own tier and ignores this param. nano-banana-2-lite has a single tier and no resolution. Ignored by models where resolution is encoded in the variant model_id (Seedance, Kling, Veo, P-Video, FLUX 3). See the Resolution tiers table below for per-model constraints.
    soundbooleanNoWhen true, request video with generated audio. Only certain video models use this. Default: true, so audio is on for every model that supports it unless you pass false for a silent clip. On some models audio costs more (Kling 2.6, Kling 3.0, Kling 3.0 Omni Frames and References); on Seedance 2, Seedance 2.5 and FLUX 3 it is free. See below.
    seednumberNoSeed for reproducible results.

    Example (text-to-image):

    {
      "prompt": "A futuristic city at sunset with flying cars",
      "model": "nano-banana",
      "generation_type": "text-to-image",
      "aspect_ratio": "16:9",
      "quality": "pro"
    }
    

    Example (image-to-video, one input image required):

    {
      "prompt": "Gentle motion and subtle movement",
      "model": "kling-2-6-image-to-video",
      "generation_type": "image-to-video",
      "source_media_urls": ["https://example.com/your-image.jpg"],
      "aspect_ratio": "16:9",
      "duration": "5s"
    }
    

    Response: Includes generation_id, status (e.g. pending), and often estimated_time_seconds and estimated_cost_credits. Poll with get_status until status is completed or failed.

    Models that support duration:

    Model(s)Supported valuesNotes
    kling-2-6-text-to-video, kling-2-6-image-to-video5s, 10sOptional with/without audio (model variant).
    wan-2-7-720p, wan-2-7-1080p (text-to-video, image-to-video)2s–15s (integer, per second)PER-SECOND pricing; resolution is encoded in the model_id. Pass duration (2–15) + generation_type.
    wan-3-0-480p, wan-3-0-720p, wan-3-0-1080p, wan-3-0-prime-480p, wan-3-0-prime-720p, wan-3-0-prime-1080p (text-to-video, image-to-video, reference-to-video)2s–30s (integer, per second)PER-SECOND pricing on both tiers; tier and resolution are encoded in the model_id. Pass duration (2–30) + generation_type. With reference videos the provider also caps input duration + output duration at 30s.
    grok-imagine-video-1-5-preview-480p, grok-imagine-video-1-5-preview-720p (image-to-video)2s–15s (integer, per second)PER-SECOND pricing; resolution is encoded in the model_id. Image-to-video only — requires exactly 1 image URL in source_media_urls. Pass duration (2–15); optional aspect_ratio (auto by default).
    v1-pro-fast-i2v5s, 10s
    seedance-2 (Standard) / seedance-2-fast (Fast)4s–15s (integer)ByteDance Seedance 2. The tier is the model family itself — seedance-2-fast for the cheaper/faster tier, seedance-2 for the higher-quality tier. Each tier has concrete variant model_ids per resolution / reference-video combo (e.g. seedance-2-fast-480p, seedance-2-480p-video-ref). Pass the full variant id to generate_media; a family label alone returns a variant_required error with the choices. Multimodal text-to-video references (up to 9 images + 3 videos + 3 audios); image-to-video takes 1 required image + optional end frame + up to 3 reference audios. With a reference video the billing formula becomes credits = (ref_video_s + output_s) × rate/s.
    gemini-omni-video (Google)4, 6, 8, 10 (baked into the variant id)Discrete durations only — the duration parameter is ignored; resolution is also encoded in the variant id (gemini-omni-video-720p-6s, gemini-omni-video-1080p-6s, gemini-omni-video-4k-10s, etc.). Three video-ref variants (gemini-omni-video-720p-video-ref, gemini-omni-video-1080p-video-ref, gemini-omni-video-4k-video-ref) take their output duration from the trimmed source clip (≤ 10s). Pass a bare gemini-omni-video family label and the API returns a variant_required error with the 15 choices.
    grok-text-to-video-6sFixed 6sDuration parameter ignored.
    kling-3-0-std, kling-3-0-pro3s–15sSingle-shot mode. Max 2500 chars; supports @element_name references.
    kling-3-0-turbo-720p, kling-3-0-turbo-1080p (text-to-video, image-to-video)3s–15s (integer, per second)Faster, simpler sibling of Kling 3.0. PER-SECOND pricing; resolution is encoded in the model_id. Pass duration (3–15) + generation_type. Synced audio is included (always on); no multi-shot, no @elements.
    kling-3-0-4k (text-to-video, image-to-video)3s to 15s (integer, per second)Highest-resolution Kling 3.0 tier. Audio is bundled at one flat per-second rate, so the sound param does not change the price and there is no -audio row.
    kling-3-0-omni-frames-720p, -1080p, -4k (each also -audio) and kling-3-0-omni-ref-720p, -1080p, -4k (each also -audio or -video)3s to 15s (integer, per second)Kling 3.0 Omni Frames and References lanes. Billed for the duration you pass. Exception: a References request with a video and nothing else takes no duration and bills the clip's length.
    kling-3-0-omni-720p, kling-3-0-omni-1080p, kling-3-0-omni-4k (video-to-video)Not configurableKling 3.0 Omni Transform lane. The output is as long as the source clip (3 to 15s), which is what you are billed for, rounded up to the whole second. A duration you pass is ignored.
    kling-4-0-720p, kling-4-0-1080p (each also -video) (text-to-video, reference-to-video)3s to 30s (integer, per second)Kling 4.0. PER-SECOND pricing; resolution is encoded in the model_id. Without a reference video you are billed for the duration you pass. With one, see Kling 4.0 for how the clip length adds to the bill.
    omnihuman-2-0 (audio-to-video)Not configurableOmniHuman 2.0. The video is exactly as long as the audio you send (4 to 300 seconds), and that length is what you are billed for, per second. See OmniHuman 2.0.
    seedance-2-5-480p, -720p, -1080p (each also -video-ref)4s to 30s (integer)Seedance 2.5, a separate model from the Seedance 2.0 family. Up to 30 seconds in one generation. See Seedance 2.5 below.
    flux-3-720p, flux-3-1080p, flux-3-720p-draft and the continuation rows flux-3-v2v-720p, flux-3-v2v-1080p, flux-3-v2v-720p-draft5s to 20s (integer, required)FLUX 3. PER-SECOND pricing. The provider's automatic length is not exposed, so always pass duration. See FLUX 3 below.
    Veo 3.1 (every veo3-1-*, veo3-1-fast-* and veo3-1-lite-* id)Fixed 8sNot configurable. Script the prompt, including any voiceover, to fit 8 seconds; for longer pieces chain clips with generation_type: "extend".
    grok-image-to-videoNot configurableDuration not set via this parameter.

    For image-only models, duration is ignored.

    Models that support negative_prompt:

    Model(s)Notes
    wan-2-7-720p, wan-2-7-1080p (text-to-video, image-to-video)Up to 500 chars.
    wan-3-0-480p, wan-3-0-720p, wan-3-0-1080p, wan-3-0-prime-480p, wan-3-0-prime-720p, wan-3-0-prime-1080pNot supported.

    All other models ignore negative_prompt.

    Models that support quality (or equivalent):

    Model(s)How it worksValues
    seedream-v4-5, seedream-v4-5-editUses quality directly.basic (2K, default), high (4K).
    5-lite-text-to-image, 5-lite-image-to-imageUses quality directly.basic (2K, default), high (4K).
    Veo 3.1 quality vs fast vs liteDifferent model IDs, not a single quality param.Pick the tier by id prefix: veo3-1-* (quality), veo3-1-fast-* (faster, cheaper), veo3-1-lite-* (budget). See Veo 3.1 model ids.
    flux-2, flux-3-klein, nano-banana-pro, nano-banana-2, nano-banana-2-1Resolution (1K/2K/4K), not a generic “quality” string.Pass via the dedicated resolution parameter, see below.
    flux-3quality picks resolution and draft.720p (default), 1080p, 720p-draft (bare draft is a synonym). No 1080p draft.
    seedance-2-5-480pquality: "draft" renders a 480p preview you can later finalize at 1080p.See Seedance 2.5.
    gpt-image-2 (t2i + i2i)Resolution via the resolution parameter.See Resolution tiers below.
    gpt-image-2-5-flare, gpt-image-2-5-sunburst (t2i + i2i)Resolution via the resolution parameter. The Flare / Sunburst split is the model id, not a quality param.See Resolution tiers below.

    For other models, quality is ignored.

    <a id="resolution-tiers"></a>

    Resolution tiers (the resolution parameter):

    ModelValuesPricingConstraint
    gpt-image-2 (t2i + i2i)1K (default), 2K, 4KSee get_models2K and 4K require an explicit non-square, non-auto aspect_ratio — one of 9:16, 16:9, 4:3, 3:4. Passing auto or 1:1 at 2K/4K returns HTTP 400 with error: "aspect_ratio_incompatible_with_high_res" and no credits are held. 1K accepts every supported aspect including auto/1:1.
    gpt-image-2-5-flare, gpt-image-2-5-sunburst (t2i + i2i)1K (default), 2K, 4KSee get_modelsNo aspect-ratio constraint at any tier: all 13 ratios work at 1K, 2K and 4K alike. Both lanes bill identically, so the choice is speed vs render quality, not price.
    nano-banana-21K (default), 2K, 4KSee get_modelsEach tier is a separate pricing SKU. Aspect ratio list unchanged across tiers.
    nano-banana-2-11K (default), 2K, 4KSee get_modelsNano Banana 2.1, a separate model from nano-banana-2 with its own pricing. The concrete ids nano-banana-2-1-2K / nano-banana-2-1-4K keep their own tier and ignore resolution. Adds the extreme ratios 1:4, 4:1, 1:8, 8:1.
    nano-banana-pro1K (default), 2K, 4KSee get_modelsSame pattern as nano-banana-2.
    flux-2, flux-2-edit1K (default), 2KSee get_modelsTwo tiers only.
    flux-3-klein, flux-3-klein-edit1K (default), 2K, 4KSee get_modelsFLUX 3 Klein, an IMAGE model (not the FLUX 3 video family). Attaching 1 to 10 images moves the call to the flux-3-klein-edit* rows. A concrete tier id such as flux-3-klein-4K keeps its own tier.
    nano-banana-2-liteNoneSee get_modelsSingle tier, no resolution param. The fastest and most affordable Nano Banana model.

    When to pick which tier (GPT Image 2):

    • 1K — default. Use for social posts, thumbnails, concepting, in-app previews, anything ≤ 1024 × 1024. Cheapest; no aspect-ratio gotchas.
    • 2K — use when the client needs a crisp web hero, newsletter cover, in-product illustration at retina density. Must pick a directional aspect (landscape or portrait).
    • 4K — use for print, out-of-home, banners, or any case the user explicitly asks for the highest output size. Confirm the aspect with the user first; the pill 1:1 / auto won't work.

    Flare vs Sunburst (GPT Image 2.5):

    • gpt-image-2-5-flare is the fast lane. Default choice for exploration, prompt iteration and bulk generation.
    • gpt-image-2-5-sunburst is the quality lane. Slower, cleaner detail and steadier typography. Use for final renders and 4K print.
    • Both lanes take the same parameters, the same 16 reference images, the same 20,000 character prompt and the same 13 aspect ratios, and cost the same credits at every resolution tier.
    • Neither lane supports 4:5. Use nano-banana-2 when a placement requires it.

    Models not listed ignore resolution. For video families (Seedance, Kling, Veo, P-Video, FLUX 3, Gemini Omni) the resolution is part of the concrete variant model_id. Pass the variant (e.g. seedance-2-fast-480p, veo3-1-fast-text-to-video-1080p, p-video-1080p, gemini-omni-video-1080p-6s), not this param.

    Prompt character limits:

    Some models enforce a maximum prompt length. Exceeding it may return an error or truncation.

    Model(s)Max characters
    wan-2-7-720p, wan-2-7-1080p5,000
    wan-3-0-480p, wan-3-0-720p, wan-3-0-1080p, wan-3-0-prime-480p, wan-3-0-prime-720p, wan-3-0-prime-1080p20,000
    kling-2-6 (text-to-video, image-to-video)2,500
    seedance-2 (Fast + Standard + Mini)4,000
    seedance-2-5 (all variants)10,000
    kling-3-0-std, kling-3-0-pro2,500
    kling-3-0-4k2,500
    kling-3-0-omni (all Transform, Frames and References variants)3,072
    kling-4-0 (all variants)8,000
    omnihuman-2-0300
    flux-3 (all variants)5,000
    flux-3-klein (all variants)5,000
    seedream-v4-5, seedream-v4-5-edit3,000
    5-lite-text-to-image, 5-lite-image-to-image2,995
    seedream-5-pro (all variants)2,995
    gpt-1.5-image-medium, gpt-1.5-image-high3,000
    nano-banana, flux-2, Veo 3.1 (every veo3-1-* id), v1-pro-fast-i2v, grok (image/video), p-image-edit5,000
    nano-banana-pro (all variants)20,000
    nano-banana-2 (all variants)20,000
    nano-banana-2-1 (all variants), nano-banana-2-lite20,000

    Others may have no documented limit or use server defaults.

    Input file (image and video) limits:

    For image-to-video and image-to-image, source_media_urls is a list of URLs. Most models accept images only (JPEG, PNG, WebP, typically 10 MB max per file). Some models also accept video inputs; when they do, format and size limits apply (e.g. MP4, max duration).

    Model(s)Input typeLimitNotes
    kling-2-6-motion-control-720p, kling-2-6-motion-control-1080pImage + video1 image + 1 videoMotion Control: reference video drives motion. Video max 30 s; video file typically up to 100 MB (MP4/WebM).
    kling-3-0-motion-control-720p, kling-3-0-motion-control-1080pImage + video1 image + 1 videoKling 3.0 Motion Control: same as Kling 2.6. Per-second billing — see the Motion Control pricing table below. Video max 30 s; video file typically up to 100 MB (MP4/WebM).
    kling-2-6-image-to-video, grok-image-to-video, v1-pro-fast-i2vImages only1 imageExactly one input image.
    wan-2-7-720p, wan-2-7-1080p (image-to-video)Images only1 imageFirst frame in source_media_urls; optional last_frame_url for a first+last-frame transition.
    wan-3-0-480p, wan-3-0-720p, wan-3-0-1080p, wan-3-0-prime-480p, wan-3-0-prime-720p, wan-3-0-prime-1080pImages, video, audio, documents10 images + 5 videos + 5 audio, OR 1 document, OR 1 linkFive mutually exclusive modes. Frames: first frame in source_media_urls, optional last_frame_url. References: reference_image_urls (≤10), reference_video_urls (≤5, 1–15s each, ≤15s combined), reference_audio_urls (≤5, same limits) — addressed in the prompt as Image1, Video1, Audio1 in array order. Document: one reference_file_urls entry (docx, doc, xlsx, xls, pptx, ppt, pdf, txt, key, pages, numbers, md; ≤100MB, ≤50 pages). Link: one reference_link_urls entry, a public page needing no login. A frame cannot ride with any reference, and a document cannot ride with a link.
    grok-imagine-video-1-5-preview-480p, grok-imagine-video-1-5-preview-720pImages only1 imageExactly one input image (the starting frame). Aspect ratio: auto (default, derives from the image), 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. Output includes audio.
    seedance-2 (Fast + Standard)Image + video + audioMode-dependentText-to-video: up to 9 images, 3 videos (combined ≤ 15s), and 3 audio clips (combined ≤ 15s) — all optional. Image-to-video: 1 required image (first frame) + optional end frame (2 images max) + up to 3 audio clips; no reference videos allowed in this mode. Pass every URL (image, video, audio) in source_media_urls — the backend classifies by file extension (.jpg/.png/.webp → image, .mp4/.mov/.webm → video, .mp3/.wav/.m4a → audio) and routes each to the right bucket.
    gemini-omni-video (all variants)Images + video7 reference slotsA single reference video consumes 2 slots; images fill the rest. Maximum 1 video reference per request; the video's first 10 seconds are used as the driving clip (no trim parameters exposed). A video reference requires a -video-ref variant — calling a duration variant with a video URL returns variant_mismatch. Audio file URLs are not accepted; voice output is controlled by the voice_id parameter (one of 29 built-in voices).
    kling-3-0-std, kling-3-0-proImages only1–2 imagesStart frame, or start + end frame. PNG/JPG/JPEG. Supports elements (see below).
    kling-3-0-turbo-720p, kling-3-0-turbo-1080p (image-to-video)Images only1 imageStart frame only. PNG/JPG/JPEG. No elements.
    kling-3-0-4k (image-to-video)Images only1 or 2 imagesStart frame, or start + end frame. Omit for text-to-video.
    kling-3-0-omni-720p, -1080p, -4k (Transform)Video + images1 video + up to 4 imagesThe source video goes FIRST in source_media_urls. Video alone: aspect_ratio is always auto. Video + images: 16:9, 9:16 or 1:1, and auto is rejected. Source clip: MP4 or MOV, at most 200 MB, 3 to 15 seconds; trim a longer one with trim_video first.
    kling-3-0-omni-frames-* (Frames)Images onlyExactly 2 imagesFirst frame, then last frame. One image is not accepted. Aspect ratio is always auto.
    kling-3-0-omni-ref-* (References)Images, or video + imagesUp to 7 images, OR 1 video + up to 4 images, OR 1 video aloneOnly the -video rows take a clip, and a clip forces sound off, so -audio and -video never combine. Reference images: JPG or PNG, at most 50 MB each, at least 300 px per side. No text-to-video on any Omni lane: an empty source_media_urls is rejected.
    kling-4-0-*Images + videoUp to 10 images + up to 5 videos, all optionalNo media = text-to-video. Each reference video runs 3 to 30 seconds, 30 seconds combined. Images need at least 300 px per side and an aspect ratio between 0.4 and 2.5. Images are numbered @image_1, @image_2 and videos @video_1, @video_2 in the order you send them. A request with any video bills the -video row.
    omnihuman-2-0Image + audioExactly 1 image + 1 audioOne portrait (JPEG, PNG, WebP, BMP, TIFF, GIF, HEIC or HEIF, under 30 MB, 300 to 6000 px per side, aspect ratio between 0.4 and 2.5) and one MP3 or WAV audio (under 15 MB, 4 to 300 seconds). Pass both in source_media_urls (each is classified by file extension), or split them across reference_image_urls and reference_audio_urls. The audio must be uploaded to Kubeez first.
    seedance-2-5 (all variants)Image + video + audioMode-dependentText-to-video: up to 30 images, 10 videos (combined ≤ 30s) and 10 audio clips (combined ≤ 30s), all optional; an audio reference alone is allowed. Image-to-video: 1 image (first frame) or 2 (first + last) + up to 10 audio clips. No reference videos in this mode, and 3+ images is rejected with too_many_images.
    flux-3 (all variants)Images OR video0 to 10 images, or 1 videoMode is detected from the input: no media = text-to-video; 1 image opens the clip; 2 images = first + last frame; 3 to 10 images = storyboard; 1 MP4 (max 50 MB, 15s) continues that clip on the flux-3-v2v-* rows. Images and a video cannot be sent together.
    flux-3-klein (all variants)Images only0 to 10No image = text to image; 1 to 10 images = edit, where aspect_ratio=auto follows image 1. JPEG, PNG or WebP, max 30 MB each. Extra reference images cost nothing extra.
    5-lite-text-to-image, 5-lite-image-to-imageImages only10For editing (image-to-image).
    seedream-5-pro-edit, seedream-5-pro-edit-2KImages only10Seedream 5.0 Pro edit / multi-reference. Set generation_type: "image-to-image". The tier is the model_id (seedream-5-pro-edit = 1.5K, -edit-2K = 2K); there is no quality/resolution param. The first reference image is included; each extra reference adds +1 credit.
    nano-banana, nano-banana-editImages only10
    nano-banana-pro (all variants)Images only8
    nano-banana-2 (all variants)Images only8
    nano-banana-2-1 (all variants)Images only10JPEG, PNG or WebP, max 30 MB each.
    nano-banana-2-liteImages only10
    p-image-editImages only1–8Pruna AI P Image Edit. Image-to-image only — set generation_type: "image-to-image". Pass 1–8 URLs in source_media_urls. aspect_ratio: auto matches the first input image, or use 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. Optional turbo (default on). Default disable_safety_checker: true (moderation off); set disable_safety_checker: false to enable the safety checker. Optional seed.
    flux-2-edit (image-to-image)Images only8
    gpt-1.5-image (image-to-image)Images only16
    Veo 3.1 *-text-to-video idsImages only0 or 1Optional single image to condition the opening frame. Never 2 or more.
    Veo 3.1 *-first-and-last-frames idsImages onlyExactly 2Start frame, then end frame.
    Veo 3.1 *-reference-to-video idsImages only1 to 3Reference images that guide the look. Aspect ratio is locked to 16:9.

    Use get_models to confirm input_media_types and capabilities for a given model. See Account tools for model list and pricing.

    Kling 3.0 – elements (optional):

    Elements let you reference images or videos in your prompt using @element_name. Pass kling_elements as an array of objects with name, description, and either element_input_urls (2–4 image URLs) or element_input_video_urls (1 video URL). Reference images for elements come from each element’s element_input_urls; main image_urls may be empty for text-to-video or hold optional start/end frames for image-to-video. Each element requires a title (name) and description. Image elements: JPG/PNG, min 300×300px, max 10MB each. Video elements: MP4/MOV, max 50MB.

    Seedance 2 – two tiers, two modes, mixed references:

    ByteDance Seedance 2 ships as three separate model families: seedance-2-fast (cheaper, faster), seedance-2 (standard, higher quality), and seedance-2-mini (cheapest, ~50% under Fast, 480p/720p only). Each family exposes concrete variant model_ids per resolution and reference-video combo; pass the full variant (e.g. seedance-2-fast-480p, seedance-2-mini-720p, seedance-2-720p-video-ref). A bare family label returns a variant_required error listing the options. Standard covers 480p, 720p, 1080p and 4K (variant ids seedance-2-480p / -720p / -1080p / -4k, each also with a -video-ref form); Fast and Mini cover 480p and 720p only. Duration is an integer 4 to 15 seconds. Supported aspect ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, adaptive. Prompt max 4,000 characters. Audio is a free toggle via generate_audio (defaults to true). Unlike Kling 3.0, there is no surcharge for audio.

    Modegeneration_typeRequired inputsOptional referencesNot allowed
    Text-to-video"text-to-video"None (prompt only)Up to 9 images, up to 3 videos (combined ≤ 15s), up to 3 audio clips (combined ≤ 15s)—
    Image-to-video"image-to-video"1 image (first frame)Optional 2nd image (last frame) · up to 3 audio clips (combined ≤ 15s)Reference videos (rejected with a clear error)

    Put every reference URL (images, videos, audio) into source_media_urls. The backend classifies each URL by file extension — .jpg / .png / .webp → image, .mp4 / .mov / .webm → video, .mp3 / .wav / .m4a → audio — and routes it to the correct bucket automatically.

    Billing (two paths):

    • Without a reference video: credits = output_seconds × base_credits_per_second
    • With a reference video (upstream provider path): credits = (ref_video_seconds + output_seconds) × base_credits_per_second, where ref_video_seconds is the sum of all reference video durations (capped at 15s per request).

    Live per-second rates (pulled from the ai_models_config catalog — always current):

    ModelNameRateUnit
    seedance-2-1080pSeedance 2 (1080p)87credits / sec
    seedance-2-1080p-video-refSeedance 2 (1080p, video ref)55credits / sec
    seedance-2-480pSeedance 2 (480p)22credits / sec
    seedance-2-480p-video-refSeedance 2 (480p, video ref)17credits / sec
    seedance-2-4kSeedance 2 (4K)260credits / sec
    seedance-2-4k-video-refSeedance 2 (4K, video ref)165credits / sec
    seedance-2-5-1080pSeedance 2.5142credits / sec
    seedance-2-5-1080p-video-refSeedance 2.5 (video ref)85credits / sec
    seedance-2-5-480pSeedance 2.529credits / sec
    seedance-2-5-480p-video-refSeedance 2.5 (video ref)17credits / sec
    seedance-2-5-720pSeedance 2.561credits / sec
    seedance-2-5-720p-video-refSeedance 2.5 (video ref)36credits / sec
    seedance-2-720pSeedance 2 (720p)39credits / sec
    seedance-2-720p-video-refSeedance 2 (720p, video ref)29credits / sec
    seedance-2-fast-480pSeedance 2.0 Fast19credits / sec
    seedance-2-fast-480p-video-refSeedance 2.0 Fast (video ref)15credits / sec
    seedance-2-fast-720pSeedance 2.0 Fast31credits / sec
    seedance-2-fast-720p-video-refSeedance 2.0 Fast (video ref)22credits / sec
    seedance-2-mini-480pSeedance 2 Mini12credits / sec
    seedance-2-mini-480p-video-refSeedance 2 Mini (video ref)8credits / sec
    seedance-2-mini-720pSeedance 2 Mini24credits / sec
    seedance-2-mini-720p-video-refSeedance 2 Mini (video ref)15credits / sec

    MCP / REST API note: the backend cannot probe remote video durations from a URL, so reference-video requests from the MCP and REST API are billed the pessimistic worst case of 15s of reference video. The web UI probes each video locally and bills the exact sum. For cost-sensitive workflows with short reference videos, prefer the web UI.

    Hard limits (enforced with 400 errors):

    • More than 3 videos → too_many_videos
    • More than 3 audios → too_many_audios
    • More than 9 images → too_many_images
    • Combined reference video duration > 15s → rejected
    • Combined reference audio duration > 15s → rejected
    • Any single reference video or audio file longer than 15s → rejected

    <a id="seedance-2-5"></a>

    Seedance 2.5: long single shots and heavy references:

    Seedance 2.5 is the newest Seedance generation and a separate model from the Seedance 2.0 family above, with its own rules. Pick it for a long single-shot clip (up to 30 seconds in one generation, no stitching), for heavy multi-reference work, or when the user wants the most recent model. Pick a 2.0 tier when they need 4K or the lowest per-second rate.

    • Variant ids: seedance-2-5-480p, seedance-2-5-720p, seedance-2-5-1080p, and the same three with -video-ref for requests carrying a reference video. A bare seedance-2-5 returns variant_required. No 4K on 2.5.
    • Duration: integer 4 to 30 seconds. Aspect ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, adaptive. Prompt: up to 10,000 characters.
    • Text-to-video: up to 30 images, 10 videos and 10 audio clips, all optional. Put every URL in source_media_urls; each is classified by file extension. Refer to them in the prompt as @Image 1, @Video 1, @Audio 1, numbered by order within each kind.
    • Image-to-video: 1 image (first frame) or 2 (first + last), plus up to 10 audio clips. The output always takes the first frame's aspect ratio, so aspect_ratio is ignored, and no other reference images or videos are accepted. Unlike Seedance 2.0, this is never silently rerouted to text-to-video. To lock a first frame and keep extra references, use text-to-video and name the frame in the prompt.
    • Audio: on by default and free; sound: false costs the same and only drops the track.
    • Billing: per second of output without a reference video. With a reference video the provider also counts input seconds, with a floor of two thirds of the output length, and because the MCP server cannot measure a remote clip it bills the worst case of 30 reference seconds. Always quote with estimate first.

    Draft mode (preview first, pay for 1080p once the shot is right):

    1. Render a draft with model: "seedance-2-5-480p" (or bare seedance-2-5) and quality: "draft". It is a 480p preview billed like a normal 480p render. quality: "draft" on a 720p or 1080p id is rejected.
    2. When the draft is completed, call generate_media again with draft_generation_id: "<the draft's generation_id>". Prompt and model are ignored in that call: the final reuses the draft's prompt, references, duration and aspect ratio, renders at 1080p and bills on the seedance-2-5-1080p row (or -1080p-video-ref). A draft can be finalized for 7 days, and finalizing the same draft twice returns the existing final without a second charge.
    ModelNameRateUnit
    seedance-2-5-1080pSeedance 2.5142credits / sec
    seedance-2-5-1080p-video-refSeedance 2.5 (video ref)85credits / sec
    seedance-2-5-480pSeedance 2.529credits / sec
    seedance-2-5-480p-video-refSeedance 2.5 (video ref)17credits / sec
    seedance-2-5-720pSeedance 2.561credits / sec
    seedance-2-5-720p-video-refSeedance 2.5 (video ref)36credits / sec

    <a id="flux-3"></a>

    FLUX 3: video with synchronized audio:

    FLUX 3 renders one clip with synchronized audio (ambient sound, speech, effects) from a single prompt. There is no mode parameter: the mode comes from what you put in source_media_urls (see the input limits table above).

    • Model ids: pass the bare flux-3 and the row is picked for you from quality (720p default, 1080p, 720p-draft or draft) plus whether a video is attached. You can also pass a concrete id: flux-3-720p, flux-3-1080p, flux-3-720p-draft for text and image input, flux-3-v2v-720p, flux-3-v2v-1080p, flux-3-v2v-720p-draft for continuing a video. A request carrying a video always bills on a flux-3-v2v-* row, whatever id you passed.
    • Continuation costs more. The -v2v- rows are separate, dearer rows. Read each rate from get_models or estimate, never assume.
    • Duration: integer 5 to 20 seconds, required. Pass an explicit duration for storyboards too.
    • Aspect ratios: auto (default), 21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16.
    • Audio: on by default; sound: false costs the same and only drops the track.
    ModelNameRateUnit
    flux-3-1080pFLUX 382credits / sec
    flux-3-720pFLUX 348credits / sec
    flux-3-720p-draftFLUX 3 Draft17credits / sec
    flux-3-v2v-1080pFLUX 3149credits / sec
    flux-3-v2v-720pFLUX 3115credits / sec
    flux-3-v2v-720p-draftFLUX 3 Draft34credits / sec

    <a id="kling-3-0-omni"></a>

    Kling 3.0 Omni: Transform, Frames and References:

    Kling 3.0 Omni is one model with three lanes, and the variant id picks the lane. There is no text-to-video: every lane needs media in source_media_urls. Storyboards and Kling 3.0 elements are not available here.

    LaneVariant idsInputDurationAudio
    Transform (restyle a video)kling-3-0-omni-720p, -1080p, -4kSource video first, then up to 4 reference imagesNone: billed on the source clip's lengthsound: true adds a generated soundtrack
    Frames (animate between two stills)kling-3-0-omni-frames-720p, -1080p, -4k, each also -audioExactly 2 images: first frame, last frame3 to 15sAudio on costs more per second, hence the -audio ids
    References (new clip guided by references)kling-3-0-omni-ref-720p, -1080p, -4k, each also -audio or -videoUp to 7 images, or 1 video + up to 4 images, or 1 video alone3 to 15s; a video on its own takes none and bills the clipImages only is cheapest, -audio costs more, -video costs more again and forces sound off

    All lanes bill per second at their own rates, and Frames is cheaper than Transform. Read the exact rate from get_models or estimate.

    <a id="kling-4-0"></a>

    Kling 4.0:

    Kling 4.0 is one model for text-to-video and reference-to-video. Send no media for a clip from the prompt alone, or attach up to 10 reference images and up to 5 reference videos (3 to 30 seconds each, 30 seconds combined) in any mix. Output runs 3 to 30 seconds at 720p or 1080p, with aspect_ratio set to auto, 16:9, 9:16, 1:1 or 21:9. Left unset, it is auto when references are attached and 16:9 when they are not.

    Point at your files in the prompt with @image_1, @image_2 and @video_1, @video_2, numbered in the order you send them. A mention that does not match an attached file (for example @image_3 with two images) is rejected before any credits are taken. You can also pass named elements (a subject described by 2 or more images, or by one video) and up to 3 voices (5 to 30 second samples), and mention each in the prompt as @name; only the ones the prompt mentions are sent. A video element is video input: it moves the job onto the -video row and its seconds count with the reference videos. Image elements and voices add no cost.

    Inputs: pass images and videos in source_media_urls, or split them across reference_image_urls and reference_video_urls. Videos must be MP4 or MOV and must be uploaded to Kubeez first (get_upload_url on MCP, POST /v1/upload/media on REST). A video linked from another site is refused with clip_not_uploaded before any credits are taken, because each video is billed on the length Kubeez measures. Keep the videos' own audio with keep_original_sound: true. A bare kling-4-0 returns variant_required; pass one of the four ids below.

    Variant idsWhenBilled seconds
    kling-4-0-720p, kling-4-0-1080pNo reference video (prompt only, or images)The duration you pass
    kling-4-0-720p-video, kling-4-0-1080p-videoAt least one reference videoThe duration you pass, plus the longer of that duration or the total length of your videos

    The -video rows have a lower per-second rate because the clip length is billed as well. Example: 10s out with a 5s video bills 20 seconds; with a 15s video it bills 25. Several videos are added together.

    Audio: without a reference video the clip always comes with generated sound. With one, the soundtrack is generated unless you ask to keep the original audio of your videos.

    ModelNameRateUnit
    kling-4-0-1080pKling 4.0 (1080p)58credits / sec
    kling-4-0-1080p-videoKling 4.0 (1080p, with video)35credits / sec
    kling-4-0-720pKling 4.0 (720p)39credits / sec
    kling-4-0-720p-videoKling 4.0 (720p, with video)23credits / sec

    <a id="omnihuman-2-0"></a>

    OmniHuman 2.0:

    OmniHuman 2.0 makes a portrait talk or sing. Send one image of a person and one audio file (speech or a song), and you get a lip-synced video of that person, 720p, exactly as long as the audio. There is no duration, resolution or aspect ratio to set. The prompt is optional (up to 300 characters) and steers the scene, the person's movement and the camera.

    The audio must be MP3 or WAV, under 15 MB and 4 to 300 seconds long, and it must be uploaded to Kubeez first (get_upload_url on MCP, POST /v1/upload/media on REST). Kubeez measures the audio itself and bills on that length: whole seconds, rounded up, with a small allowance so a file that reads 5.02 seconds is billed as 5. If the audio cannot be measured at that moment, the request is refused before any credits are taken; try again in a minute.

    ModelNameRateUnit
    omnihuman-2-0OmniHuman 2.019credits / sec

    <a id="veo-3-1"></a>

    Veo 3.1 model ids:

    Veo 3.1 has no single family id: veo3-1, veo3-1-fast and veo3-1-lite on their own are not callable, so always pass a full id. The id is built from three parts:

    PartOptions
    Tierveo3-1 (quality), veo3-1-fast, veo3-1-lite (budget)
    Mode-text-to-video (0 or 1 image), -first-and-last-frames (exactly 2 images), -reference-to-video (1 to 3 images, 16:9 only)
    Resolutionnothing for 720p, -1080p, -4k

    Examples: veo3-1-text-to-video, veo3-1-fast-first-and-last-frames-1080p, veo3-1-lite-reference-to-video-4k. Every clip is a fixed 8 seconds with audio included, in 16:9 or 9:16. Each tier, mode and resolution is its own priced row in get_models. To continue a finished clip, use generation_type: "extend" with source_task_id and extend_model (lite, fast or quality).

    Gemini Omni Video — Google's multi-modal video model:

    Gemini Omni Video produces video output with built-in audio (29 named voices) and accepts multi-modal inputs (text, image references, an optional single video reference). The model ships as 15 concrete variants — pick the one that matches your target resolution and duration. 720p and 1080p are priced identically; 4K is a separate price tier.

    Variant ids (pass to generate_media as model):

    Resolution4s6s8s10sVideo-ref (flat)
    720pgemini-omni-video-720p-4sgemini-omni-video-720p-6sgemini-omni-video-720p-8sgemini-omni-video-720p-10sgemini-omni-video-720p-video-ref
    1080pgemini-omni-video-1080p-4sgemini-omni-video-1080p-6sgemini-omni-video-1080p-8sgemini-omni-video-1080p-10sgemini-omni-video-1080p-video-ref
    4Kgemini-omni-video-4k-4sgemini-omni-video-4k-6sgemini-omni-video-4k-8sgemini-omni-video-4k-10sgemini-omni-video-4k-video-ref

    Video-ref variants take their output duration from the trimmed source clip (first 10s used; no trim parameters exposed). Duration variants accept 1–7 image references; video-ref variants accept 1 source clip (consumes 2 slots) + up to 5 image references.

    Pricing is flat-per-task. Live rates (720p and 1080p share each row — Google bills them identically):

    ModelNameRateUnit
    gemini-omni-video-4k-10sGemini Omni Video (4K)320credits
    gemini-omni-video-4k-4sGemini Omni Video (4K)230credits
    gemini-omni-video-4k-6sGemini Omni Video (4K)260credits
    gemini-omni-video-4k-8sGemini Omni Video (4K)290credits
    gemini-omni-video-4k-video-refGemini Omni Video (video ref, 4K)380credits
    gemini-omni-video-hd-10sGemini Omni Video200credits
    gemini-omni-video-hd-4sGemini Omni Video110credits
    gemini-omni-video-hd-6sGemini Omni Video140credits
    gemini-omni-video-hd-8sGemini Omni Video170credits
    gemini-omni-video-hd-video-refGemini Omni Video (video ref)260credits

    #Gemini Omni 1.1 Flash

    gemini-omni-flash-* is the 1.1 release of the same family, with its own edge function and its own pricing rows. It reads the same image, video and character references and uses the same 29-voice catalog. What it adds:

    • a 360p tier. Unlike 1.0, every resolution has its own row here, so 360p is both the fastest render and the cheapest, and 1080p costs more than 720p
    • a first and last frame mode: pass the opening still in source_media_urls and the closing still as last_frame_url. This mode is exclusive — it cannot be combined with extra reference images, a reference video or character_ids, and passing them together returns variant_mismatch.

    Variant ids (pass to generate_media as model):

    Resolution4s6s8s10sVideo-ref (flat)
    360pgemini-omni-flash-360p-4sgemini-omni-flash-360p-6sgemini-omni-flash-360p-8sgemini-omni-flash-360p-10sgemini-omni-flash-360p-video-ref
    720pgemini-omni-flash-720p-4sgemini-omni-flash-720p-6sgemini-omni-flash-720p-8sgemini-omni-flash-720p-10sgemini-omni-flash-720p-video-ref
    1080pgemini-omni-flash-1080p-4sgemini-omni-flash-1080p-6sgemini-omni-flash-1080p-8sgemini-omni-flash-1080p-10sgemini-omni-flash-1080p-video-ref
    4Kgemini-omni-flash-4k-4sgemini-omni-flash-4k-6sgemini-omni-flash-4k-8sgemini-omni-flash-4k-10sgemini-omni-flash-4k-video-ref
    ModelNameRateUnit
    gemini-omni-flash-1080p-10sGemini Omni 1.1 Flash (1080p)220credits
    gemini-omni-flash-1080p-4sGemini Omni 1.1 Flash (1080p)130credits
    gemini-omni-flash-1080p-6sGemini Omni 1.1 Flash (1080p)160credits
    gemini-omni-flash-1080p-8sGemini Omni 1.1 Flash (1080p)190credits
    gemini-omni-flash-1080p-video-refGemini Omni 1.1 Flash (video ref, 1080p)280credits
    gemini-omni-flash-360p-10sGemini Omni 1.1 Flash (360p)200credits
    gemini-omni-flash-360p-4sGemini Omni 1.1 Flash (360p)110credits
    gemini-omni-flash-360p-6sGemini Omni 1.1 Flash (360p)140credits
    gemini-omni-flash-360p-8sGemini Omni 1.1 Flash (360p)170credits
    gemini-omni-flash-360p-video-refGemini Omni 1.1 Flash (video ref, 360p)260credits
    gemini-omni-flash-4k-10sGemini Omni 1.1 Flash (4K)320credits
    gemini-omni-flash-4k-4sGemini Omni 1.1 Flash (4K)230credits
    gemini-omni-flash-4k-6sGemini Omni 1.1 Flash (4K)260credits
    gemini-omni-flash-4k-8sGemini Omni 1.1 Flash (4K)290credits
    gemini-omni-flash-4k-video-refGemini Omni 1.1 Flash (video ref, 4K)380credits
    gemini-omni-flash-720p-10sGemini Omni 1.1 Flash (720p)210credits
    gemini-omni-flash-720p-4sGemini Omni 1.1 Flash (720p)120credits
    gemini-omni-flash-720p-6sGemini Omni 1.1 Flash (720p)150credits
    gemini-omni-flash-720p-8sGemini Omni 1.1 Flash (720p)180credits
    gemini-omni-flash-720p-video-refGemini Omni 1.1 Flash (video ref, 720p)270credits

    Parameters specific to Gemini Omni:

    ParameterTypeNotes
    resolution—Ignored — encoded in the variant id.
    duration—Ignored — encoded in the variant id. Video-ref variants take their duration from the trimmed source clip.
    aspect_ratiostringStrictly 16:9 or 9:16. Any other value returns aspect_ratio_invalid_for_model.
    voice_idstring (optional)One of 29 built-in voices (e.g. kore, puck, achernar, zephyr). Discover the full list via the list_gemini_omni_voices tool — unknown ids are rejected client-side before any credits are charged. Omit to use the model's default voice.
    character_idsstring[] (optional)One or more saved characters from the user's library (created via manage_library(kind="character", action="create", ...), listed via list_gemini_omni_characters). Each consumes 1 of the 7 reference slots. Provider renders a consistent identity across multiple clips.
    video_trim_start_snumber (optional)Trim window start (seconds) for the reference video. Default 0.
    video_trim_end_snumber (optional)Trim window end (seconds) for the reference video. Default: min(source_duration, start+10) when the URL is in media_upload_metadata, else start+10. Provider hard limits: range ≤ 10s, ends ≤ 30s.
    seednumber (optional)Reproducible runs.
    negative_prompt—Not supported. Silently stripped.
    sound—Not supported — audio is intrinsic to every output.

    Source media (source_media_urls): 7 reference slots total. A single video reference consumes 2 slots; each character_id consumes 1 slot; images fill the rest. Maximum 1 video per request; passing a video URL requires a -video-ref variant (a duration variant + video returns variant_mismatch). The driving clip window defaults to the first 10 seconds; override with video_trim_start_s / video_trim_end_s. Audio file URLs are not accepted (returns unsupported_audio_url); use voice_id instead.

    Companion tools (use these alongside Gemini Omni generations):

    ToolPurpose
    list_gemini_omni_voicesStatic catalog of all 30 voices (id, label, gender, character, preview_url to a ~7s mp3 sample). Free to call.
    play_gemini_omni_voiceReturns the preview_url for a single voice id — quicker than fetching the full catalog when you already know the voice. Surface the URL to the user so they can hear it before committing.
    list_gemini_omni_charactersList the user's saved characters. Each row has a character_id to pass to generate_media and an internal id for delete.
    manage_library(kind="character", action="create", ...)Persist a new character from a reference image + description (+ optional character_name, voice_id). Returns the provider's opaque character_id.
    manage_library(kind="character", action="delete", character_id=...)Local delete (the provider has no delete endpoint). Past generations that used this character keep their outputs.
    trim_videoCut a long source video down to the ≤10s window Gemini Omni needs for -video-ref variants. Returns a hosted URL ready to use as source_media_urls.

    Example request (1080p, 6s, vertical, reusing a saved character + chosen voice):

    {
      "model": "gemini-omni-video-1080p-6s",
      "prompt": "A barista pulls a perfect espresso shot, narrates the process",
      "aspect_ratio": "9:16",
      "voice_id": "kore",
      "character_ids": ["char_4f2a9b7c"],
      "source_media_urls": ["https://media.kubeez.com/cafe-shot.jpg"]
    }
    

    Family-name disambiguation:

    Some model families expose multiple concrete variants per resolution / quality / reference-video combo: seedance-2, seedance-2-fast, seedance-2-mini, seedance-2-5, gemini-omni-video, gemini-omni-flash, kling-3-0-omni, kling-3-0-turbo, kling-3-0-motion-control, kling-2-6-motion-control, wan-2-7, wan-3-0, wan-3-0-prime, grok-imagine-video-1-5-preview. Passing just the family label as model returns the error below. Two families are exceptions and accept their bare id: p-video and flux-3 pick the row from quality (and, for FLUX 3, from whether a video is attached), and bare seedance-2-5 with quality: "draft" maps to seedance-2-5-480p. Veo 3.1 has no family label at all, see Veo 3.1 model ids.

    {
      "error": "variant_required",
      "family": "seedance-2-fast",
      "available_variants": [
        "seedance-2-fast-480p",
        "seedance-2-fast-720p"
      ],
      "recommended_variant": "seedance-2-fast-720p",
      "hint": "Adopt recommended_variant and continue: the cost (and thus the resolution/price trade-off) is confirmed on the plan card, so a separate variant question is usually unnecessary. Ask only when the user signalled they care about price/quality. available_variants is already filtered to the input modality (the -video-ref variants appear only when a reference video is attached)."
    }
    

    No credits are deducted. available_variants is filtered to your input modality and recommended_variant names the default to use. Best practice: skip the round-trip by passing a concrete model_id (e.g. seedance-2-fast-720p) on the first call instead of the bare family. Re-call generate_media with the concrete id from recommended_variant / available_variants (or any id from get_models).

    Video audio (two different concepts):

    1. capabilities.video_audio in get_models — how to know if the output has sound:
      • included: The model’s output normally includes an audio track without using a sound parameter (e.g. Veo, Wan, Grok, Motion Control, Gemini Omni Video — the latter exposes a voice_id parameter to pick from 29 built-in voices).
      • toggle_via_sound_param — Generated audio is turned on/off with sound: true / false (Kling 2.6, Kling 3.0). Pricing may differ for audio vs silent. Kling 3.0 routes sound: true to dedicated -audio rows in the catalog — you keep using kling-3-0-std / kling-3-0-pro as the model id and just toggle sound, the server picks the right priced row. Live rates:
    ModelNameRateUnit
    kling-3-0-proKling 3.0 Pro21credits / sec
    kling-3-0-pro-audioKling 3.0 Pro (with audio)30credits / sec
    kling-3-0-stdKling 3.017credits / sec
    kling-3-0-std-audioKling 3.0 Std (with audio)23credits / sec

    Motion Control per-second rates (Kling 3.0 and Kling 2.6):

    No models matched this family. kling-3-0-motion-control,kling-2-6-motion-control

    (Motion-control rates are shown as one block since the two families share the same pricing shape: 720p and 1080p variants.) Seedance 2 also exposes a sound toggle (via its own generate_audio flag, default true) but audio is free, with no surcharge vs silent. Seedance 2.5 and FLUX 3 toggle through sound too, also free. Kling 3.0 Omni Frames and References price audio through their -audio ids.

    • always_on_flat_rate: audio is always produced and the price does not change with it (kling-3-0-4k). The sound param is accepted but has no effect on cost.
    • silent — No generated audio (Seedance 1.0 / v1-pro-fast-i2v only).
    1. supports_sound — only means the API accepts a sound toggle for that model. It does not mean other models are silent; most video models use video_audio: included instead.

    Image-only models ignore sound.

    #Upscale

    Re-renders one existing image at a higher resolution with sharper detail, keeping its composition, colours and content. Call generate_media with upscale-1k, upscale-2k or upscale-4k and the image in source_media_urls. prompt is required by the schema but ignored, and so are aspect_ratio and negative_prompt. The output is a PNG.

    ModelNameRateUnit
    upscale-1kUpscale 1K22credits
    upscale-2kUpscale 2K26credits
    upscale-4kUpscale 4K32credits
    • Input: exactly one public .jpg / .jpeg / .png / .webp URL. An earlier generation output URL works directly; for a local file call get_upload_url(model_id="upscale-2k") first.
    • Tier: pick it with the model id, or pass model: "upscale" with resolution: "1K", "2K" or "4K".
    • Billing: flat per image, one price per tier. Call estimate for the exact price and confirm with the user first.
    • Where: MCP only for now. The REST API does not run upscale yet.

    To change what is in the image rather than its resolution, use an image-to-image model.

    #REST API: URLs for local or browser files

    If you use the HTTP API (POST /v1/generate/media) and your inputs are files on disk or selected in the browser—not already public URLs—upload each file first with POST /v1/upload/media. Pass the returned urls values as source_media_urls.


    <a id="trim_video"></a>

    #trim_video

    Cut a window out of any publicly-accessible video URL and host the trimmed clip. Kubeez handles the trim server-side and returns a public url you can pass straight into generate_media as a source_media_urls value.

    When to use this tool:

    • The user's source video is longer than a model's reference-clip limit and you want the result to be deterministic instead of relying on provider-side trim hints.
    • You want to use a specific window of a longer asset (e.g. "use seconds 5–12 of this take, not the first 10").
    • You're chaining multiple generations and want a single canonical trimmed URL to reuse across calls.

    Per-model reference-clip caps (skip the trim when the source already fits):

    ModelReference-clip capNotes
    Gemini Omni Video (-video-ref variants)≤ 10s window from the first 30s of sourceRequired when using a duration variant + a video ref returns variant_mismatch.
    Kling 2.6 / 3.0 Motion Control≤ 30s video referenceProvider truncates longer clips; trim explicitly for predictable framing.
    Seedance 2 / 2 Fast≤ 15s combined reference video timeIf you pass multiple ref videos, trim each so the sum fits.

    Parameters:

    ParameterTypeRequiredDescription
    source_urlstringYesPublicly accessible source video URL (Kubeez upload URL, R2/S3 URL, any public CDN).
    end_snumberYesTrim window end, in seconds. Must be > start_s; the resulting end_s − start_s range is capped at 60s.
    start_snumberNoTrim window start, in seconds. Default 0.

    Returns: { url, size_bytes, duration_s, start_s, end_s, elapsed_s }. The url is a Kubeez-hosted public link pointing at the media-inputs Supabase storage bucket, safe to use as a source_media_urls value. Trimmed clips live alongside user-uploaded inputs and share the same weekly auto-cleanup — treat them as ephemeral, not as a permanent asset.

    Typical workflow (Gemini Omni Video with a long user source):

    1. get_upload_url(model_id="gemini-omni-video-1080p-video-ref")
           → presigned upload page
    2. (user uploads their 25s clip via the link)
    3. get_upload_session(token) → { media_urls: ["https://.../source.mp4"] }
    4. trim_video(source_url=media_urls[0], start_s=5, end_s=15)
           → { url: "https://.../trims/<uuid>.mp4", duration_s: 10 }
    5. generate_media(
           model="gemini-omni-video-1080p-video-ref",
           prompt="...",
           source_media_urls=[<trimmed url>]
       )
    

    Standalone trim (source URL already public — no upload step needed):

    trim_video(source_url="https://media.kubeez.com/<asset>.mp4", start_s=0, end_s=8)
           → { url, duration_s: 8 }
    generate_media(model="kling-3-0-motion-control-1080p", source_media_urls=[<image>, <trimmed url>], ...)
    

    Errors:

    Error codeCause
    missing_source_urlsource_url not provided.
    unsafe_source_urlsource_url uses a non-http(s) scheme, contains embedded credentials, or resolves to a private/loopback/metadata IP. Kubeez refuses to fetch internal hosts — pass a publicly-resolvable URL.
    invalid_trim_rangeend_s ≤ start_s, negative start_s, or non-numeric values.
    trim_too_longend_s − start_s > 60s.
    source_too_largeSource video > 500 MB.
    source_fetch_failedSource URL returned 4xx, 5xx, was unreachable, or hit the redirect-hop cap.
    ffmpeg_failedffmpeg rejected the file (unsupported codec / corrupt container).
    processor_timeoutTrim service exceeded its download/processing budget.
    processor_unavailableTrim service is temporarily unreachable. Retry later or contact support if it persists.

    Example request:

    {
      "source_url": "https://media.kubeez.com/u123/uploads/long-take.mp4",
      "start_s": 5.2,
      "end_s": 14.7
    }
    

    Example response:

    {
      "url": "https://<project>.supabase.co/storage/v1/object/public/media-inputs/u123/trims/abc.mp4",
      "size_bytes": 1245678,
      "duration_s": 9.5,
      "start_s": 5.2,
      "end_s": 14.7,
      "elapsed_s": 1.83
    }
    

    Frame accuracy: -c copy snaps the actual start to the nearest preceding keyframe (≤ 1 GOP shift, typically ≤ 1s). This matches the web UI's native MP4 stream-copy behavior. For frame-accurate cuts, re-encode the source first — the tradeoff is a slower, lossy operation we deliberately avoid here.

    Don't keep the output: the URL points at the media-inputs bucket which is cleared weekly. If you need the trimmed clip to outlive the next generation, use manage_library(kind="asset", action="add", ...) to copy it into the user's permanent Asset Library.


    #remove_background

    Cut the subject out of an image. The output is a PNG with a real transparent background (alpha), which is why you never prompt an image model for a "transparent background" — image models bake a white or checkerboard fill into the pixels instead. Takes no prompt: it is an operation on an existing image, not a generate_media model.

    Billed flat per image. Call estimate with model: "remove-background" for the exact price and confirm with the user first.

    Parameters:

    ParameterTypeRequiredDescription
    image_urlstringYesPublic HTTPS URL of a .jpg / .jpeg / .png / .webp image, max 5 MB. An earlier generation output URL works directly; for a local file call get_upload_url(model_id="remove-background") first.

    Response: { generation_id, status: "pending" }. Poll get_status until completed; the output URL is the cutout PNG.


    #regenerate

    Re-run a past media generation with optional overrides. The original row's prompt, model, aspect ratio, source_media_urls and duration are reused unless you override them. Media only — music, separation and dialogue have to call their original tool again.

    Cost is identical to a fresh generate_media, so confirm with the user before calling, especially for per-duration video models.

    Parameters:

    ParameterTypeRequiredDescription
    idstringYesgeneration_id of a media generation you own.
    promptstringNoReplaces the original prompt.
    seednumberNoForce a new seed. 0 lets the provider pick.
    aspect_ratiostringNoOverride the original aspect ratio.
    negative_promptstringNoOverride the original negative prompt.
    variant_countnumberNo1-4. Fans out N parallel calls and returns N generation_ids.

    #get_status

    Poll any job by id — media generation, music generation, or audio separation. The server auto-dispatches on the id, so one tool covers all three.

    Parameters:

    ParameterTypeRequiredDescription
    idstringYesgeneration_id or separation_id returned by the generate_* call.
    kindstringNomedia, music, or separation. Skips the auto-dispatch lookup.

    Response: kind (what the id resolved to), status (pending, queued, processing, completed, failed), progress, and depending on kind an outputs array (url, thumbnail_url, optimized_url, media_type, dimensions), a songs array, or vocals_url + instrumental_url. error_message on failure.


    #estimate

    Preview both the credit cost and the processing time of a generation without deducting anything. No job is started. Mandatory for every per-duration model: quote the number to the user and wait for a go-ahead, because a completed generation cannot be refunded.

    Parameters:

    ParameterTypeRequiredDescription
    modelstringYesThe same model ID you would pass to generate_media or generate_music.
    generation_typestringNoSame as in generate_media. Default: text-to-image.
    durationnumber or stringNoOutput seconds, for per-second video models.
    soundbooleanNoDefaults to true, matching generate_media. Pass false to preview the silent rate on models that price audio separately.
    reference_video_secondsnumberNoFrom get_upload_session.media[].duration_seconds. Omit and the server bills the pessimistic cap.
    reference_audio_secondsnumberNoFor audio-driven models: separation, P-Video with an audio input.

    Response: credits (estimated_credits, mode, rate_per_second, explanation, pessimistic) and time (estimated_seconds, source). When credits.pessimistic is true the real billed amount may be lower — have the user re-upload through get_upload_url so duration gets probed, then estimate again.


    #Model rules

    • Text-to-image and text-to-video: Do not send source_media_urls (unless the model supports an optional reference image).
    • Image-to-video and image-to-image: Send image (and when supported, video) URL(s) in source_media_urls. Most models need images only; some (e.g. Kling 2.6 Motion Control) require 1 image + 1 video. Respect each model’s input limits above.
    • Video audio: Use capabilities.video_audio from get_models. included: audio is part of typical output without a sound parameter (e.g. Veo, Wan, Grok). toggle_via_sound_param: sound defaults to true; pass false only when the user asks for a silent clip (Kling 2.6, Kling 3.0, Seedance 2.5, FLUX 3, Kling 3.0 Omni). always_on_flat_rate: audio always on at one price (kling-3-0-4k). silent: no generated audio (Seedance 1.0 only). Do not infer “no audio” from supports_sound: false alone.
    • Use get_models to see which models support which generation types, input_media_types (e.g. image, video), and required input counts.

    See Limitations for rate limits and credits. For a single table of API defaults (prompt max, inputs, duration, flags), see REST API model requirements.