### Input Reference Schema Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Example structure for providing a reference asset to guide video generation. ```yaml image_url: url: https://example.com/image.png type: image_url ``` -------------------------------- ### Provider Options Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Example configuration for provider-specific passthrough options. ```json { "google-vertex": { "output_config": { "effort": "low" } } } ``` -------------------------------- ### Provider Options Schema Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Example structure for passing provider-specific configuration options. ```yaml openai: max_tokens: 1000 ``` -------------------------------- ### Content Part Schema Examples Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Examples of content part structures for different media types. ```yaml image_url: url: https://example.com/image.png type: image_url ``` ```yaml audio_url: url: https://example.com/audio.mp3 type: audio_url ``` ```yaml type: video_url video_url: url: https://example.com/clip.mp4 ``` -------------------------------- ### OpenAPI specification for listing video models Source: https://openrouter.ai/docs/api/api-reference/video-generation/list-all-video-generation-models Defines the GET /videos/models endpoint, including request parameters, response schemas, and example payloads for successful and error responses. ```yaml openapi: 3.1.0 info: contact: email: support@openrouter.ai name: OpenRouter Support url: https://openrouter.ai/docs description: OpenAI-compatible API with additional OpenRouter features license: name: MIT url: https://opensource.org/licenses/MIT title: OpenRouter API version: 1.0.0 servers: - description: Production server url: https://openrouter.ai/api/v1 x-speakeasy-server-id: production security: - apiKey: [] tags: - description: API key management endpoints name: API Keys - description: Analytics and usage endpoints name: Analytics - description: Anthropic Messages endpoints name: Anthropic Messages - description: BYOK endpoints name: BYOK - description: Benchmarks endpoints name: Benchmarks - description: Chat completion endpoints name: Chat - description: Task classification market-share endpoints name: Classifications - description: Containers endpoints name: Containers - description: Credit management endpoints name: Credits - description: >- Public OpenRouter usage datasets. Data returned by these endpoints is licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/): reuse and republish it, including commercially, with attribution to OpenRouter. name: Datasets - description: Text embedding endpoints name: Embeddings - description: Endpoint information name: Endpoints - description: Files endpoints name: Files - description: Generation history endpoints name: Generations - description: Guardrails endpoints name: Guardrails - description: Images endpoints name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints name: OAuth - description: Observability endpoints name: Observability - description: Organization endpoints name: Organization - description: Presets endpoints name: Presets - description: Provider information endpoints name: Providers - description: Rerank endpoints name: Rerank - description: OpenAI-compatible Responses API endpoints name: Responses - description: SCIM endpoints name: SCIM - description: Speech-to-text endpoints name: STT x-displayName: Transcriptions - description: Text-to-speech endpoints name: TTS x-displayName: Speech - description: Video Generation endpoints name: Video Generation - description: Workspaces endpoints name: Workspaces externalDocs: description: OpenRouter Documentation url: https://openrouter.ai/docs paths: /videos/models: get: tags: - Video Generation summary: List all video generation models description: >- Returns a list of all available video generation models and their properties operationId: listVideosModels responses: '200': content: application/json: example: data: - allowed_passthrough_parameters: [] canonical_slug: google/veo-3.1 created: 1700000000 description: Google video generation model generate_audio: true id: google/veo-3.1 name: Veo 3.1 pricing_skus: generate: '0.50' seed: null supported_aspect_ratios: - '16:9' supported_durations: - 5 - 8 supported_frame_images: - first_frame - last_frame supported_resolutions: - 720p supported_sizes: null schema: $ref: '#/components/schemas/VideoModelsListResponse' description: Returns a list of video generation models '400': content: application/json: example: error: code: 400 message: Invalid request parameters schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input '500': content: application/json: example: error: code: 500 message: Internal Server Error schema: $ref: '#/components/schemas/InternalServerResponse' ``` -------------------------------- ### Frame Image Schema Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Example structure for defining a frame image in a video generation request. ```yaml frame_type: first_frame image_url: url: https://example.com/image.png type: image_url ``` -------------------------------- ### Internal Server Error Schema Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Example structure for an internal server error response. ```yaml error: code: 500 message: Internal Server Error ``` -------------------------------- ### Bad Gateway Error Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Example JSON structure for a 502 Bad Gateway response. ```yaml example: error: code: 502 message: Provider returned error ``` -------------------------------- ### GET /videos/models Source: https://openrouter.ai/docs/api/api-reference/video-generation/list-all-video-generation-models Retrieves a list of all available video generation models and their properties. ```APIDOC ## GET /videos/models ### Description Returns a list of all available video generation models and their properties. ### Method GET ### Endpoint /videos/models ### Response #### Success Response (200) - **data** (array) - A list of video generation models. #### Response Example { "data": [ { "allowed_passthrough_parameters": [], "canonical_slug": "google/veo-3.1", "created": 1700000000, "description": "Google video generation model", "generate_audio": true, "id": "google/veo-3.1", "name": "Veo 3.1", "pricing_skus": { "generate": "0.50" }, "seed": null, "supported_aspect_ratios": ["16:9"], "supported_durations": [5, 8], "supported_frame_images": ["first_frame", "last_frame"], "supported_resolutions": ["720p"], "supported_sizes": null } ] } ``` -------------------------------- ### Video Generation Request Schema Example Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request A sample JSON object representing a valid video generation request. ```json { "aspect_ratio": "16:9", "duration": 8, "model": "google/veo-3.1", "prompt": "A serene mountain landscape at sunset", "resolution": "720p" } ``` -------------------------------- ### Error Response Schema Examples Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Examples of error data structures for various HTTP status codes. ```yaml code: 404 message: Resource not found ``` ```yaml code: 413 message: Request payload too large ``` ```yaml code: 429 message: Rate limit exceeded ``` ```yaml code: 500 message: Internal Server Error ``` -------------------------------- ### Retrieve user activity by endpoint Source: https://openrouter.ai/docs/api/api-reference Examples for fetching activity data using various programming languages. Requires a valid Authorization header with a Bearer token. ```bash curl --request GET \ --url https://openrouter.ai/api/v1/activity \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://openrouter.ai/api/v1/activity" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://openrouter.ai/api/v1/activity', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://openrouter.ai/api/v1/activity", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://openrouter.ai/api/v1/activity" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://openrouter.ai/api/v1/activity") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://openrouter.ai/api/v1/activity") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### GET /api/v1/videos/{id} Source: https://openrouter.ai/docs/api/api-reference/video-generation/poll-video-generation-status Retrieves the current status and details of a video generation job. ```APIDOC ## GET /api/v1/videos/{id} ### Description Retrieves the status and details of a video generation job using its unique identifier. ### Method GET ### Endpoint /api/v1/videos/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the video generation job. ### Response #### Success Response (200) - **id** (string) - The job ID. - **polling_url** (string) - The URL used to poll for status updates. - **status** (string) - The current status of the job (pending, in_progress, completed, failed, cancelled, expired). - **generation_id** (string) - The generation ID associated with the job (available once processed). - **unsigned_urls** (array) - List of unsigned URLs for the generated content. - **usage** (object) - Usage and cost information (available once completed). #### Response Example { "id": "job-abc123", "polling_url": "/api/v1/videos/job-abc123", "status": "pending", "generation_id": "gen-xyz789" } ``` -------------------------------- ### GET /videos/{jobId} Source: https://openrouter.ai/docs/api/api-reference/video-generation/poll-video-generation-status Retrieves the status and results of a video generation job. ```APIDOC ## GET /videos/{jobId} ### Description Returns job status and content URLs when completed. ### Method GET ### Endpoint /videos/{jobId} ### Parameters #### Path Parameters - **jobId** (string) - Required - The unique identifier of the video generation job. ### Response #### Success Response (200) - **generation_id** (string) - The ID of the generation. - **id** (string) - The job ID. - **polling_url** (string) - The URL to poll for status updates. - **status** (string) - The current status of the job (e.g., completed). - **unsigned_urls** (array) - A list of URLs to the generated video content. - **usage** (object) - Usage details including cost. #### Response Example { "generation_id": "gen-xyz789", "id": "job-abc123", "polling_url": "/api/v1/videos/job-abc123", "status": "completed", "unsigned_urls": [ "https://storage.example.com/video.mp4" ], "usage": { "cost": 0.5 } } ``` -------------------------------- ### GET /activity Source: https://openrouter.ai/docs/api/api-reference Retrieves user activity data grouped by endpoint for the last 30 days. Requires a management API key. ```APIDOC ## GET /activity ### Description Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Management key is required for access. ### Method GET ### Endpoint https://openrouter.ai/api/v1/activity ### Parameters #### Query Parameters - **workspace_id** (string) - Optional - Filter by workspace ID (UUID). - **group_by** (enum) - Optional - Set to 'workspace' to split each row per workspace. - **date** (string) - Optional - Filter by a single UTC date (YYYY-MM-DD). - **api_key_hash** (string) - Optional - Filter by API key hash (SHA-256). - **user_id** (string) - Optional - Filter by org member user ID. ### Response #### Success Response (200) - **data** (object[]) - List of activity items including usage, tokens, and model information. #### Response Example { "data": [ { "byok_usage_inference": 0.012, "completion_tokens": 125, "date": "2025-08-24", "endpoint_id": "550e8400-e29b-41d4-a716-446655440000", "model": "openai/gpt-4.1", "model_permaslug": "openai/gpt-4.1-2025-04-14", "prompt_tokens": 50, "provider_name": "OpenAI", "reasoning_tokens": 25, "requests": 5, "usage": 0.015 } ] } ``` -------------------------------- ### GET /videos/{jobId}/content Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Streams the generated video content from the upstream provider. ```APIDOC ## GET /videos/{jobId}/content ### Description Streams the generated video content from the upstream provider. ### Method GET ### Endpoint /videos/{jobId}/content ### Parameters #### Path Parameters - **jobId** (string) - Required - The unique identifier for the video generation job. #### Query Parameters - **index** (integer) - Optional - The index of the video content to retrieve. Defaults to 0. ### Response #### Success Response (200) - **body** (binary) - Video content stream. The body is the raw video bytes proxied from the upstream provider, and the Content-Type reflects the provider media type (video/mp4). #### Response Example ``` -------------------------------- ### GET /api/v1/activity Source: https://openrouter.ai/docs/api/api-reference Retrieves user activity data grouped by endpoint. Requires an Authorization header with a Bearer token. ```APIDOC ## GET /api/v1/activity ### Description Fetches user activity data, providing insights into usage, token consumption, and model performance grouped by endpoint. ### Method GET ### Endpoint https://openrouter.ai/api/v1/activity ### Response #### Success Response (200) - **data** (array) - List of activity records containing usage metrics, model details, and token counts. #### Response Example { "data": [ { "byok_usage_inference": 0.012, "completion_tokens": 125, "date": "2025-08-24", "endpoint_id": "550e8400-e29b-41d4-a716-446655440000", "model": "openai/gpt-4.1", "model_permaslug": "openai/gpt-4.1-2025-04-14", "prompt_tokens": 50, "provider_name": "OpenAI", "reasoning_tokens": 25, "requests": 5, "usage": 0.015 } ] } ``` -------------------------------- ### OpenAPI specification for video content download Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Defines the GET request for streaming video content by jobId, including path parameters and response handling. ```yaml openapi: 3.1.0 info: contact: email: support@openrouter.ai name: OpenRouter Support url: https://openrouter.ai/docs description: OpenAI-compatible API with additional OpenRouter features license: name: MIT url: https://opensource.org/licenses/MIT title: OpenRouter API version: 1.0.0 servers: - description: Production server url: https://openrouter.ai/api/v1 x-speakeasy-server-id: production security: - apiKey: [] tags: - description: API key management endpoints name: API Keys - description: Analytics and usage endpoints name: Analytics - description: Anthropic Messages endpoints name: Anthropic Messages - description: BYOK endpoints name: BYOK - description: Benchmarks endpoints name: Benchmarks - description: Chat completion endpoints name: Chat - description: Task classification market-share endpoints name: Classifications - description: Containers endpoints name: Containers - description: Credit management endpoints name: Credits - description: >- Public OpenRouter usage datasets. Data returned by these endpoints is licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/): reuse and republish it, including commercially, with attribution to OpenRouter. name: Datasets - description: Text embedding endpoints name: Embeddings - description: Endpoint information name: Endpoints - description: Files endpoints name: Files - description: Generation history endpoints name: Generations - description: Guardrails endpoints name: Guardrails - description: Images endpoints name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints name: OAuth - description: Observability endpoints name: Observability - description: Organization endpoints name: Organization - description: Presets endpoints name: Presets - description: Provider information endpoints name: Providers - description: Rerank endpoints name: Rerank - description: OpenAI-compatible Responses API endpoints name: Responses - description: SCIM endpoints name: SCIM - description: Speech-to-text endpoints name: STT x-displayName: Transcriptions - description: Text-to-speech endpoints name: TTS x-displayName: Speech - description: Video Generation endpoints name: Video Generation - description: Workspaces endpoints name: Workspaces externalDocs: description: OpenRouter Documentation url: https://openrouter.ai/docs paths: /videos/{jobId}/content: get: tags: - Video Generation summary: Download generated video content description: Streams the generated video content from the upstream provider operationId: listVideosContent parameters: - in: path name: jobId required: true schema: example: job-abc123 minLength: 1 type: string - in: query name: index required: false schema: default: 0 example: 0 minimum: 0 type: - integer - 'null' responses: '200': content: video/mp4: example: schema: format: binary type: string description: >- Video content stream. The body is the raw video bytes proxied from the upstream provider, and the Content-Type reflects the provider media type (video/mp4). '400': content: application/json: example: error: code: 400 message: Invalid request parameters schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: example: error: code: 401 message: Missing Authentication header schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials '404': content: application/json: example: error: code: 404 message: Resource not found schema: ``` -------------------------------- ### API Error Response Examples Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Standard JSON error response structures for various HTTP status codes. ```json { "error": { "code": 404, "message": "Resource not found" } } ``` ```json { "error": { "code": 413, "message": "Request payload too large" } } ``` ```json { "error": { "code": 429, "message": "Rate limit exceeded" } } ``` ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` -------------------------------- ### OpenAPI Specification for Video Generation Status Source: https://openrouter.ai/docs/api/api-reference/video-generation/poll-video-generation-status Defines the GET /videos/{jobId} endpoint, including path parameters, response schemas, and error handling for video generation status polling. ```yaml openapi: 3.1.0 info: contact: email: support@openrouter.ai name: OpenRouter Support url: https://openrouter.ai/docs description: OpenAI-compatible API with additional OpenRouter features license: name: MIT url: https://opensource.org/licenses/MIT title: OpenRouter API version: 1.0.0 servers: - description: Production server url: https://openrouter.ai/api/v1 x-speakeasy-server-id: production security: - apiKey: [] tags: - description: API key management endpoints name: API Keys - description: Analytics and usage endpoints name: Analytics - description: Anthropic Messages endpoints name: Anthropic Messages - description: BYOK endpoints name: BYOK - description: Benchmarks endpoints name: Benchmarks - description: Chat completion endpoints name: Chat - description: Task classification market-share endpoints name: Classifications - description: Containers endpoints name: Containers - description: Credit management endpoints name: Credits - description: >- Public OpenRouter usage datasets. Data returned by these endpoints is licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/): reuse and republish it, including commercially, with attribution to OpenRouter. name: Datasets - description: Text embedding endpoints name: Embeddings - description: Endpoint information name: Endpoints - description: Files endpoints name: Files - description: Generation history endpoints name: Generations - description: Guardrails endpoints name: Guardrails - description: Images endpoints name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints name: OAuth - description: Observability endpoints name: Observability - description: Organization endpoints name: Organization - description: Presets endpoints name: Presets - description: Provider information endpoints name: Providers - description: Rerank endpoints name: Rerank - description: OpenAI-compatible Responses API endpoints name: Responses - description: SCIM endpoints name: SCIM - description: Speech-to-text endpoints name: STT x-displayName: Transcriptions - description: Text-to-speech endpoints name: TTS x-displayName: Speech - description: Video Generation endpoints name: Video Generation - description: Workspaces endpoints name: Workspaces externalDocs: description: OpenRouter Documentation url: https://openrouter.ai/docs paths: /videos/{jobId}: get: tags: - Video Generation summary: Poll video generation status description: Returns job status and content URLs when completed operationId: getVideos parameters: - in: path name: jobId required: true schema: example: job-abc123 minLength: 1 type: string responses: '200': content: application/json: example: generation_id: gen-xyz789 id: job-abc123 polling_url: /api/v1/videos/job-abc123 status: completed unsigned_urls: - https://storage.example.com/video.mp4 usage: cost: 0.5 schema: $ref: '#/components/schemas/VideoGenerationResponse' description: Video generation status '401': content: application/json: example: error: code: 401 message: Missing Authentication header schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials '404': content: application/json: example: error: code: 404 message: Resource not found schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist '500': content: application/json: example: error: code: 500 message: Internal Server Error schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error components: schemas: VideoGenerationResponse: ``` -------------------------------- ### POST /videos Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Submits a video generation request and returns a polling URL to check status. ```APIDOC ## POST /videos ### Description Submits a video generation request and returns a polling URL to check status. ### Method POST ### Endpoint /videos ### Request Body - **aspect_ratio** (string) - Optional - The aspect ratio of the video (e.g., '16:9') - **duration** (integer) - Optional - The duration of the video in seconds - **model** (string) - Required - The model identifier to use for generation - **prompt** (string) - Required - The text prompt describing the video - **resolution** (string) - Optional - The resolution of the video (e.g., '720p') ### Request Example { "aspect_ratio": "16:9", "duration": 8, "model": "google/veo-3.1", "prompt": "A serene mountain landscape at sunset", "resolution": "720p" } ### Response #### Success Response (202) - **generation_id** (string) - The unique identifier for the generation - **id** (string) - The unique identifier for the job - **polling_url** (string) - The URL to poll for status updates - **status** (string) - The current status of the job #### Response Example { "generation_id": "gen-xyz789", "id": "job-abc123", "polling_url": "/api/v1/videos/job-abc123", "status": "pending" } ``` -------------------------------- ### OpenAPI Provider Configuration Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Defines the structure for various AI service providers within an OpenAPI schema. ```yaml additionalProperties: {} type: object crusoe: additionalProperties: {} type: object darkbloom: additionalProperties: {} type: object databricks: additionalProperties: {} type: object decart: additionalProperties: {} type: object deepgram: additionalProperties: {} type: object deepinfra: additionalProperties: {} type: object deepseek: additionalProperties: {} type: object dekallm: additionalProperties: {} type: object digitalocean: additionalProperties: {} type: object enfer: additionalProperties: {} type: object fake-provider: additionalProperties: {} type: object featherless: additionalProperties: {} type: object fireworks: additionalProperties: {} type: object fish-audio: additionalProperties: {} type: object friendli: additionalProperties: {} type: object gmicloud: additionalProperties: {} type: object google-ai-studio: additionalProperties: {} type: object google-vertex: additionalProperties: {} type: object gopomelo: additionalProperties: {} type: object groq: additionalProperties: {} type: object heygen: additionalProperties: {} type: object huggingface: additionalProperties: {} type: object hyperbolic: additionalProperties: {} type: object hyperbolic-quantized: additionalProperties: {} type: object inception: additionalProperties: {} type: object inceptron: additionalProperties: {} type: object inferact-vllm: additionalProperties: {} type: object inference-net: additionalProperties: {} type: object infermatic: additionalProperties: {} type: object inflection: additionalProperties: {} type: object inocloud: additionalProperties: {} type: object io-net: additionalProperties: {} type: object ionstream: additionalProperties: {} type: object klusterai: additionalProperties: {} type: object krea: additionalProperties: {} type: object lambda: additionalProperties: {} type: object lepton: additionalProperties: {} type: object liquid: additionalProperties: {} type: object lynn: additionalProperties: {} type: object lynn-private: additionalProperties: {} type: object makora: additionalProperties: {} type: object mancer: additionalProperties: {} type: object mancer-old: additionalProperties: {} type: object mara: additionalProperties: {} type: object meta: additionalProperties: {} type: object minimax: additionalProperties: {} type: object mistral: additionalProperties: {} type: object modal: additionalProperties: {} type: object modelrun: additionalProperties: {} type: object modular: additionalProperties: {} type: object moonshotai: additionalProperties: {} type: object morph: additionalProperties: {} type: object ncompass: additionalProperties: {} type: object nebius: additionalProperties: {} type: object nex-agi: additionalProperties: {} type: object nextbit: additionalProperties: {} type: object nineteen: additionalProperties: {} type: object novita: additionalProperties: {} type: object nvidia: additionalProperties: {} type: object octoai: additionalProperties: {} type: object ollama: additionalProperties: {} type: object open-inference: additionalProperties: {} type: object openai: additionalProperties: {} type: object parasail: additionalProperties: {} type: object perceptron: additionalProperties: {} type: object ``` -------------------------------- ### API Response Structures Source: https://openrouter.ai/docs/api/api-reference JSON schemas for successful activity data retrieval and common error responses. ```json { "data": [ { "byok_usage_inference": 0.012, "completion_tokens": 125, "date": "2025-08-24", "endpoint_id": "550e8400-e29b-41d4-a716-446655440000", "model": "openai/gpt-4.1", "model_permaslug": "openai/gpt-4.1-2025-04-14", "prompt_tokens": 50, "provider_name": "OpenAI", "reasoning_tokens": 25, "requests": 5, "usage": 0.015 } ] } ``` ```json { "error": { "code": 400, "message": "Invalid request parameters" } } ``` ```json { "error": { "code": 401, "message": "Missing Authentication header" } } ``` ```json { "error": { "code": 403, "message": "Only management keys can perform this operation" } } ``` ```json { "error": { "code": 404, "message": "Resource not found" } } ``` ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` -------------------------------- ### OpenAPI Video Generation Specification Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request Defines the POST /videos endpoint for submitting video generation tasks and the associated request/response schemas. ```yaml openapi: 3.1.0 info: contact: email: support@openrouter.ai name: OpenRouter Support url: https://openrouter.ai/docs description: OpenAI-compatible API with additional OpenRouter features license: name: MIT url: https://opensource.org/licenses/MIT title: OpenRouter API version: 1.0.0 servers: - description: Production server url: https://openrouter.ai/api/v1 x-speakeasy-server-id: production security: - apiKey: [] tags: - description: API key management endpoints name: API Keys - description: Analytics and usage endpoints name: Analytics - description: Anthropic Messages endpoints name: Anthropic Messages - description: BYOK endpoints name: BYOK - description: Benchmarks endpoints name: Benchmarks - description: Chat completion endpoints name: Chat - description: Task classification market-share endpoints name: Classifications - description: Containers endpoints name: Containers - description: Credit management endpoints name: Credits - description: >- Public OpenRouter usage datasets. Data returned by these endpoints is licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/): reuse and republish it, including commercially, with attribution to OpenRouter. name: Datasets - description: Text embedding endpoints name: Embeddings - description: Endpoint information name: Endpoints - description: Files endpoints name: Files - description: Generation history endpoints name: Generations - description: Guardrails endpoints name: Guardrails - description: Images endpoints name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints name: OAuth - description: Observability endpoints name: Observability - description: Organization endpoints name: Organization - description: Presets endpoints name: Presets - description: Provider information endpoints name: Providers - description: Rerank endpoints name: Rerank - description: OpenAI-compatible Responses API endpoints name: Responses - description: SCIM endpoints name: SCIM - description: Speech-to-text endpoints name: STT x-displayName: Transcriptions - description: Text-to-speech endpoints name: TTS x-displayName: Speech - description: Video Generation endpoints name: Video Generation - description: Workspaces endpoints name: Workspaces externalDocs: description: OpenRouter Documentation url: https://openrouter.ai/docs paths: /videos: post: tags: - Video Generation summary: Submit a video generation request description: >- Submits a video generation request and returns a polling URL to check status operationId: createVideos requestBody: content: application/json: example: aspect_ratio: '16:9' duration: 8 model: google/veo-3.1 prompt: A serene mountain landscape at sunset resolution: 720p schema: $ref: '#/components/schemas/VideoGenerationRequest' required: true responses: '202': content: application/json: example: generation_id: gen-xyz789 id: job-abc123 polling_url: /api/v1/videos/job-abc123 status: pending schema: $ref: '#/components/schemas/VideoGenerationResponse' description: Video generation request accepted '400': content: application/json: example: error: code: 400 message: Invalid request parameters schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: example: error: code: 401 message: Missing Authentication header schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials '402': content: application/json: example: error: code: 402 message: >- Insufficient credits. Add more using ``` -------------------------------- ### Video Generation Request Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request The Video Generation Request object defines the parameters required to initiate a video generation task. ```APIDOC ## Video Generation Request Schema ### Description Defines the parameters for submitting a video generation request. ### Request Body - **model** (string) - Required - The model identifier to use for generation. - **prompt** (string) - Optional - Text prompt describing the video. Required for models that do not support image-only input. - **aspect_ratio** (string) - Optional - Aspect ratio of the generated video (e.g., '16:9', '9:16', '1:1', '4:3', '3:4', '3:2', '2:3', '21:9', '9:21'). - **duration** (integer) - Optional - Duration of the generated video in seconds (minimum 1). - **resolution** (string) - Optional - Resolution of the generated video (e.g., 480p, 720p, 768p, 1080p, 1K, 2K, 4K). - **callback_url** (string) - Optional - HTTPS URL to receive a webhook notification upon completion. - **generate_audio** (boolean) - Optional - Whether to generate audio alongside the video. - **creativity** (integer) - Optional - Creativity level for video upscaling models. - **frame_images** (array) - Optional - Images to use as the first or last frame. - **input_references** (array) - Optional - Reference assets to guide generation. - **provider** (object) - Optional - Provider-specific passthrough configuration. ### Request Example { "aspect_ratio": "16:9", "duration": 8, "model": "google/veo-3.1", "prompt": "A serene mountain landscape at sunset", "resolution": "720p" } ``` -------------------------------- ### Define Error Response and Security Schemas Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definitions for internal server errors, bad gateway responses, and the bearer token security scheme. ```yaml message: Internal Server Error properties: code: type: integer message: type: string metadata: additionalProperties: {} type: - object - 'null' required: - code - message type: object BadGatewayResponseErrorData: description: Error data for BadGatewayResponse example: code: 502 message: Provider returned error properties: code: type: integer message: type: string metadata: additionalProperties: {} type: - object - 'null' required: - code - message type: object securitySchemes: apiKey: description: API key as bearer token in Authorization header scheme: bearer type: http ``` -------------------------------- ### Not Found Response Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for 404 Not Found responses. ```yaml NotFoundResponse: description: Not Found - Resource does not exist example: error: code: 404 message: Resource not found properties: error: $ref: '#/components/schemas/NotFoundResponseErrorData' openrouter_metadata: additionalProperties: {} type: - object - 'null' user_id: type: - string - 'null' required: - error type: object ``` -------------------------------- ### Bad Request Response Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for 400 Bad Request responses. ```yaml BadRequestResponse: description: Bad Request - Invalid request parameters or malformed input example: error: code: 400 message: Invalid request parameters properties: error: $ref: '#/components/schemas/BadRequestResponseErrorData' openrouter_metadata: additionalProperties: {} type: - object - 'null' user_id: type: - string - 'null' required: - error type: object ``` -------------------------------- ### Internal Server Response Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for 500 Internal Server Error responses. ```yaml InternalServerResponse: description: Internal Server Error - Unexpected server error example: error: code: 500 message: Internal Server Error properties: error: $ref: '#/components/schemas/InternalServerResponseErrorData' openrouter_metadata: additionalProperties: {} type: - object - 'null' user_id: type: - string - 'null' required: - error type: object ``` -------------------------------- ### NotFoundResponseErrorData Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for error data associated with Not Found responses. ```yaml NotFoundResponseErrorData: description: Error data for NotFoundResponse example: code: 404 message: Resource not found properties: code: type: integer message: type: string metadata: additionalProperties: {} type: - object - 'null' required: - code - message type: object ``` -------------------------------- ### Bad Gateway Response Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for 502 Bad Gateway responses. ```yaml BadGatewayResponse: description: Bad Gateway - Provider/upstream API failure example: error: code: 502 message: Provider returned error properties: error: $ref: '#/components/schemas/BadGatewayResponseErrorData' openrouter_metadata: additionalProperties: {} type: - object - 'null' user_id: type: - string - 'null' required: - error type: object ``` -------------------------------- ### InternalServerResponseErrorData Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for error data associated with Internal Server Error responses. ```yaml InternalServerResponseErrorData: description: Error data for InternalServerResponse example: code: 500 ``` -------------------------------- ### Unauthorized Response Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for 401 Unauthorized responses. ```yaml UnauthorizedResponse: description: Unauthorized - Authentication required or invalid credentials example: error: code: 401 message: Missing Authentication header properties: error: $ref: '#/components/schemas/UnauthorizedResponseErrorData' openrouter_metadata: additionalProperties: {} type: - object - 'null' user_id: type: - string - 'null' required: - error type: object ``` -------------------------------- ### BadRequestResponseErrorData Schema Source: https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content Schema definition for error data associated with Bad Request responses. ```yaml BadRequestResponseErrorData: description: Error data for BadRequestResponse example: code: 400 message: Invalid request parameters properties: code: type: integer message: type: string metadata: additionalProperties: {} type: - object - 'null' required: - code - message type: object ```