Skip to main content

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.

MethodPathSummary
GET/videosList generated videos
POST/videosCreate a video from a prompt
GET/v1/videosList generated videos
POST/v1/videosCreate 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}/contentDownload a finished video
GET/v1/videos/{video_id}/contentDownload a finished video
POST/videos/{video_id}/remixRemix an existing video with a new prompt
POST/v1/videos/{video_id}/remixRemix an existing video with a new prompt
POST/videos/charactersCreate a reusable video character
POST/v1/videos/charactersCreate 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/editsEdit a video with a prompt
POST/v1/videos/editsEdit a video with a prompt
POST/videos/extensionsExtend a video
POST/v1/videos/extensionsExtend 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:

StatusDescriptionBody
200One page of videosapplication/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
objectstringNoAlways list
dataarray of objectYesThe videos on this page
first_idstring or nullNoThe id of the first video on this page
last_idstring or nullNoThe id of the last video, pass it as after for the next page
has_moreboolean or nullNoWhether 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):

FieldTypeRequiredDescription
modelstringYesThe video model name on the gateway
promptstringYesWhat the video should show
secondsstringNoHow long the video is, in seconds
sizestringNoThe frame size, for example 1280x720
input_referencestringNoAn image or clip the video should start from
userstringNoYour end user id, for abuse tracking

Request body (application/json, object):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
secondsstring or nullNoSeconds
sizestring or nullNoSize
resolutionstring or nullNoResolution
charactersarray of object or nullNoCharacters
userstring or nullNoUser

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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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:

StatusDescriptionBody
200One page of videosapplication/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
objectstringNoAlways list
dataarray of objectYesThe videos on this page
first_idstring or nullNoThe id of the first video on this page
last_idstring or nullNoThe id of the last video, pass it as after for the next page
has_moreboolean or nullNoWhether 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):

FieldTypeRequiredDescription
modelstringYesThe video model name on the gateway
promptstringYesWhat the video should show
secondsstringNoHow long the video is, in seconds
sizestringNoThe frame size, for example 1280x720
input_referencestringNoAn image or clip the video should start from
userstringNoYour end user id, for abuse tracking

Request body (application/json, object):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
secondsstring or nullNoSeconds
sizestring or nullNoSize
resolutionstring or nullNoResolution
charactersarray of object or nullNoCharacters
userstring or nullNoUser

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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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:

NameInTypeRequiredDescription
video_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/videos/video_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The video with its current statusapplication/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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:

NameInTypeRequiredDescription
video_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/videos/video_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The video with its current statusapplication/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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:

NameInTypeRequiredDescription
video_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/videos/video_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The finished video filevideo/mp4 string
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/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:

NameInTypeRequiredDescription
video_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/videos/video_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The finished video filevideo/mp4 string
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/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:

NameInTypeRequiredDescription
video_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
promptstringYesPrompt

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:

StatusDescriptionBody
200The new video object.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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:

NameInTypeRequiredDescription
video_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
promptstringYesPrompt

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:

StatusDescriptionBody
200The new video object.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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):

FieldTypeRequiredDescription
videostringYesA short clip that shows the character
namestringYesThe name to refer to the character by
modelstringNoThe video model name on the gateway
target_model_namesstringNoGateway 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:

StatusDescriptionBody
200The character object to reference in later video requests.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"character"NoObject
created_atintegerYesCreated At
namestringYesName

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):

FieldTypeRequiredDescription
videostringYesA short clip that shows the character
namestringYesThe name to refer to the character by
modelstringNoThe video model name on the gateway
target_model_namesstringNoGateway 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:

StatusDescriptionBody
200The character object to reference in later video requests.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"character"NoObject
created_atintegerYesCreated At
namestringYesName

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:

NameInTypeRequiredDescription
character_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/videos/characters/character_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The character object to reference in later video requests.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"character"NoObject
created_atintegerYesCreated At
namestringYesName

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:

NameInTypeRequiredDescription
character_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/videos/characters/character_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The character object to reference in later video requests.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"character"NoObject
created_atintegerYesCreated At
namestringYesName

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):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
videostringYesVideo

Request body (multipart/form-data, object):

FieldTypeRequiredDescription
modelstringYesThe video model name on the gateway
promptstringYesWhat to change in the video
videostringYesThe 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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
videostringYesVideo

Request body (multipart/form-data, object):

FieldTypeRequiredDescription
modelstringYesThe video model name on the gateway
promptstringYesWhat to change in the video
videostringYesThe 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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
videostringYesVideo
secondsstring or nullNoSeconds

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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage

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):

FieldTypeRequiredDescription
modelstringYesModel
promptstringYesPrompt
videostringYesVideo
secondsstring or nullNoSeconds

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:

StatusDescriptionBody
200The video object. Poll GET /v1/videos/{video_id} until status is completed.application/json object
400The 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
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The 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
408The provider did not answer before the request timed out.application/json ProxyError
413The 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. Docsapplication/json object
422The 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 errorapplication/json ProxyError or HTTPValidationError
429Too 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 errorapplication/json ProxyError
500The 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
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The 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. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
object"video"YesObject
statusstringYesStatus
created_atinteger or nullNoCreated At
completed_atinteger or nullNoCompleted At
expires_atinteger or nullNoExpires At
errorobject or nullNoError
progressinteger or nullNoProgress
remixed_from_video_idstring or nullNoRemixed From Video Id
secondsstring or nullNoSeconds
sizestring or nullNoSize
modelstring or nullNoModel
usageobject or nullNoUsage