> For the complete documentation index, see [llms.txt](https://docs.fastrouter.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastrouter.ai/api-reference/video.md).

# Video

## Generate Video

> Generates videos from text prompts or images. Supports 18+ models from Google, OpenAI, Kling AI, Runway, Pollo, and others. Asynchronous generation — poll POST /api/v1/getAsyncResponse with taskId to retrieve results. The same request body (model, prompt, image, length, resolution) can also be sent to POST /api/v1/chat/completions when using a video model.\
> \
> \> \*\*Tip:\*\* Supported parameters and their accepted values differ from one model to another. Call \*\*GET /api/v1/models\*\* and inspect each model's \`supported\_parameters\` and \`supported\_params\_details\` to see exactly which fields it accepts and the allowed values, ranges, or enums.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Video","description":"Generate videos from text prompts or images using video generation models."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/api/v1/videos":{"post":{"operationId":"createVideo","tags":["Video"],"summary":"Generate Video","description":"Generates videos from text prompts or images. Supports 18+ models from Google, OpenAI, Kling AI, Runway, Pollo, and others. Asynchronous generation — poll POST /api/v1/getAsyncResponse with taskId to retrieve results. The same request body (model, prompt, image, length, resolution) can also be sent to POST /api/v1/chat/completions when using a video model.\n\n> **Tip:** Supported parameters and their accepted values differ from one model to another. Call **GET /api/v1/models** and inspect each model's `supported_parameters` and `supported_params_details` to see exactly which fields it accepts and the allowed values, ranges, or enums.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Video generation model in provider/model format. The supported model list changes over time — call GET /api/v1/models for the authoritative, up-to-date set.","enum":["google/veo2","google/veo3","google/veo3-fast","google/veo3.1","google/veo3.1-fast","google/veo3.1-lite","openai/sora-2","openai/sora-2-pro","kling-ai/kling-v1-6","kling-ai/kling-v2","kling-ai/kling-v2-1","kling-ai/kling-v2-1-master","kling-ai/kling-v3","kling-ai/kling-video-o1","runway/runway-gen-3-turbo","runway/runway-gen-4-turbo","pika/pika-v2-2","bytedance/seedance","bytedance/seedance-pro","bytedance/seedance-1.5-pro","bytedance/seedance-2","bytedance/seedance-2-fast","bytedance/seedance-2-mini","pollo/pollo-v1-6","vidu/vidu-v2-0","vidu/vidu-q1","wanx/wan-v2-6","x-ai/grok-imagine-video"]},"prompt":{"type":"string","description":"Natural language description of the video scene to generate"},"image":{"type":"string","format":"uri","description":"URL of an input image for image-to-video generation. Only URLs supported (no base64). Formats: JPG, PNG, JPEG. Aspect ratio must be 1:4 to 4:1. Required for some models."},"length":{"type":"integer","enum":[4,5,6,8,10,12],"description":"Duration of the video in seconds. Supported values vary by model: 4, 5, 6, 8, 10, or 12."},"seconds":{"type":"string","enum":["4","8","12"],"description":"Duration in seconds (used by Sora models). Supported: 4, 8, or 12."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"description":"Output video resolution"},"aspectRatio":{"type":"string","enum":["16:9","9:16","4:3","3:4","1:1","5:3","3:5"],"description":"Width-to-height ratio of the video frame"},"size":{"type":"string","enum":["720x1280","1280x720","1024x1792","1792x1024"],"description":"Video dimensions (used by Sora models)"},"mode":{"type":"string","enum":["std","pro"],"description":"Generation style/mode (if supported by model)"},"seed":{"type":"integer","description":"Random seed for deterministic output (optional; useful for reproducibility)"},"generateAudio":{"type":"boolean","description":"Generate audio track for the video (supported by some models)"}}}}}},"responses":{"200":{"description":"Video generation task queued successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Response format for most models (Veo, Kling, etc.)","properties":{"chat_id":{"type":"string"},"model":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"data":{"type":"object","properties":{"taskId":{"type":"string","description":"Use this to poll for completion"},"status":{"type":"string","enum":["waiting","queued","processing"]}}},"usage":{"type":"object","properties":{"user_key_credits_used":{"type":"number"},"credits_used":{"type":"number"},"provider":{"type":"string"}}}}},{"type":"object","description":"Response format for Sora models","properties":{"id":{"type":"string","description":"Video ID - use this to poll for completion"},"chat_id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"integer"},"status":{"type":"string","enum":["queued","in_progress","completed"]},"model":{"type":"string"},"seconds":{"type":"string"},"size":{"type":"string"},"usage":{"type":"object"}}}]}}}},"400":{"description":"Bad Request - Invalid parameters or model"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"description":"Internal Server Error"}}}}}}
```

#### **Note:** FastRouter supports both GET (recommended) and POST endpoints for retrieving generated videos.

## Get Video Status

> Retrieves the status and result of an asynchronous video generation by its \`task\_id\` (returned from POST /api/v1/videos).\
> \
> Poll this endpoint until generation completes. Response shape varies by provider:\
> \- \*\*Pollo\*\* — per-generation fields (\`id\`, \`createdDate\`, \`updatedDate\`, \`status\`, \`url\`, \`mediaType\`).\
> \- \*\*Kling\*\* — top-level \`data.status\` is \`completed\`; each generation has \`duration\` and \`url\`.\
> \- \*\*Veo (Google)\*\* — top-level \`data.status\` is \`completed\`; each generation has \`bytesBase64Encoded\` (base64 video). Use \`fastrouter\_assets.urls\` for the hosted download URL.\
> \
> When complete, download from \`generations\[].url\` or \`fastrouter\_assets.urls\`.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Video","description":"Generate videos from text prompts or images using video generation models."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/api/v1/videos/{task_id}":{"get":{"operationId":"getVideoStatus","tags":["Video"],"summary":"Get Video Status","description":"Retrieves the status and result of an asynchronous video generation by its `task_id` (returned from POST /api/v1/videos).\n\nPoll this endpoint until generation completes. Response shape varies by provider:\n- **Pollo** — per-generation fields (`id`, `createdDate`, `updatedDate`, `status`, `url`, `mediaType`).\n- **Kling** — top-level `data.status` is `completed`; each generation has `duration` and `url`.\n- **Veo (Google)** — top-level `data.status` is `completed`; each generation has `bytesBase64Encoded` (base64 video). Use `fastrouter_assets.urls` for the hosted download URL.\n\nWhen complete, download from `generations[].url` or `fastrouter_assets.urls`.","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string"},"description":"The task ID returned from POST /api/v1/videos."}],"responses":{"200":{"description":"Video generation status / result","content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","description":"FastRouter transaction ID for this generation."},"code":{"type":"string","description":"Response code."},"message":{"type":"string"},"data":{"type":"object","properties":{"taskId":{"type":"string","description":"The task ID for this video generation."},"status":{"type":"string","enum":["waiting","processing","succeed","completed","failed"],"description":"Overall generation status (present on Kling/Veo-style responses)."},"generations":{"type":"array","description":"Generation results. Field shape depends on the video provider.","items":{"type":"object","properties":{"id":{"type":"string","description":"Provider-side generation ID (Pollo)."},"createdDate":{"type":"string","description":"ISO timestamp when generation started (Pollo)."},"updatedDate":{"type":"string","description":"ISO timestamp when generation last updated (Pollo)."},"status":{"type":"string","enum":["waiting","processing","succeed","failed"],"description":"Per-generation status (Pollo)."},"failMsg":{"type":"string","description":"Failure message (Pollo; empty when successful)."},"url":{"type":"string","format":"uri","description":"Downloadable video URL (Pollo, Kling)."},"mediaType":{"type":"string","description":"Media type (Pollo)."},"duration":{"type":"integer","description":"Video duration in seconds (Kling)."},"bytesBase64Encoded":{"type":"string","description":"Base64-encoded video bytes (Veo/Google). May be empty when the video is served via `fastrouter_assets.urls` instead."}}}}}},"fastrouter_assets":{"type":"object","description":"FastRouter-hosted copies of the generated assets.","properties":{"status":{"type":"string","description":"Asset availability status."},"urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"FastRouter-hosted asset URLs."},"expires_at":{"type":"integer","description":"Unix timestamp when the hosted assets expire."},"cached_at":{"type":"integer","description":"Unix timestamp when the assets were cached."}}},"usage":{"type":"object","description":"Credit usage for the generation.","properties":{"user_key_credits_used":{"type":"number"},"api_key_credits_used":{"type":"number"},"credits_used":{"type":"number"},"provider":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Task not found or expired"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"description":"Internal Server Error"}}}}}}
```

