Batch API
This page documents the 12 gateway endpoints tagged batch 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 | /batches | List batches |
| POST | /batches | Create a batch |
| GET | /v1/batches | List batches |
| POST | /v1/batches | Create a batch |
| GET | /{provider}/v1/batches | List batches |
| POST | /{provider}/v1/batches | Create a batch |
| GET | /batches/{batch_id} | Retrieve a batch |
| GET | /v1/batches/{batch_id} | Retrieve a batch |
| GET | /{provider}/v1/batches/{batch_id} | Retrieve a batch |
| POST | /batches/{batch_id}/cancel | Cancel a batch |
| POST | /v1/batches/{batch_id}/cancel | Cancel a batch |
| POST | /{provider}/v1/batches/{batch_id}/cancel | Cancel a batch |
Endpoints
GET /batches
List batches
Lists batch jobs newest first, one page at a time. Use limit for the page size and after with the last id from the previous page to read further. Any key may call it, managed batches are filtered to the ones the caller owns, and nothing changes. The answer follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches?limit=2 -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | The provider whose batches to list, for example openai, azure or vertex_ai. Used when no model or target_model_names picks the account. Defaults to openai. |
limit | query | integer or null | No | How many batches to return, from 0 to 100. Outside that range the answer is a 400. |
after | query | string or null | No | Return the batches after this batch id, taken from last_id of the previous page. |
target_model_names | query | string or null | No | List the batches of this model from model_list instead of the provider's default account. |
Example request:
curl -X GET "http://localhost:4000/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of batches, newest first. Pass last_id as after to read the next page. | 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" | Yes | Object |
data | array of object | Yes | Data |
first_id | string or null | No | First Id |
last_id | string or null | No | Last Id |
has_more | boolean | No | Has More |
POST /batches
Create a batch
Starts a batch job: the gateway sends every request in an uploaded JSONL file to the model at the provider's batch price and returns the results in an output file, usually within 24 hours. Any key allowed to use the model may call it, and the batch's cost is tracked against that key, its team and its user. The body follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}'
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | |
x-spanway-model | header | string | No | Run the batch on this model from model_list, the same as model in the body. |
model | query | string | No | Run the batch on this model from model_list, the same as model in the body. |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
input_file_id | string | Yes | Input File Id |
endpoint | enum: "/v1/chat/completions", "/v1/completions", "/v1/embeddings", "/v1/responses" | Yes | Endpoint |
completion_window | "24h" | Yes | Completion Window |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
custom_llm_provider | string or null | No | Custom Llm Provider |
Example request:
curl -X POST "http://localhost:4000/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"metadata": {
"job": "nightly-summaries"
}
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object. Poll it until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
GET /v1/batches
List batches
Lists batch jobs newest first, one page at a time. Use limit for the page size and after with the last id from the previous page to read further. Any key may call it, managed batches are filtered to the ones the caller owns, and nothing changes. The answer follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches?limit=2 -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | The provider whose batches to list, for example openai, azure or vertex_ai. Used when no model or target_model_names picks the account. Defaults to openai. |
limit | query | integer or null | No | How many batches to return, from 0 to 100. Outside that range the answer is a 400. |
after | query | string or null | No | Return the batches after this batch id, taken from last_id of the previous page. |
target_model_names | query | string or null | No | List the batches of this model from model_list instead of the provider's default account. |
Example request:
curl -X GET "http://localhost:4000/v1/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of batches, newest first. Pass last_id as after to read the next page. | 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" | Yes | Object |
data | array of object | Yes | 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/batches
Create a batch
Starts a batch job: the gateway sends every request in an uploaded JSONL file to the model at the provider's batch price and returns the results in an output file, usually within 24 hours. Any key allowed to use the model may call it, and the batch's cost is tracked against that key, its team and its user. The body follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}'
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string or null | No | |
x-spanway-model | header | string | No | Run the batch on this model from model_list, the same as model in the body. |
model | query | string | No | Run the batch on this model from model_list, the same as model in the body. |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
input_file_id | string | Yes | Input File Id |
endpoint | enum: "/v1/chat/completions", "/v1/completions", "/v1/embeddings", "/v1/responses" | Yes | Endpoint |
completion_window | "24h" | Yes | Completion Window |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
custom_llm_provider | string or null | No | Custom Llm Provider |
Example request:
curl -X POST "http://localhost:4000/v1/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"metadata": {
"job": "nightly-summaries"
}
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object. Poll it until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
GET /{provider}/v1/batches
List batches
Lists batch jobs newest first for the provider named in the path, one page at a time. It behaves like GET /v1/batches with the provider query parameter set.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string | Yes | The provider whose batches to list, for example openai or azure. |
limit | query | integer or null | No | How many batches to return, from 0 to 100. Outside that range the answer is a 400. |
after | query | string or null | No | Return the batches after this batch id, taken from last_id of the previous page. |
target_model_names | query | string or null | No | List the batches of this model from model_list instead of the provider's default account. |
Example request:
curl -X GET "http://localhost:4000/provider-123/v1/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of batches, newest first. Pass last_id as after to read the next page. | 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" | Yes | Object |
data | array of object | Yes | 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/batches
Create a batch
Starts a batch job: the gateway sends every request in an uploaded JSONL file to the model at the provider's batch price and returns the results in an output file, usually within 24 hours. Any key allowed to use the model may call it, and the batch's cost is tracked against that key, its team and its user. The body follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}'
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string or null | Yes | |
x-spanway-model | header | string | No | Run the batch on this model from model_list, the same as model in the body. |
model | query | string | No | Run the batch on this model from model_list, the same as model in the body. |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
input_file_id | string | Yes | Input File Id |
endpoint | enum: "/v1/chat/completions", "/v1/completions", "/v1/embeddings", "/v1/responses" | Yes | Endpoint |
completion_window | "24h" | Yes | Completion Window |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
custom_llm_provider | string or null | No | Custom Llm Provider |
Example request:
curl -X POST "http://localhost:4000/provider-123/v1/batches" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"metadata": {
"job": "nightly-summaries"
}
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object. Poll it until status is completed. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError or HTTPValidationError |
| 429 | Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Id |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
GET /batches/{batch_id}
Retrieve a batch
Reads the current state of one batch job: its status, how many requests finished or failed and, once it is completed, the id of the output file to download. Any key that may use the batch's model can call it, a managed batch id only answers for the owner that created it, and nothing changes. The answer follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batch_id | path | string | Yes | The ID of the batch to retrieve |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/batches/batch_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object with its current status and, once completed, the output file id. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
GET /v1/batches/{batch_id}
Retrieve a batch
Reads the current state of one batch job: its status, how many requests finished or failed and, once it is completed, the id of the output file to download. Any key that may use the batch's model can call it, a managed batch id only answers for the owner that created it, and nothing changes. The answer follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batch_id | path | string | Yes | The ID of the batch to retrieve |
provider | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/batches/batch_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object with its current status and, once completed, the output file id. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
GET /{provider}/v1/batches/{batch_id}
Retrieve a batch
Reads the current state of one batch job: its status, how many requests finished or failed and, once it is completed, the id of the output file to download. Any key that may use the batch's model can call it, a managed batch id only answers for the owner that created it, and nothing changes. The answer follows the OpenAI Batch API.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json"
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string or null | Yes | |
batch_id | path | string | Yes | The ID of the batch to retrieve |
Example request:
curl -X GET "http://localhost:4000/provider-123/v1/batches/batch_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch object with its current status and, once completed, the output file id. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
POST /batches/{batch_id}/cancel
Cancel a batch
Stops a batch job that is still running. Requests already finished stay in the output and are charged, the rest are not sent. Any key that may use the batch's model can call it, and a managed batch id only for the owner that created it. The status moves to cancelling and then cancelled.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -X POST
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batch_id | path | string | Yes | |
provider | query | string or null | No |
Request body (application/json, object):
Example request:
curl -X POST "http://localhost:4000/batches/batch_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch while it is being cancelled. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
POST /v1/batches/{batch_id}/cancel
Cancel a batch
Stops a batch job that is still running. Requests already finished stay in the output and are charged, the rest are not sent. Any key that may use the batch's model can call it, and a managed batch id only for the owner that created it. The status moves to cancelling and then cancelled.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -X POST
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batch_id | path | string | Yes | |
provider | query | string or null | No |
Request body (application/json, object):
Example request:
curl -X POST "http://localhost:4000/v1/batches/batch_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch while it is being cancelled. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |
POST /{provider}/v1/batches/{batch_id}/cancel
Cancel a batch
Stops a batch job that is still running. Requests already finished stay in the output and are charged, the rest are not sent. Any key that may use the batch's model can call it, and a managed batch id only for the owner that created it. The status moves to cancelling and then cancelled.
Example Curl
curl http://localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" -X POST
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batch_id | path | string | Yes | |
provider | path | string or null | Yes |
Request body (application/json, object):
Example request:
curl -X POST "http://localhost:4000/provider-123/v1/batches/batch_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The batch while it is being cancelled. | 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 |
completion_window | string | Yes | Completion Window |
created_at | integer | Yes | Created At |
endpoint | string | Yes | Endpoint |
input_file_id | string | Yes | Input File Id |
object | "batch" | Yes | Object |
status | enum: "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled" | Yes | Status |
cancelled_at | integer or null | No | Cancelled At |
cancelling_at | integer or null | No | Cancelling At |
completed_at | integer or null | No | Completed At |
error_file_id | string or null | No | Error File Id |
errors | object or null | No | |
expired_at | integer or null | No | Expired At |
expires_at | integer or null | No | Expires At |
failed_at | integer or null | No | Failed At |
finalizing_at | integer or null | No | Finalizing At |
in_progress_at | integer or null | No | In Progress At |
metadata | object or null | No | Metadata |
model | string or null | No | Model |
output_file_id | string or null | No | Output File Id |
request_counts | object or null | No | |
usage | object or null | No |