Tera Router
Gateway API

Video Generation

Submit a video job and poll it on the account that took it — POST /v1/videos/generations and GET /v1/videos/{id}.

Video models work as jobs: one call submits, later calls poll until the video is ready. Both endpoints need the images scope.

EndpointDoes
POST /v1/videos/generationsSubmits the job; billed once per request
GET /v1/videos/{id}Polls the job on the submitting account; free

Providers: xAI (xai/grok-imagine-video) and OpenAI-compatible custom providers that serve /videos/generations. GET /v1/models/video lists the video models this key may use.

Submit

The JSON body passes through with only model rewritten, so provider fields such as duration reach the upstream as you send them.

curl http://localhost:8080/v1/videos/generations \
  -H "Authorization: Bearer sk_tr_..." \
  -H "Content-Type: application/json" \
  -d '{ "model": "xai/grok-imagine-video", "prompt": "A fox running through snow", "duration": 5 }'
{ "request_id": "vid-1", "status": "pending" }

The upstream body comes back as is. Keep its job id (request_id or id, per provider): the router remembers which account took the job and which key submitted it.

Never sent twice

Once a submit may have reached a provider (a timeout, a dropped connection, or a 5xx), it is not retried on another account, because the job may already exist and would be billed twice. A refusal such as 401, 403 or 429, or a failed connection, moves on to the next account.

Poll

curl http://localhost:8080/v1/videos/vid-1 \
  -H "Authorization: Bearer sk_tr_..."

The poll goes to the account and model that took the job. Only the key that submitted the job may poll it; any other key gets 404. The upstream status passes through until it carries the video URL. Polls never fall back and are not charged.

Billing

A submit carries no tokens, so it is billed by the per request price on the model's pricing override (also available for speech, transcription, and web calls). Without one, the submit is not charged.

StatusMeaning
400Not a video model, or a malformed job id
403The key lacks the images scope, or its allowlist excludes the model
404No job with that id was submitted by this key
504The provider timed out; the submit was not retried

On this page