Skip to content

Video with a budget (Runway)

Last updated: 2026-11-20T17:29:10-03:00 (UTC-3)

Generating video takes minutes and is billed per second. With quota_video, the gateway also enforces budgets on asynchronous video generation with Runway Gen-4.5 (text to video): each job is recorded before it is sent, is never resent by accident, and stays tied to the key and team that created it.

Without the flag, video routes to other providers keep working as passthrough, with no budget; an alias with a Runway target is refused with 404 feature_disabled (“Runway video jobs require quota_video”) before any call, because Runway jobs are only served with this lifecycle.

features:
video_generation: true
durable_usage: true
budget_limits: true
quota_media: true # requires budget_limits or tpm_limits
quota_video: true # requires quota_media, durable_usage and video_generation
providers:
- id: runway
protocol: runway
base_url: https://api.dev.runwayml.com/v1
api_version: "2024-11-06"
models:
- id: video-runway
capabilities: [video]
targets:
- {provider: runway, model: gen4.5, paths: {video: /text_to_video}}
quotas:
rates:
- provider_id: runway
model: gen4.5
connection: "<hash shown in the console>"
unit: video_second
variant: runway_gen45_mp4
unit_usd: "0.12"
revision: rev-1
  • The Runway key goes in a Secret or an encrypted override; the client’s key never reaches Runway.
  • The alias has only the video capability, a single gen4.5 target, no cache and no retry.
  • The client key needs the route:video scope.
  • gateway validate checks the configuration before you restart.

Reference price: Runway’s official price table lists 12 credits per second for Gen-4.5, at $0.01 per credit, before taxes. You approve the rate according to your contract. The estimated valuation uses the per-second price from the community cost map; the quota’s approved rate is separate.

Create a job:

Terminal window
curl http://localhost:8080/v1/videos/generations \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model": "video-runway", "promptText": "A cyan robot waving", "ratio": "1280:720", "duration": 2}'
Field Values
promptText 1 to 1,000 characters
ratio 1280:720 or 720:1280
duration 2 to 10 seconds
seed optional, unsigned 32-bit integer
outputFormat optional, mp4

The response is 202, with the job ID in X-Gateway-Video-Job.

Track it:

Endpoint What it does
GET /v1/video-jobs?limit=25&offset=0 Lists the key’s and team’s jobs (limit 1 to 50)
GET /v1/video-jobs/{id} Last known state, without calling Runway
POST /v1/video-jobs/{id}/refresh with {version} Queries Runway now; at most once every 5 s
DELETE /v1/video-jobs/{id} with {version} Cancels a pending job or deletes the finished video at Runway

The job goes through queued, running and succeeded. The refresh that observes completion returns the MP4 link in outputs. The gateway does not store that link (it is a signed URL that expires): save the video before it expires. A new refresh fetches the link again.

In the console: Budget & TPM → Video jobs. The screen asks for the inference key, which stays only in the page’s memory. Opening the screen does not call Runway; list, create, refresh and cancel are separate buttons.

  • Idempotency-Key is required (16 to 128 URL-safe characters). Repeating with the same key returns the same job; changing the content with the same key returns 409.
  • There is never an automatic resend. A timeout, restart or lost response does not create another job. A job can stay submitting or unknown without a Runway ID; it keeps its reservation until it is proven and does not authorize recreating it.
  • Job owner: the authenticated key and team. No client field chooses the owner. Every action checks the scope, model, key and team again; a revoked key or a removed team loses access.
  • The job stores the connection, model, seconds, reservation, request ID and trace ID. It does not store the prompt, media, signed URL or any secret.
  • The reservation is in seconds of video, not tokens. An applicable TPM policy refuses the job rather than converting seconds into tokens.
  • Only a SUCCEEDED response from Runway, with the right ID and exactly one valid HTTPS link, proves completion. The reservation is then settled for the requested seconds.
  • Failure, cancellation, an invalid response or a network error do not return balance on assumption: the reservation is left for financial reconciliation. A 204 or 404 on cancellation does not prove there was no charge.
  • Deleting a finished video keeps the measurement and the charge.

With a real Runway account: a 2 s job at 1280:720 returned 202; four refresh calls, every 10 s, went through queued, running and succeeded in about 55 s, and the last one returned the MP4 link (925 KB). By the public price table, 24 credits ($0.24).

  • Runway Gen-4.5 only, text to video, MP4. Reference images, audio and other models need a different profile.
  • No automatic polling: tracking is done with refresh.
  • Maximum time: 30 s to create, 20 s per query, status response up to 64 KiB.
  • Sora (OpenAI) and Veo (Gemini) are not in the profile: OpenAI announced the shutdown of Sora on 2026-09-24, and Google the shutdown of the Veo previews on 2026-10-22.

m7gtwcontact@m7gtw.com