Resources / Developers

API reference: /v1/videos/generations

Make a video from a text prompt and optional reference images. Create, then poll or receive a webhook. Same key as text, needs the llm scope.

DeveloperswithConflux Team · Dec 1, 2026 · 6 min read

Make a video from a text prompt and optional reference images. Creating is asynchronous: you get an id at once, then poll or receive a webhook. Base URL https://withconflux.com/api/v1, same key as text, needs the llm scope.

In short

  • Billing: the cost of the full duration is reserved on create and charged only on succeeded.
  • Output: MP4 with sound, 1080p, no watermark, no text added by withConflux.
  • Files: our link works for 30 days, see available_until.
  • Test keys: return a sample clip with "test": true. Never charged.

Create a video

POST /v1/videos/generations

FieldTypeWhat it does
model (required)stringA video model id from GET /v1/models?type=video.
prompt (required)stringWhat to show and hear. Up to 2,000 characters.
durationintegerSeconds. One of the model's durations, for example 5 or 10. Default 5.
aspect_ratiostring9:16, 4:5, 1:1 or 16:9 (the model's aspect_ratios). Default: your account default in Settings.
resolutionstringFor example 720p or 1080p. Sets the price per second. Default 1080p.
audiobooleanAdd sound. Default true when the model has sound.
reference_imagesstring[]Up to the model's reference_images HTTPS image URLs. Turns the request into image-to-video.
consentbooleanMust be true when you send reference images: it confirms permission from any real person shown. Stored with the video.
idempotency_keystringUp to 64 characters. The same key within 24 hours returns the same video: never a second video, never a second charge.
client_reference_idstringUp to 128 characters. Your own id; we send it back on every answer and webhook.

Request

curl https://withconflux.com/api/v1/videos/generations \
  -H "Authorization: Bearer $CONFLUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "VIDEO_MODEL_ID",
    "prompt": "Coffee shop promo: barista pours latte art in morning light, steam rising, soft acoustic music",
    "duration": 10,
    "aspect_ratio": "9:16",
    "resolution": "1080p",
    "audio": true,
    "idempotency_key": "ad-4822-scene-1",
    "client_reference_id": "scene-4822-1"
  }'

Response 202

{
  "id": "vgen_7Rs9Bc2Mx1",
  "object": "video.generation",
  "status": "queued",
  "queue_position": 0,
  "reserved_eur": 1.00,
  "price_eur_per_second": 0.10,
  "client_reference_id": "scene-4822-1",
  "created_at": "2026-12-01T13:58:02Z"
}

Get a video

GET /v1/videos/generations/{id}. Poll every 5 seconds or more.

FieldWhat it is
statusSee Statuses.
progress0 to 1 while running.
queue_positionWhile queued. 0 means next.
videourl (MP4), thumbnail_url (still frame), duration, aspect_ratio, resolution, audio, has_audio. Only when succeeded.
cost_eur, seconds_billed, price_eur_per_secondWhat was charged. 0 unless succeeded.
reserved_eurAmount reserved while queued or running.
available_untilDate the file is deleted, 30 days after it is ready. After that file_status is expired and video is null.
failure_reasoncontent_refused, timed_out, no_audio, provider_key_missing or generation_failed. Null otherwise.
error / refusalCode and plain message when failed or refused.
testtrue for test keys.

Response 200

{
  "id": "vgen_7Rs9Bc2Mx1",
  "object": "video.generation",
  "status": "succeeded",
  "model": "VIDEO_MODEL_ID",
  "progress": 1,
  "reserved_eur": 0,
  "cost_eur": 1.00,
  "price_eur_per_second": 0.10,
  "seconds_billed": 10,
  "video": {
    "url": "https://withconflux.com/api/v1/videos/files/Qm9...x.mp4",
    "thumbnail_url": "https://withconflux.com/api/v1/videos/files/Qm9...x.jpg",
    "format": "mp4",
    "duration": 10,
    "aspect_ratio": "9:16",
    "resolution": "1080p",
    "audio": true,
    "has_audio": true
  },
  "file_status": "available",
  "available_until": "2026-12-31T13:59:12Z",
  "failure_reason": null,
  "client_reference_id": "scene-4822-1",
  "created_at": "2026-12-01T13:58:02Z",
  "finished_at": "2026-12-01T13:59:12Z"
}

