Browse documentation

Videos

Initiate asynchronous video generation jobs from descriptive text prompts across supported provider models with sealed job handles and lifecycle polling.

The /v1/videos endpoint initiates asynchronous video generation jobs from text prompts across models like Google Veo and OpenAI Sora. Requests return an immediate job ID for status polling via GET /v1/videos/{id} and binary retrieval via GET /v1/videos/{id}/content.

POST https://api.nrouter.ai/v1/videos

Requests run preflight as Chat Completions: key validation, rate limits, and content inspection (x-nr-guardrails: blocked returns HTTP 400 with zero hold). Duration and resolution credit holds settle upon generation completion.

Request Parameters

ParameterTypeRequiredDefaultDescription
modelstringYes—Model ID (e.g. veo-2.0, sora-1.0).
promptstringYes—Text description of scene, lighting, action, and camera movement.
secondsintegerNo5Target video duration in seconds (typically 5 to 10).
sizestringNo1280x720Output resolution (e.g. 1280x720, 1920x1080, 720x1280).
fpsintegerNo24Render frame rate (24 or 30).

Response

{
  "id": "nrouter_video_01j89azxckm3287",
  "object": "video.generation",
  "status": "queued",
  "created": 1709251200,
  "model": "veo-2.0"
}

Examples

curl -X POST https://api.nrouter.ai/v1/videos \
  -H "Authorization: Bearer $NROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"veo-2.0","prompt":"Drone shot over pine forest.","seconds":5}'

Headers & Errors

Required request headers: Authorization: Bearer sk-nrouter-... and Content-Type: application/json. Response telemetry includes x-nr-request-id, x-nr-latency-ms, x-nr-request-cost, x-nr-model. See Chat Completions.

HTTP StatusError CodeReason
400 Bad Requestinvalid_requestMissing model/prompt, or invalid duration/resolution.
400 Bad Requestguardrail_blockedPrompt violated safety policies or injection filters.
401 Unauthorizedinvalid_api_keyVirtual key missing, expired, or invalid.
402 Payment Requiredinsufficient_creditsOrganization balance insufficient for duration hold.
404 Not Foundmodel_not_foundVideo model unrecognized or unauthorized.
429 Too Many Requestsrate_limit_exceededConcurrent generation limit exceeded; check x-nr-limit-source.
POST
/v1/videos

Authorization

NRouterApiKey
AuthorizationBearer <token>

Your nRouter virtual key (sk-nrouter-…). Sent as Authorization: Bearer sk-nrouter-….

In: header

Header Parameters

x-nr-tags?string

Custom spend and attribution tags (comma-separated key=value pairs)

x-nr-mcp-server?string

Target MCP server ID when routing MCP tool calls or prompts through the gateway

x-nr-client-language?string

Caller SDK runtime language identification (e.g. typescript, python, rust, go)

x-nr-session-id?string

Caller session identifier allowed at edge for grouping related client turns

x-nr-trace?string

Inbound trace detail level override for request lifecycle spans

Value in

  • "off"
  • "stages"
  • "verbose"
x-nr-trace-stages?string

Inbound stage-level trace emission override

Value in

  • "off"
  • "stages"
  • "verbose"
x-nr-trace-id?string

Accepted so a client sending it is not refused; the value is not recorded and not propagated. Every response carries the gateway's own trace ID in this header, never the one sent.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/videos" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "prompt": "string"  }'
{  "id": "nrouter_video_abc123",  "object": "video.generation",  "status": "queued"}
Was this page helpful?