Video Endpoints

video.generate makes a short video from a prompt, as an MP4 file with sound. It can start from an image you send. It is part of All tools.

A start needs the scope and enough credits, and the tool must be available in /v1/health. It needs bought credits (a credit pack) or a monthly plan: free credits (the guest trial and the signup bonus) do not cover it, and a start on free credits returns operation_not_available_on_free. Accepted starts return 202 Accepted; poll their status. The video and a poster image are artifacts: download them with the download_url of each artifact.

The video endpoint is preview. Preview means the contract may still evolve before stable release.

Shared Access

  • Access: Paid plans that include this family, or bought credits. Free credits do not cover it.
  • Operation family: Images
  • Scope: api:convert:write, the same scope as file conversion and the image tools
  • Idempotency: Idempotency-Key header required

Starting Image

image is optional. The video then begins with that picture, for example a product photo that starts to move. It is read in the same three ways as the images of the image tools:

  • {"type": "file_id", "id": "fil_..."}: a file you uploaded with POST /v1/files or the hosted MCP upload link. Wait until the file is available.
  • {"type": "artifact_id", "id": "art_..."}: an artifact of an earlier operation, such as an image from images.generate.
  • {"type": "url", "url": "https://..."}: a public https URL. Chab downloads the image when the operation runs, with the same address checks as the scrape tools, and checks it for viruses like an upload.

PNG, JPEG, WebP and HEIC images work, up to your plan's upload size. When the image does not have the shape of the video, the video crops it.

Pricing

Resolution Price per second 5 seconds
360p 19 credits 95 credits
720p 56 credits 280 credits
1080p 84 credits 420 credits
4k 168 credits 840 credits

Sound costs nothing extra. Chab reserves the price of the seconds you ask for and charges the video that was made, at most what it reserved. A request that fails before the video is made costs nothing. So does a video the model refuses (content_refused) or cannot make. See Credits and Billing.

POST/v1/video/generate

Makes a video of 3 to 15 seconds from a prompt, landscape or portrait, with sound that fits the scene.

Required Access

  • Credits: the price per second of the resolution, times duration, reserved at the start.
  • Scope: api:convert:write

Request

{
  "prompt": "A paper boat floats down a small stream in a sunny park. The camera follows it slowly. Birds sing and the water splashes softly.",
  "duration": 4,
  "resolution": "360p"
}

Curl example:

curl -X POST https://www.chab.ai/v1/video/generate \
  -H "Authorization: Bearer CHAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: paper-boat-001" \
  -d '{"prompt":"A paper boat floats down a small stream in a sunny park. The camera follows it slowly. Birds sing and the water splashes softly.","duration":4,"resolution":"360p"}'

Fields:

  • prompt: required, 3 to 4,000 characters. Say what happens, where, how the camera moves and what you hear. With a starting image, say what moves.
  • image: optional starting image, see Starting Image.
  • duration: optional, 3 to 15 seconds, default 5.
  • aspect_ratio: optional, 16:9 (landscape) or 9:16 (portrait). Default 16:9; with a starting image, the one closer to the shape of the image.
  • resolution: optional, 360p, 720p (default), 1080p or 4k. A landscape video is 640 x 360, 1280 x 720, 1920 x 1080 or 3840 x 2160 pixels; a portrait video swaps width and height.
  • sound: optional, default true. false makes a silent video for the same price.
  • callback_url, callback_secret, callback_events, and callback_notify_on_expiration: optional one-off operation callback fields.

Most videos are ready in one to three minutes. The operation stays running until then; poll GET /v1/operations/{id} every 15 to 30 seconds, or set a callback. If the video is not ready after 20 minutes, the operation fails with provider_unavailable and costs nothing.

Video Result

{
  "data": {
    "result": {
      "duration_seconds": 4.03,
      "resolution": "360p",
      "aspect_ratio": "16:9",
      "width": 640,
      "height": 360,
      "sound": true,
      "video": { "filename": "video.mp4", "mime_type": "video/mp4", "byte_size": 1783846 },
      "poster": { "filename": "video-poster.jpg", "mime_type": "image/jpeg", "width": 640, "height": 360, "byte_size": 27176 },
      "usage": { "seconds": 4 }
    },
    "artifacts": [
      {
        "id": "art_...",
        "type": "video",
        "role": "generated_video",
        "mime_type": "video/mp4",
        "byte_size": 1783846,
        "filename": "video.mp4",
        "download_url": "/v1/operations/op_.../artifacts/art_.../download"
      },
      {
        "id": "art_...",
        "type": "image",
        "role": "video_poster",
        "mime_type": "image/jpeg",
        "byte_size": 27176,
        "filename": "video-poster.jpg",
        "download_url": "/v1/operations/op_.../artifacts/art_.../download"
      }
    ],
    "warnings": [],
    "result_expires_at": "2026-11-19T21:16:35+00:00"
  },
  "meta": {
    "request_id": "req_123"
  }
}

This video was ready about 45 seconds after the start and cost 76 credits. It shows a white paper boat drifting down a clear, shallow stream over pebbles, past a mossy stone, with sunlit trees behind it. The camera moves along with the boat, and the file has a sound track.

Another run from the same day started from the coffee photo at https://upload.wikimedia.org/wikipedia/commons/4/45/A_small_cup_of_coffee.JPG with the prompt "Steam rises slowly from the hot coffee. The camera moves a little closer to the cup. Quiet cafe sounds in the background.", 4 seconds at 360p. The video begins with the photo, cropped to 16:9, and steam curls up from the cup while the camera moves closer. Its result also has source (the image's type, url, filename, format and byte_size). It cost 76 credits.

Result fields:

  • duration_seconds: the length of the video file.
  • resolution, aspect_ratio, width, height: the size of the video.
  • sound: whether sound was asked for.
  • video: the MP4 file (H.264 video, AAC sound), also the artifact with role generated_video.
  • poster: a JPEG of one frame from the first second, also the artifact with role video_poster. It is null, with a warning, when it could not be made; the video is complete then.
  • source: the starting image, when one was sent. A URL is shown without its query.
  • usage.seconds: the seconds asked for.

Both artifacts can be used again: the poster as an image for the image tools, the video as a recording for speech.transcribe.

Cancelling

A video cannot be stopped once it is being made. Cancelling before the work starts costs nothing. Cancelling after the start is charged like the finished video, unless making it failed.

Video Errors

Code When Charge
validation_failed A field is missing or wrong, such as a duration outside 3 to 15, or the URL is not public https None
operation_not_available_on_free The start used free credits None
not_found, file_expired, source_scan_pending, source_scan_failed The starting image file or artifact cannot be read None
unsupported_file_type The starting image is not a PNG, JPEG, WebP or HEIC image None
unsupported_file_content The starting image cannot be opened, or the model could not use the request None
source_too_large The starting image is larger than your plan's upload size None
source_quarantined The starting image did not pass the virus check None
target_fetch_blocked, target_timeout The image URL could not be downloaded None
content_refused The video model refused the request because of its content rules. Chab adds no filters of its own. Change the prompt or the image and try again None
provider_error The video model could not make this video None
provider_temporarily_rate_limited, provider_unavailable The video model is busy, cannot be reached right now, or the video was not ready after 20 minutes; try again later None