## Get Async Response

> Polls for asynchronous video generation results. Poll with the \`taskId\` returned from POST /api/v1/videos until status is \`succeed\` or \`completed\`, then download from the provided URL.\
> \
> \*\*taskId and model rules:\*\*\
> \- If \`taskId\` includes a provider prefix (e.g. \`pol\_\` for Pollo), then \*\*model is optional\*\*.\
> \- If \`taskId\` has no provider prefix, then \*\*model is required\*\* and must match the model used in the original /videos request.\
> \
> \*\*Response shape varies by provider:\*\*\
> \- \*\*Pollo\*\* — per-generation \`id\`, \`createdDate\`, \`status\`, \`url\`, etc.\
> \- \*\*Kling\*\* — \`data.status: completed\`; generations have \`duration\` and \`url\`.\
> \- \*\*Veo (Google)\*\* — \`data.status: completed\`; generations have \`bytesBase64Encoded\`. Use \`fastrouter\_assets.urls\` for download.\
> \- \*\*Sora\*\* — OpenAI-style response with \`progress\`, \`status\`, etc.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Video","description":"Generate videos from text prompts or images using video generation models."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/api/v1/getAsyncResponse":{"post":{"operationId":"getAsyncResponse","tags":["Video"],"summary":"Get Async Response","description":"Polls for asynchronous video generation results. Poll with the `taskId` returned from POST /api/v1/videos until status is `succeed` or `completed`, then download from the provided URL.\n\n**taskId and model rules:**\n- If `taskId` includes a provider prefix (e.g. `pol_` for Pollo), then **model is optional**.\n- If `taskId` has no provider prefix, then **model is required** and must match the model used in the original /videos request.\n\n**Response shape varies by provider:**\n- **Pollo** — per-generation `id`, `createdDate`, `status`, `url`, etc.\n- **Kling** — `data.status: completed`; generations have `duration` and `url`.\n- **Veo (Google)** — `data.status: completed`; generations have `bytesBase64Encoded`. Use `fastrouter_assets.urls` for download.\n- **Sora** — OpenAI-style response with `progress`, `status`, etc.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["taskId"],"properties":{"taskId":{"type":"string","description":"The taskId returned from POST /api/v1/videos. When it includes a provider prefix (e.g. pol_ for Pollo), model can be omitted."},"model":{"type":"string","description":"The video model used in the original /videos request. Required when taskId has no provider prefix; optional when taskId has a provider prefix (e.g. pol_)."}}}}}},"responses":{"200":{"description":"Video generation status or completed video","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Pollo / Kling / Veo response (most video models)","properties":{"chat_id":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"data":{"type":"object","properties":{"taskId":{"type":"string"},"status":{"type":"string","enum":["waiting","processing","succeed","completed","failed"],"description":"Overall status (Kling/Veo). Pollo uses per-generation status instead."},"generations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Pollo"},"createdDate":{"type":"string","description":"Pollo"},"updatedDate":{"type":"string","description":"Pollo"},"status":{"type":"string","enum":["waiting","processing","succeed","failed"],"description":"Pollo"},"failMsg":{"type":"string","description":"Pollo"},"url":{"type":"string","format":"uri","description":"Pollo, Kling"},"mediaType":{"type":"string","description":"Pollo"},"duration":{"type":"integer","description":"Kling — duration in seconds"},"bytesBase64Encoded":{"type":"string","description":"Veo — base64 video bytes"}}}}}},"fastrouter_assets":{"type":"object","properties":{"status":{"type":"string"},"urls":{"type":"array","items":{"type":"string","format":"uri"}},"expires_at":{"type":"integer"},"cached_at":{"type":"integer"}}},"usage":{"type":"object"}}},{"type":"object","description":"Sora model response","properties":{"id":{"type":"string"},"chat_id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"integer"},"status":{"type":"string","enum":["queued","in_progress","completed","failed"]},"progress":{"type":"integer","description":"Completion percentage (0-100)"},"completed_at":{"type":"integer"},"model":{"type":"string"},"seconds":{"type":"string"},"size":{"type":"string"},"usage":{"type":"object"}}}]}}}},"400":{"description":"Bad Request - Invalid taskId or model"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Not Found - Invalid taskId or expired result"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"description":"Internal Server Error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fastrouter.ai/api-reference/video.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
