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
| Field | Type | What it does |
|---|---|---|
model (required) | string | A video model id from GET /v1/models?type=video. |
prompt (required) | string | What to show and hear. Up to 2,000 characters. |
duration | integer | Seconds. One of the model's durations, for example 5 or 10. Default 5. |
aspect_ratio | string | 9:16, 4:5, 1:1 or 16:9 (the model's aspect_ratios). Default: your account default in Settings. |
resolution | string | For example 720p or 1080p. Sets the price per second. Default 1080p. |
audio | boolean | Add sound. Default true when the model has sound. |
reference_images | string[] | Up to the model's reference_images HTTPS image URLs. Turns the request into image-to-video. |
consent | boolean | Must be true when you send reference images: it confirms permission from any real person shown. Stored with the video. |
idempotency_key | string | Up to 64 characters. The same key within 24 hours returns the same video: never a second video, never a second charge. |
client_reference_id | string | Up 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.
| Field | What it is |
|---|---|
status | See Statuses. |
progress | 0 to 1 while running. |
queue_position | While queued. 0 means next. |
video | url (MP4), thumbnail_url (still frame), duration, aspect_ratio, resolution, audio, has_audio. Only when succeeded. |
cost_eur, seconds_billed, price_eur_per_second | What was charged. 0 unless succeeded. |
reserved_eur | Amount reserved while queued or running. |
available_until | Date the file is deleted, 30 days after it is ready. After that file_status is expired and video is null. |
failure_reason | content_refused, timed_out, no_audio, provider_key_missing or generation_failed. Null otherwise. |
error / refusal | Code and plain message when failed or refused. |
test | true 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
| Status | Meaning | Money |
|---|---|---|
queued | Accepted, waiting for a free slot. | Reserved |
running | Being made. | Reserved |
succeeded | Ready. video.url works until available_until. | Charged |
failed | Could not be made: timed_out, no_audio (sound was asked for, the file came back without it) or generation_failed. | Not charged |
refused | Breaks 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.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_parameter | A value the model does not accept. param names the field. |
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | insufficient_credits | Your balance does not cover the full duration. Includes cost_eur, balance_eur and top_up_url. |
| 402 | video_spend_cap_reached | Your monthly video limit would be passed. Includes cap_eur and spent_eur. |
| 403 | scope_not_allowed | The key does not have the llm scope. |
| 403 | model_not_available | The model exists but is not open to this key, for example coming soon. |
| 403 | video_not_enabled | Video generation is not turned on for your account yet. |
| 404 | model_not_found / generation_not_found | No model or generation with that id. |
| 409 | idempotency_conflict | Same idempotency_key with a different request. |
| 422 | consent_required | Reference images sent without consent: true. |
| 422 | content_refused | The prompt breaks the content rules. Rewrite it. |
| 429 | rate_limited | Too 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.