Statuses

StatusMeaningMoney
queuedAccepted, waiting for a free slot.Reserved
runningBeing made.Reserved
succeededReady. video.url works until available_until.Charged
failedCould not be made: timed_out, no_audio (sound was asked for, the file came back without it) or generation_failed.Not charged
refusedBreaks the content rules (content_refused). Rewrite the prompt.Not charged

Webhooks

Set one URL per account in the dashboard under Webhooks. Events: video.succeeded, video.failed, video.refused. Each POST has a Conflux-Signature: t=...,v1=... header: an HMAC SHA-256 of t + "." + body with your secret. Answer 2xx within 10 seconds. Failed deliveries are retried 6 times over 24 hours.

import crypto from "node:crypto";

// Conflux-Signature: t=1796047212,v1=5f2b...  (during a secret rotation there can be two v1 values)
export function verify(rawBody: string, header: string, secret: string): boolean {
  const parts = header.split(",").map((p) => p.trim().split("="));
  const t = Number(parts.find(([k]) => k === "t")?.[1]);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
  return parts.filter(([k]) => k === "v1").some(([, v]) => {
    const got = Buffer.from(v ?? "");
    return got.length === expected.length && crypto.timingSafeEqual(got, expected);
  });
}

Errors

Errors use the same shape as the rest of the gateway: { "error": { "message", "type", "code" } }. Nothing is reserved or charged when a request returns an error.

HTTPCodeWhen
400invalid_parameterA value the model does not accept. param names the field.
401invalid_api_keyThe key is missing, wrong or revoked.
402insufficient_creditsYour balance does not cover the full duration. Includes cost_eur, balance_eur and top_up_url.
402video_spend_cap_reachedYour monthly video limit would be passed. Includes cap_eur and spent_eur.
403scope_not_allowedThe key does not have the llm scope.
403model_not_availableThe model exists but is not open to this key, for example coming soon.
403video_not_enabledVideo generation is not turned on for your account yet.
404model_not_found / generation_not_foundNo model or generation with that id.
409idempotency_conflictSame idempotency_key with a different request.
422consent_requiredReference images sent without consent: true.
422content_refusedThe prompt breaks the content rules. Rewrite it.
429rate_limitedToo many requests a minute for this key. Wait Retry-After seconds (also retry_after_seconds in the body).

Limits

Each key has a number of video requests a minute and each account a number of videos made at once (5 unless agreed otherwise). Extra requests are accepted and wait as queued; they never fail because of the at-once limit. Every response carries x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests, x-ratelimit-limit-concurrent and x-ratelimit-remaining-concurrent. GET /v1/videos/limits returns the same numbers.

List video models

GET /v1/models?type=video. Text models are unchanged.

{
  "object": "list",
  "data": [
    {
      "id": "VIDEO_MODEL_ID",
      "type": "video",
      "status": "available",
      "price_eur_per_second": { "720p": 0.06, "1080p": 0.10 },
      "upcoming_price": null,
      "max_duration_seconds": 10,
      "durations": [5, 10],
      "aspect_ratios": ["9:16", "4:5", "1:1", "16:9"],
      "resolutions": ["720p", "1080p"],
      "audio": true,
      "reference_image": true,
      "reference_images": 3,
      "voice_languages": ["en"]
    }
  ],
  "video_limits": { "requests_per_minute": 20, "concurrent_generations": 5 }
}

status is available (live keys), internal (test keys only, sample clip) or coming_soon (listed, no price, not callable). When a price change is scheduled, upcoming_price holds { "price_eur_per_second": {...}, "effective_from": "..." }; until that date the current price applies.

Test mode

A test key (cflx_test_...) runs every check, including consent and content rules, but never makes a real video. A succeeded test returns a short sample clip for the aspect ratio you asked for, with "test": true and cost_eur: 0. Webhooks fire as usual.

Files and retention

Videos are stored by withConflux for 30 days after they are ready, then deleted. After that, GET still returns the generation, with video set to null and file_status: "expired". Copy files to your own storage before available_until.


Checking whether a video is AI-made is a separate API: AI detection.

Ready to try it?
One key, one bill, every content-AI vendor.
See the video generation API
Keep reading
We use a single analytics cookie to understand traffic to this site. Nothing loads until you choose. See our Privacy Policy.