Skip to main content

Submit a Video Generation Request

POST 

https://api.knox.chat/v1/videos

Submit an asynchronous video generation job. Video generation is not a streaming chat completion — the API accepts the request immediately (202 Accepted) and returns a job ID. Poll GET /v1/videos/{jobId} until status is completed, then download bytes from GET /v1/videos/{jobId}/content.

Use GET /v1/videos/models to discover available models and the resolutions, aspect ratios, durations, and frame-image types each one supports.

Request

This endpoint requires a JSON object.

Request Headers

NameTypeRequiredDescription
AuthorizationStringYesBearer authentication in the form Bearer <token>, where token is your Knox Chat API key.
Content-TypeStringYesMust be application/json.

Request Body

NameTypeRequiredDescription
modelStringYesVideo model ID from GET /v1/videos/models, for example google/veo-3.1.
promptStringConditionalText description of the video. Required unless image input is provided via frame_images or input_references.
aspect_ratioStringNoOutput aspect ratio. Accepted values: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21. Must also be listed in the model's supported_aspect_ratios.
durationIntegerNoClip length in seconds. Must be at least 1, and must be listed in the model's supported_durations when that list is present.
resolutionStringNoOutput resolution. Accepted values: 480p, 720p, 768p, 1080p, 1K, 2K, 4K. Must also be listed in the model's supported_resolutions.
sizeStringNoExact pixel size in WIDTHxHEIGHT form, for example 1280x720. Use this instead of resolution when the model exposes supported_sizes.
generate_audioBooleanNoWhen true, generate a soundtrack with the video. Only valid when the model reports generate_audio: true.
seedIntegerNoDeterministic seed. Rejected when the model reports seed: false.
callback_urlStringNoHTTPS webhook invoked when the job reaches a terminal status. HTTP URLs are rejected.
frame_imagesList of ObjectsNoStart/end frame images for image-to-video. Each object must include frame_type (first_frame or last_frame) and an image payload. The frame_type must be listed in the model's supported_frame_images.
input_referencesList of ObjectsNoExtra media references. Use { "type": "image_url", "image_url": { "url": "..." } } for image-to-video, or { "type": "video_url", "video_url": { "url": "..." } } for reference-to-video.

prompt may be omitted only when at least one image is supplied through frame_images or an input_references item with type: "image_url".

cURL Example

Text to video

curl -X POST https://api.knox.chat/v1/videos \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/veo-3.1",
"prompt": "A serene mountain landscape at sunset, cinematic camera drift",
"aspect_ratio": "16:9",
"duration": 8,
"resolution": "720p",
"generate_audio": true
}'

Image to video

curl -X POST https://api.knox.chat/v1/videos \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/veo-3.1",
"prompt": "Animate this still into a slow cinematic push-in",
"aspect_ratio": "16:9",
"duration": 8,
"resolution": "720p",
"frame_images": [
{
"frame_type": "first_frame",
"image_url": {
"url": "https://example.com/first-frame.png"
}
}
]
}'

Reference video

curl -X POST https://api.knox.chat/v1/videos \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/veo-3.1",
"prompt": "Keep the same camera motion and character, but change the scene to night",
"input_references": [
{
"type": "video_url",
"video_url": {
"url": "https://example.com/reference.mp4"
}
}
]
}'

Response

Success Response (202 Accepted)

{
"generation_id": "gen-8f2c1a9b4d6e7f01",
"id": "job-3c91a0e8b7d24f11",
"polling_url": "/v1/videos/job-3c91a0e8b7d24f11",
"status": "pending"
}

Store id and poll polling_url (relative to https://api.knox.chat) until the job finishes. Do not treat 202 as a finished video — unsigned_urls and usage appear only after the job completes.

Response Schema

NameTypeDescription
generation_idstringUnique generation identifier (gen-...). Present once the job is accepted.
idstringJob ID (job-...). Use this path parameter for poll and download requests.
polling_urlstringRelative URL for status polling, for example /v1/videos/job-3c91a0e8b7d24f11.
statusstringCurrent job status. See Job statuses.
errorstringError message when status is failed. Omitted otherwise.
unsigned_urlsarray of stringsDownloadable video URLs once the job is completed. Hosted by Knox Chat (never upstream provider URLs).
usageobjectBilling information once the job is completed.
usage.costnumberCost of the generation in USD.

Job statuses

StatusMeaning
pendingThe job has been accepted and is waiting to start.
in_progressThe model is generating the video.
completedThe video is ready. Download it or use unsigned_urls.
failedGeneration failed. Inspect error. Credits are not charged for failed jobs.
cancelledThe job was cancelled.
expiredThe job expired before completion.

Error Responses

Video endpoints return errors in this shape:

{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}
StatusMessageWhen
400Invalid request parametersMissing model, invalid JSON, or a field the model does not support.
400Prompt is required unless image input is providedNo prompt and no image input.
400Unsupported aspect_ratio / resolution / sizeValue is not in the global allow-list.
400aspect_ratio … is not supported by {model}Value is valid globally but not for this model.
400callback_url must be HTTPSWebhook URL is not HTTPS.
401Missing Authentication headerMissing or invalid API key.
402Insufficient credits. Add more using https://knox.chat/creditsAccount balance is too low for the estimated cost.
403This token is not authorized to use model: {model}The API key's model allow-list does not include this video model.
404Resource not foundUnknown or disabled model ID.
429Rate limit exceededToo many requests.
500Internal Server ErrorUnexpected server error.