Files API
This page documents the 15 gateway endpoints tagged files 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 | /files | List files |
| POST | /files | Upload a file |
| GET | /v1/files | List files |
| POST | /v1/files | Upload a file |
| GET | /{provider}/v1/files | List files |
| POST | /{provider}/v1/files | Upload a file |
| GET | /files/{file_id}/content | Download the contents of a file |
| GET | /v1/files/{file_id}/content | Download the contents of a file |
| GET | /{provider}/v1/files/{file_id}/content | Download the contents of a file |
| GET | /files/{file_id} | Read the details of a file |
| DELETE | /files/{file_id} | Delete a file |
| GET | /v1/files/{file_id} | Read the details of a file |
| DELETE | /v1/files/{file_id} | Delete a file |
| GET | /{provider}/v1/files/{file_id} | Read the details of a file |
| DELETE | /{provider}/v1/files/{file_id} | Delete a file |
Endpoints
GET /files
List files
Lists uploaded files one page at a time, optionally narrowed by purpose, with limit and after for paging. With managed files only the caller's own files are listed, and target_model_names picks the model whose files to list. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | |
target_model_names | query | string or null | No | |
purpose | query | string or null | No | |
limit | query | integer or null | No | |
after | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of files the caller may see. | 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 | "list" | No | Object |
data | array of object | No | Data |
first_id | string or null | No | First Id |
last_id | string or null | No | Last Id |
has_more | boolean | No | Has More |
POST /files
Upload a file
Uploads a file for later use by the batch, fine-tuning, assistants or other APIs, for example a JSONL file of requests to run as a batch. Send it as multipart form data with the file and its purpose. With managed files on, target_model_names uploads it once for each named model and returns one gateway file id that works for all of them. Batch files are checked against the configured size limit, the models they name and the batch guardrails before they reach the provider. expires_after[anchor] and expires_after[seconds] ask the provider to delete the file later. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No |
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | The file to upload. |
purpose | string | Yes | Why the file is uploaded, for example batch, fine-tune, assistants or user_data. |
custom_llm_provider | string | No | Provider to upload to when managed files are off. |
target_model_names | string | No | Comma separated model groups the managed file is uploaded for. |
target_storage | string | No | A storage backend configured on the gateway to keep the file in instead of the provider. |
passthrough | boolean | No | Upload the bytes unchanged for a native Vertex AI batch. |
expires_after[anchor] | string | No | What the expiry counts from, created_at. Send it together with expires_after[seconds]. |
expires_after[seconds] | integer | No | How many seconds after the anchor the provider deletes the file. |
spanway_metadata[key] | string | No | Metadata to log with the upload, one field per key, such as spanway_metadata[ticket]. |
Example request:
curl -X POST "http://localhost:4000/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F file="@file.bin" \
-F purpose="value"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file object. With managed files the id is a gateway id that maps to the provider files behind it. | 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 upload is larger than general_settings.max_file_size_mb. Nothing was sent to the provider. | application/json ProxyError |
| 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
GET /v1/files
List files
Lists uploaded files one page at a time, optionally narrowed by purpose, with limit and after for paging. With managed files only the caller's own files are listed, and target_model_names picks the model whose files to list. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | |
target_model_names | query | string or null | No | |
purpose | query | string or null | No | |
limit | query | integer or null | No | |
after | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of files the caller may see. | 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 | "list" | No | Object |
data | array of object | No | Data |
first_id | string or null | No | First Id |
last_id | string or null | No | Last Id |
has_more | boolean | No | Has More |
POST /v1/files
Upload a file
Uploads a file for later use by the batch, fine-tuning, assistants or other APIs, for example a JSONL file of requests to run as a batch. Send it as multipart form data with the file and its purpose. With managed files on, target_model_names uploads it once for each named model and returns one gateway file id that works for all of them. Batch files are checked against the configured size limit, the models they name and the batch guardrails before they reach the provider. expires_after[anchor] and expires_after[seconds] ask the provider to delete the file later. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No |
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | The file to upload. |
purpose | string | Yes | Why the file is uploaded, for example batch, fine-tune, assistants or user_data. |
custom_llm_provider | string | No | Provider to upload to when managed files are off. |
target_model_names | string | No | Comma separated model groups the managed file is uploaded for. |
target_storage | string | No | A storage backend configured on the gateway to keep the file in instead of the provider. |
passthrough | boolean | No | Upload the bytes unchanged for a native Vertex AI batch. |
expires_after[anchor] | string | No | What the expiry counts from, created_at. Send it together with expires_after[seconds]. |
expires_after[seconds] | integer | No | How many seconds after the anchor the provider deletes the file. |
spanway_metadata[key] | string | No | Metadata to log with the upload, one field per key, such as spanway_metadata[ticket]. |
Example request:
curl -X POST "http://localhost:4000/v1/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F file="@file.bin" \
-F purpose="value"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file object. With managed files the id is a gateway id that maps to the provider files behind it. | 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 upload is larger than general_settings.max_file_size_mb. Nothing was sent to the provider. | application/json ProxyError |
| 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
GET /{provider}/v1/files
List files
Lists uploaded files one page at a time, optionally narrowed by purpose, with limit and after for paging. With managed files only the caller's own files are listed, and target_model_names picks the model whose files to list. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string or null | Yes | |
target_model_names | query | string or null | No | |
purpose | query | string or null | No | |
limit | query | integer or null | No | |
after | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/provider-123/v1/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of files the caller may see. | 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 | "list" | No | Object |
data | array of object | No | Data |
first_id | string or null | No | First Id |
last_id | string or null | No | Last Id |
has_more | boolean | No | Has More |
POST /{provider}/v1/files
Upload a file
Uploads a file for later use by the batch, fine-tuning, assistants or other APIs, for example a JSONL file of requests to run as a batch. Send it as multipart form data with the file and its purpose. With managed files on, target_model_names uploads it once for each named model and returns one gateway file id that works for all of them. Batch files are checked against the configured size limit, the models they name and the batch guardrails before they reach the provider. expires_after[anchor] and expires_after[seconds] ask the provider to delete the file later. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string or null | Yes |
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | The file to upload. |
purpose | string | Yes | Why the file is uploaded, for example batch, fine-tune, assistants or user_data. |
custom_llm_provider | string | No | Provider to upload to when managed files are off. |
target_model_names | string | No | Comma separated model groups the managed file is uploaded for. |
target_storage | string | No | A storage backend configured on the gateway to keep the file in instead of the provider. |
passthrough | boolean | No | Upload the bytes unchanged for a native Vertex AI batch. |
expires_after[anchor] | string | No | What the expiry counts from, created_at. Send it together with expires_after[seconds]. |
expires_after[seconds] | integer | No | How many seconds after the anchor the provider deletes the file. |
spanway_metadata[key] | string | No | Metadata to log with the upload, one field per key, such as spanway_metadata[ticket]. |
Example request:
curl -X POST "http://localhost:4000/provider-123/v1/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F file="@file.bin" \
-F purpose="value"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file object. With managed files the id is a gateway id that maps to the provider files behind it. | 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 upload is larger than general_settings.max_file_size_mb. Nothing was sent to the provider. | application/json ProxyError |
| 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
GET /files/{file_id}/content
Download the contents of a file
Downloads the bytes of an uploaded or generated file, for example the output of a finished batch job. With managed files the id is the gateway's file id and the caller must own it, and a per key download limit applies when one is configured. Send provider, or call the provider prefixed path, when managed files are off. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/files/file_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file's bytes, with the content type the provider reports, for example a JSONL batch output. | application/octet-stream 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/files/{file_id}/content
Download the contents of a file
Downloads the bytes of an uploaded or generated file, for example the output of a finished batch job. With managed files the id is the gateway's file id and the caller must own it, and a per key download limit applies when one is configured. Send provider, or call the provider prefixed path, when managed files are off. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/files/file_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file's bytes, with the content type the provider reports, for example a JSONL batch output. | application/octet-stream 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 /{provider}/v1/files/{file_id}/content
Download the contents of a file
Downloads the bytes of an uploaded or generated file, for example the output of a finished batch job. With managed files the id is the gateway's file id and the caller must own it, and a per key download limit applies when one is configured. Send provider, or call the provider prefixed path, when managed files are off. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | path | string or null | Yes |
Example request:
curl -X GET "http://localhost:4000/provider-123/v1/files/file_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file's bytes, with the content type the provider reports, for example a JSONL batch output. | application/octet-stream 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 /files/{file_id}
Read the details of a file
Returns the details of one file, such as its name, size, purpose and processing status, without its contents. With managed files the id is the gateway's file id and the caller must own it. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
DELETE /files/{file_id}
Delete a file
Deletes a file so it can no longer be used or downloaded. With managed files the id is the gateway's file id and the caller must own the file. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. This cannot be undone.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X DELETE "http://localhost:4000/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the file was deleted. | 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 |
deleted | boolean | Yes | Deleted |
object | "file" | Yes | Object |
GET /v1/files/{file_id}
Read the details of a file
Returns the details of one file, such as its name, size, purpose and processing status, without its contents. With managed files the id is the gateway's file id and the caller must own it. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
DELETE /v1/files/{file_id}
Delete a file
Deletes a file so it can no longer be used or downloaded. With managed files the id is the gateway's file id and the caller must own the file. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. This cannot be undone.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | query | string or null | No |
Example request:
curl -X DELETE "http://localhost:4000/v1/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the file was deleted. | 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 |
deleted | boolean | Yes | Deleted |
object | "file" | Yes | Object |
GET /{provider}/v1/files/{file_id}
Read the details of a file
Returns the details of one file, such as its name, size, purpose and processing status, without its contents. With managed files the id is the gateway's file id and the caller must own it. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. Nothing is changed.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | path | string or null | Yes |
Example request:
curl -X GET "http://localhost:4000/provider-123/v1/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The file 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 |
bytes | integer | Yes | Bytes |
created_at | integer | Yes | Created At |
filename | string | Yes | Filename |
object | "file" | Yes | Object |
purpose | enum: "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", ... | Yes | Purpose |
status | enum: "uploaded", "processed", "error", "pending" or null | No | Status |
expires_at | integer or null | No | Expires At |
status_details | string or null | No | Status Details |
spanway_batch_guardrail | object or null | No | |
spanway_details_fallback | boolean or null | No | Spanway Details Fallback |
DELETE /{provider}/v1/files/{file_id}
Delete a file
Deletes a file so it can no longer be used or downloaded. With managed files the id is the gateway's file id and the caller must own the file. Any key that may call the provider or model may call it, and the request is logged and tracked like any other call. This cannot be undone.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
file_id | path | string | Yes | |
provider | path | string or null | Yes |
Example request:
curl -X DELETE "http://localhost:4000/provider-123/v1/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the file was deleted. | 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 |
deleted | boolean | Yes | Deleted |
object | "file" | Yes | Object |