Videos API
This page documents the 18 gateway endpoints tagged videos in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| GET | /videos | List generated videos |
| POST | /videos | Create a video from a prompt |
| GET | /v1/videos | List generated videos |
| POST | /v1/videos | Create a video from a prompt |
| GET | /videos/{video_id} | Check the status of a video |
| GET | /v1/videos/{video_id} | Check the status of a video |
| GET | /videos/{video_id}/content | Download a finished video |
| GET | /v1/videos/{video_id}/content | Download a finished video |
| POST | /videos/{video_id}/remix | Remix an existing video with a new prompt |
| POST | /v1/videos/{video_id}/remix | Remix an existing video with a new prompt |
| POST | /videos/characters | Create a reusable video character |
| POST | /v1/videos/characters | Create a reusable video character |
| GET | /videos/characters/{character_id} | Read a video character |
| GET | /v1/videos/characters/{character_id} | Read a video character |
| POST | /videos/edits | Edit a video with a prompt |
| POST | /v1/videos/edits | Edit a video with a prompt |
| POST | /videos/extensions | Extend a video |
| POST | /v1/videos/extensions | Extend a video |
Endpoints
GET /videos
List generated videos
Video list endpoint for retrieving a list of videos.
List the videos the provider holds for the deployment, newest first, to find an id you lost or to clean up.
Pass custom_llm_provider as a query parameter or header when more than one video provider is set up. Any
virtual key may call it. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Example request:
curl -X GET "http://localhost:4000/videos" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of videos | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
object | string | No | Always list |
data | array of object | Yes | The videos on this page |
first_id | string or null | No | The id of the first video on this page |
last_id | string or null | No | The id of the last video, pass it as after for the next page |
has_more | boolean or null | No | Whether another page follows |
POST /videos
Create a video from a prompt
Video generation endpoint for creating videos from text prompts.
Start generating a video from a text prompt, optionally from a first frame sent as input_reference in a
multipart form. Generation runs in the background: the answer is the video object with status queued, so
poll GET /v1/videos/{video_id} until it is completed and then download it from
/v1/videos/{video_id}/content. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply. The request and its cost are logged like any other call.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"model": "sora-2",
"prompt": "A beautiful sunset over the ocean"
}'
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The video model name on the gateway |
prompt | string | Yes | What the video should show |
seconds | string | No | How long the video is, in seconds |
size | string | No | The frame size, for example 1280x720 |
input_reference | string | No | An image or clip the video should start from |
user | string | No | Your end user id, for abuse tracking |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
resolution | string or null | No | Resolution |
characters | array of object or null | No | Characters |
user | string or null | No | User |
Example request:
curl -X POST "http://localhost:4000/videos" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A paper boat drifting down a rainy street at dusk",
"seconds": "8",
"size": "1280x720"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
GET /v1/videos
List generated videos
Video list endpoint for retrieving a list of videos.
List the videos the provider holds for the deployment, newest first, to find an id you lost or to clean up.
Pass custom_llm_provider as a query parameter or header when more than one video provider is set up. Any
virtual key may call it. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Example request:
curl -X GET "http://localhost:4000/v1/videos" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of videos | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
object | string | No | Always list |
data | array of object | Yes | The videos on this page |
first_id | string or null | No | The id of the first video on this page |
last_id | string or null | No | The id of the last video, pass it as after for the next page |
has_more | boolean or null | No | Whether another page follows |
POST /v1/videos
Create a video from a prompt
Video generation endpoint for creating videos from text prompts.
Start generating a video from a text prompt, optionally from a first frame sent as input_reference in a
multipart form. Generation runs in the background: the answer is the video object with status queued, so
poll GET /v1/videos/{video_id} until it is completed and then download it from
/v1/videos/{video_id}/content. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply. The request and its cost are logged like any other call.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"model": "sora-2",
"prompt": "A beautiful sunset over the ocean"
}'
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The video model name on the gateway |
prompt | string | Yes | What the video should show |
seconds | string | No | How long the video is, in seconds |
size | string | No | The frame size, for example 1280x720 |
input_reference | string | No | An image or clip the video should start from |
user | string | No | Your end user id, for abuse tracking |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
resolution | string or null | No | Resolution |
characters | array of object or null | No | Characters |
user | string or null | No | User |
Example request:
curl -X POST "http://localhost:4000/v1/videos" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A paper boat drifting down a rainy street at dusk",
"seconds": "8",
"size": "1280x720"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
GET /videos/{video_id}
Check the status of a video
Video status endpoint for retrieving video status and metadata.
Check whether a video is still being generated. status moves from queued through in_progress to
completed or failed, and progress counts to 100. The gateway reads the provider and deployment from
the video id, so no extra parameters are needed. Any virtual key allowed to use the video model may call it,
and the key's budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/video_123" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/videos/video_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video with its current status | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
GET /v1/videos/{video_id}
Check the status of a video
Video status endpoint for retrieving video status and metadata.
Check whether a video is still being generated. status moves from queued through in_progress to
completed or failed, and progress counts to 100. The gateway reads the provider and deployment from
the video id, so no extra parameters are needed. Any virtual key allowed to use the video model may call it,
and the key's budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/video_123" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/videos/video_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video with its current status | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
GET /videos/{video_id}/content
Download a finished video
Video content endpoint for downloading video content.
Download the finished video as an MP4 file once its status is completed. The gateway reads the provider
and deployment from the video id. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/{video_id}/content" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" --output video.mp4
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/videos/video_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The finished video file | video/mp4 string |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
GET /v1/videos/{video_id}/content
Download a finished video
Video content endpoint for downloading video content.
Download the finished video as an MP4 file once its status is completed. The gateway reads the provider
and deployment from the video id. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/{video_id}/content" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" --output video.mp4
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/videos/video_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The finished video file | video/mp4 string |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
POST /videos/{video_id}/remix
Remix an existing video with a new prompt
Video remix endpoint for remixing existing videos with new prompts.
Make a new video from an existing one with a changed prompt, for example the same scene at a different time of day. The original stays as it was and the answer is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/video_123/remix" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"prompt": "A new version with different colors"
}'
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Prompt |
Example request:
curl -X POST "http://localhost:4000/videos/video_id-123/remix" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The same scene at sunrise"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The new video object. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
POST /v1/videos/{video_id}/remix
Remix an existing video with a new prompt
Video remix endpoint for remixing existing videos with new prompts.
Make a new video from an existing one with a changed prompt, for example the same scene at a different time of day. The original stays as it was and the answer is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/video_123/remix" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"prompt": "A new version with different colors"
}'
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
video_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Prompt |
Example request:
curl -X POST "http://localhost:4000/v1/videos/video_id-123/remix" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The same scene at sunrise"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The new video object. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
POST /videos/characters
Create a reusable video character
Create a character from an uploaded video file.
Upload a short clip of a person or object and give it a name, so later video requests can reuse the same
character. Send a multipart form with video and name. Any virtual key allowed to use the video model may
call it, and the key's budget, rate limits and model access apply. The provider keeps the character, and the
gateway encodes its id so later requests reach the same deployment.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/characters" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -F "video=@character_video.mp4" -F "name=my_character"
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
video | string | Yes | A short clip that shows the character |
name | string | Yes | The name to refer to the character by |
model | string | No | The video model name on the gateway |
target_model_names | string | No | Gateway model names the character is for, the first one routes the request |
Example request:
curl -X POST "http://localhost:4000/videos/characters" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F video="@file.bin" \
-F name="value"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The character object to reference in later video requests. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "character" | No | Object |
created_at | integer | Yes | Created At |
name | string | Yes | Name |
POST /v1/videos/characters
Create a reusable video character
Create a character from an uploaded video file.
Upload a short clip of a person or object and give it a name, so later video requests can reuse the same
character. Send a multipart form with video and name. Any virtual key allowed to use the video model may
call it, and the key's budget, rate limits and model access apply. The provider keeps the character, and the
gateway encodes its id so later requests reach the same deployment.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/characters" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -F "video=@character_video.mp4" -F "name=my_character"
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
video | string | Yes | A short clip that shows the character |
name | string | Yes | The name to refer to the character by |
model | string | No | The video model name on the gateway |
target_model_names | string | No | Gateway model names the character is for, the first one routes the request |
Example request:
curl -X POST "http://localhost:4000/v1/videos/characters" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F video="@file.bin" \
-F name="value"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The character object to reference in later video requests. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "character" | No | Object |
created_at | integer | Yes | Created At |
name | string | Yes | Name |
GET /videos/characters/{character_id}
Read a video character
Retrieve a character by ID.
Read a saved video character by id, to check its name before using it. The gateway reads the provider and deployment from the character id. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/characters/char_123" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
character_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/videos/characters/character_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The character object to reference in later video requests. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "character" | No | Object |
created_at | integer | Yes | Created At |
name | string | Yes | Name |
GET /v1/videos/characters/{character_id}
Read a video character
Retrieve a character by ID.
Read a saved video character by id, to check its name before using it. The gateway reads the provider and deployment from the character id. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply. Nothing is changed.
It takes and returns the OpenAI Videos API format.
Example:
curl -X GET "http://localhost:4000/v1/videos/characters/char_123" -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
character_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/videos/characters/character_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The character object to reference in later video requests. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "character" | No | Object |
created_at | integer | Yes | Created At |
name | string | Yes | Name |
POST /videos/edits
Edit a video with a prompt
Create a video edit job.
Change an existing video with a prompt, for example adding snow. Send the video as a URL or id in JSON, or as a file in a multipart form. The answer is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/edits" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{"prompt": "Make it brighter", "video": {"id": "video_123"}}'
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
video | string | Yes | Video |
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The video model name on the gateway |
prompt | string | Yes | What to change in the video |
video | string | Yes | The video file to edit |
Example request:
curl -X POST "http://localhost:4000/videos/edits" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gen4_aleph",
"prompt": "Make it snow",
"video": "https://example.com/clip.mp4"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
POST /v1/videos/edits
Edit a video with a prompt
Create a video edit job.
Change an existing video with a prompt, for example adding snow. Send the video as a URL or id in JSON, or as a file in a multipart form. The answer is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/edits" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{"prompt": "Make it brighter", "video": {"id": "video_123"}}'
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
video | string | Yes | Video |
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The video model name on the gateway |
prompt | string | Yes | What to change in the video |
video | string | Yes | The video file to edit |
Example request:
curl -X POST "http://localhost:4000/v1/videos/edits" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gen4_aleph",
"prompt": "Make it snow",
"video": "https://example.com/clip.mp4"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
POST /videos/extensions
Extend a video
Create a video extension.
Make an existing video longer by continuing the scene for seconds more, guided by the prompt. The answer
is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/extensions" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{"prompt": "Continue the scene", "seconds": "5", "video": {"id": "video_123"}}'
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
video | string | Yes | Video |
seconds | string or null | No | Seconds |
Example request:
curl -X POST "http://localhost:4000/videos/extensions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "The boat reaches the harbour",
"video": "video_7c2d4e1f",
"seconds": "4"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |
POST /v1/videos/extensions
Extend a video
Create a video extension.
Make an existing video longer by continuing the scene for seconds more, guided by the prompt. The answer
is a new video object to poll. Any virtual key allowed to use the video model may call it, and the key's
budget, rate limits and model access apply.
It takes and returns the OpenAI Videos API format.
Example:
curl -X POST "http://localhost:4000/v1/videos/extensions" -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{"prompt": "Continue the scene", "seconds": "5", "video": {"id": "video_123"}}'
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model |
prompt | string | Yes | Prompt |
video | string | Yes | Video |
seconds | string or null | No | Seconds |
Example request:
curl -X POST "http://localhost:4000/v1/videos/extensions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "The boat reaches the harbour",
"video": "video_7c2d4e1f",
"seconds": "4"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The video object. Poll GET /v1/videos/{video_id} until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
object | "video" | Yes | Object |
status | string | Yes | Status |
created_at | integer or null | No | Created At |
completed_at | integer or null | No | Completed At |
expires_at | integer or null | No | Expires At |
error | object or null | No | Error |
progress | integer or null | No | Progress |
remixed_from_video_id | string or null | No | Remixed From Video Id |
seconds | string or null | No | Seconds |
size | string or null | No | Size |
model | string or null | No | Model |
usage | object or null | No | Usage |