Chat/completions API
This page documents the 4 gateway endpoints tagged chat/completions 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 |
|---|---|---|
| POST | /chat/completions | Create a chat completion |
| POST | /v1/chat/completions | Create a chat completion |
| POST | /openai/deployments/{model}/chat/completions | Create a chat completion |
| POST | /engines/{model}/chat/completions | Create a chat completion |
Endpoints
POST /chat/completions
Create a chat completion
Send a conversation to a model and get its reply, in the OpenAI chat completions format, so any OpenAI client works unchanged. Name a model group from GET /v1/models as model. Set stream: true to receive the reply as server-sent chunks. Provider specific fields pass through to the provider. Any virtual key that may use the named model can call it. The gateway checks the key's budget, rate limits and guardrails first, sends the request to one of the model group's deployments with retries and fallbacks, and records the cost and usage in the spend logs. Nothing else changes.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-spanway-routing-skips | header | enum: "true" | No | Send true to get the candidates the router skipped in the answer headers. See https://docs.spanway.ai/docs/proxy/routing_headers |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
context_fit | boolean or "middle_out" or object or null | No | How to fit a prompt that is longer than the context window |
transforms | array of string | No | Another way to ask for context fit: ["middle-out"] turns it on and [] turns it off |
model | string | Yes | Model |
messages | array of ChatCompletionUserMessage or ChatCompletionAssistantMessage or ChatCompletionToolMessage or ChatCompletionSystemMessage or ChatCompletionFunctionMessage or ChatCompletionDeveloperMessage | Yes | Messages |
frequency_penalty | number or null | No | Frequency Penalty |
logit_bias | object or null | No | Logit Bias |
logprobs | boolean or null | No | Logprobs |
top_logprobs | integer or null | No | Top Logprobs |
max_tokens | integer or null | No | Max Tokens |
n | integer or null | No | N |
presence_penalty | number or null | No | Presence Penalty |
response_format | object or null | No | Response Format |
seed | integer or null | No | Seed |
service_tier | string or null | No | Service Tier |
stop | string or array of string or null | No | Stop |
stream_options | object or null | No | Stream Options |
temperature | number or null | No | Temperature |
top_p | number or null | No | Top P |
tools | array of object or null | No | Tools |
tool_choice | string or object or null | No | Tool Choice |
parallel_tool_calls | boolean or null | No | Parallel Tool Calls |
function_call | string or object or null | No | Function Call |
functions | array of object or null | No | Functions |
user | string or null | No | User |
stream | boolean or null | No | Stream |
metadata | object or null | No | Metadata |
guardrails | array of string or null | No | Guardrails |
caching | boolean or null | No | Caching |
num_retries | integer or null | No | Num Retries |
context_window_fallback_dict | object or null | No | Context Window Fallback Dict |
fallbacks | array of string or null | No | Fallbacks |
prompt_id | string or null | No | Stored prompt to render into the messages, by id |
prompt_variables | object or null | No | Values for the stored prompt's variables |
prompt_version | integer or null | No | Version of the stored prompt to use. Leave out for the latest |
prompt_environment | string or null | No | Environment label of the stored prompt to use, such as production |
vector_store_ids | array of string or null | No | Vector stores to search and add to the context before the model call |
thinking | object or null | No | Extended thinking for models that support it, e.g. {"type": "enabled"} |
top_k | integer or null | No | Sample only from the top k tokens, for providers that support it |
cache | object or null | No | Per-request cache controls such as ttl, no-cache or use-cache |
provider | object or null | No | Provider preferences for this request, such as sort, only or ignore |
max_tool_calls | integer or null | No | Most server tool calls the gateway runs for this request |
structured_output_repair | enum: "off", "repair", "retry", "repair_and_retry" or null | No | Repair or re-ask when a JSON reply fails its schema |
structured_output_max_retries | integer or null | No | Most re-asks when structured_output_repair retries |
Example request:
curl -X POST "http://localhost:4000/chat/completions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "What is a model group?"
}
],
"max_tokens": 256
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The completion in the OpenAI chat completion shape, or a stream of chat.completion.chunk events. | 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 structured output repair is on and the reply still did not match the requested JSON after the allowed retries (StructuredOutputRepairError). | 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 |
created | integer | Yes | Created |
model | string or null | No | Model |
object | string | Yes | Object |
system_fingerprint | string or null | No | System Fingerprint |
choices | array of object | Yes | Choices |
POST /v1/chat/completions
Create a chat completion
Send a conversation to a model and get its reply, in the OpenAI chat completions format, so any OpenAI client works unchanged. Name a model group from GET /v1/models as model. Set stream: true to receive the reply as server-sent chunks. Provider specific fields pass through to the provider. Any virtual key that may use the named model can call it. The gateway checks the key's budget, rate limits and guardrails first, sends the request to one of the model group's deployments with retries and fallbacks, and records the cost and usage in the spend logs. Nothing else changes.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-spanway-routing-skips | header | enum: "true" | No | Send true to get the candidates the router skipped in the answer headers. See https://docs.spanway.ai/docs/proxy/routing_headers |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
context_fit | boolean or "middle_out" or object or null | No | How to fit a prompt that is longer than the context window |
transforms | array of string | No | Another way to ask for context fit: ["middle-out"] turns it on and [] turns it off |
model | string | Yes | Model |
messages | array of ChatCompletionUserMessage or ChatCompletionAssistantMessage or ChatCompletionToolMessage or ChatCompletionSystemMessage or ChatCompletionFunctionMessage or ChatCompletionDeveloperMessage | Yes | Messages |
frequency_penalty | number or null | No | Frequency Penalty |
logit_bias | object or null | No | Logit Bias |
logprobs | boolean or null | No | Logprobs |
top_logprobs | integer or null | No | Top Logprobs |
max_tokens | integer or null | No | Max Tokens |
n | integer or null | No | N |
presence_penalty | number or null | No | Presence Penalty |
response_format | object or null | No | Response Format |
seed | integer or null | No | Seed |
service_tier | string or null | No | Service Tier |
stop | string or array of string or null | No | Stop |
stream_options | object or null | No | Stream Options |
temperature | number or null | No | Temperature |
top_p | number or null | No | Top P |
tools | array of object or null | No | Tools |
tool_choice | string or object or null | No | Tool Choice |
parallel_tool_calls | boolean or null | No | Parallel Tool Calls |
function_call | string or object or null | No | Function Call |
functions | array of object or null | No | Functions |
user | string or null | No | User |
stream | boolean or null | No | Stream |
metadata | object or null | No | Metadata |
guardrails | array of string or null | No | Guardrails |
caching | boolean or null | No | Caching |
num_retries | integer or null | No | Num Retries |
context_window_fallback_dict | object or null | No | Context Window Fallback Dict |
fallbacks | array of string or null | No | Fallbacks |
prompt_id | string or null | No | Stored prompt to render into the messages, by id |
prompt_variables | object or null | No | Values for the stored prompt's variables |
prompt_version | integer or null | No | Version of the stored prompt to use. Leave out for the latest |
prompt_environment | string or null | No | Environment label of the stored prompt to use, such as production |
vector_store_ids | array of string or null | No | Vector stores to search and add to the context before the model call |
thinking | object or null | No | Extended thinking for models that support it, e.g. {"type": "enabled"} |
top_k | integer or null | No | Sample only from the top k tokens, for providers that support it |
cache | object or null | No | Per-request cache controls such as ttl, no-cache or use-cache |
provider | object or null | No | Provider preferences for this request, such as sort, only or ignore |
max_tool_calls | integer or null | No | Most server tool calls the gateway runs for this request |
structured_output_repair | enum: "off", "repair", "retry", "repair_and_retry" or null | No | Repair or re-ask when a JSON reply fails its schema |
structured_output_max_retries | integer or null | No | Most re-asks when structured_output_repair retries |
Example request:
curl -X POST "http://localhost:4000/v1/chat/completions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "What is a model group?"
}
],
"max_tokens": 256
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The completion in the OpenAI chat completion shape, or a stream of chat.completion.chunk events. | 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 structured output repair is on and the reply still did not match the requested JSON after the allowed retries (StructuredOutputRepairError). | 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 |
created | integer | Yes | Created |
model | string or null | No | Model |
object | string | Yes | Object |
system_fingerprint | string or null | No | System Fingerprint |
choices | array of object | Yes | Choices |
POST /openai/deployments/{model}/chat/completions
Create a chat completion
Send a conversation to a model and get its reply, in the OpenAI chat completions format, so any OpenAI client works unchanged. Name a model group from GET /v1/models as model. Set stream: true to receive the reply as server-sent chunks. Provider specific fields pass through to the provider. Any virtual key that may use the named model can call it. The gateway checks the key's budget, rate limits and guardrails first, sends the request to one of the model group's deployments with retries and fallbacks, and records the cost and usage in the spend logs. Nothing else changes.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
model | path | string or null | Yes | |
x-spanway-routing-skips | header | enum: "true" | No | Send true to get the candidates the router skipped in the answer headers. See https://docs.spanway.ai/docs/proxy/routing_headers |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
context_fit | boolean or "middle_out" or object or null | No | How to fit a prompt that is longer than the context window |
transforms | array of string | No | Another way to ask for context fit: ["middle-out"] turns it on and [] turns it off |
model | string | Yes | Model |
messages | array of ChatCompletionUserMessage or ChatCompletionAssistantMessage or ChatCompletionToolMessage or ChatCompletionSystemMessage or ChatCompletionFunctionMessage or ChatCompletionDeveloperMessage | Yes | Messages |
frequency_penalty | number or null | No | Frequency Penalty |
logit_bias | object or null | No | Logit Bias |
logprobs | boolean or null | No | Logprobs |
top_logprobs | integer or null | No | Top Logprobs |
max_tokens | integer or null | No | Max Tokens |
n | integer or null | No | N |
presence_penalty | number or null | No | Presence Penalty |
response_format | object or null | No | Response Format |
seed | integer or null | No | Seed |
service_tier | string or null | No | Service Tier |
stop | string or array of string or null | No | Stop |
stream_options | object or null | No | Stream Options |
temperature | number or null | No | Temperature |
top_p | number or null | No | Top P |
tools | array of object or null | No | Tools |
tool_choice | string or object or null | No | Tool Choice |
parallel_tool_calls | boolean or null | No | Parallel Tool Calls |
function_call | string or object or null | No | Function Call |
functions | array of object or null | No | Functions |
user | string or null | No | User |
stream | boolean or null | No | Stream |
metadata | object or null | No | Metadata |
guardrails | array of string or null | No | Guardrails |
caching | boolean or null | No | Caching |
num_retries | integer or null | No | Num Retries |
context_window_fallback_dict | object or null | No | Context Window Fallback Dict |
fallbacks | array of string or null | No | Fallbacks |
prompt_id | string or null | No | Stored prompt to render into the messages, by id |
prompt_variables | object or null | No | Values for the stored prompt's variables |
prompt_version | integer or null | No | Version of the stored prompt to use. Leave out for the latest |
prompt_environment | string or null | No | Environment label of the stored prompt to use, such as production |
vector_store_ids | array of string or null | No | Vector stores to search and add to the context before the model call |
thinking | object or null | No | Extended thinking for models that support it, e.g. {"type": "enabled"} |
top_k | integer or null | No | Sample only from the top k tokens, for providers that support it |
cache | object or null | No | Per-request cache controls such as ttl, no-cache or use-cache |
provider | object or null | No | Provider preferences for this request, such as sort, only or ignore |
max_tool_calls | integer or null | No | Most server tool calls the gateway runs for this request |
structured_output_repair | enum: "off", "repair", "retry", "repair_and_retry" or null | No | Repair or re-ask when a JSON reply fails its schema |
structured_output_max_retries | integer or null | No | Most re-asks when structured_output_repair retries |
Example request:
curl -X POST "http://localhost:4000/openai/deployments/model-123/chat/completions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "What is a model group?"
}
],
"max_tokens": 256
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The completion in the OpenAI chat completion shape, or a stream of chat.completion.chunk events. | 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 structured output repair is on and the reply still did not match the requested JSON after the allowed retries (StructuredOutputRepairError). | 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 |
created | integer | Yes | Created |
model | string or null | No | Model |
object | string | Yes | Object |
system_fingerprint | string or null | No | System Fingerprint |
choices | array of object | Yes | Choices |
POST /engines/{model}/chat/completions
Create a chat completion
Send a conversation to a model and get its reply, in the OpenAI chat completions format, so any OpenAI client works unchanged. Name a model group from GET /v1/models as model. Set stream: true to receive the reply as server-sent chunks. Provider specific fields pass through to the provider. Any virtual key that may use the named model can call it. The gateway checks the key's budget, rate limits and guardrails first, sends the request to one of the model group's deployments with retries and fallbacks, and records the cost and usage in the spend logs. Nothing else changes.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
model | path | string or null | Yes | |
x-spanway-routing-skips | header | enum: "true" | No | Send true to get the candidates the router skipped in the answer headers. See https://docs.spanway.ai/docs/proxy/routing_headers |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
context_fit | boolean or "middle_out" or object or null | No | How to fit a prompt that is longer than the context window |
transforms | array of string | No | Another way to ask for context fit: ["middle-out"] turns it on and [] turns it off |
model | string | Yes | Model |
messages | array of ChatCompletionUserMessage or ChatCompletionAssistantMessage or ChatCompletionToolMessage or ChatCompletionSystemMessage or ChatCompletionFunctionMessage or ChatCompletionDeveloperMessage | Yes | Messages |
frequency_penalty | number or null | No | Frequency Penalty |
logit_bias | object or null | No | Logit Bias |
logprobs | boolean or null | No | Logprobs |
top_logprobs | integer or null | No | Top Logprobs |
max_tokens | integer or null | No | Max Tokens |
n | integer or null | No | N |
presence_penalty | number or null | No | Presence Penalty |
response_format | object or null | No | Response Format |
seed | integer or null | No | Seed |
service_tier | string or null | No | Service Tier |
stop | string or array of string or null | No | Stop |
stream_options | object or null | No | Stream Options |
temperature | number or null | No | Temperature |
top_p | number or null | No | Top P |
tools | array of object or null | No | Tools |
tool_choice | string or object or null | No | Tool Choice |
parallel_tool_calls | boolean or null | No | Parallel Tool Calls |
function_call | string or object or null | No | Function Call |
functions | array of object or null | No | Functions |
user | string or null | No | User |
stream | boolean or null | No | Stream |
metadata | object or null | No | Metadata |
guardrails | array of string or null | No | Guardrails |
caching | boolean or null | No | Caching |
num_retries | integer or null | No | Num Retries |
context_window_fallback_dict | object or null | No | Context Window Fallback Dict |
fallbacks | array of string or null | No | Fallbacks |
prompt_id | string or null | No | Stored prompt to render into the messages, by id |
prompt_variables | object or null | No | Values for the stored prompt's variables |
prompt_version | integer or null | No | Version of the stored prompt to use. Leave out for the latest |
prompt_environment | string or null | No | Environment label of the stored prompt to use, such as production |
vector_store_ids | array of string or null | No | Vector stores to search and add to the context before the model call |
thinking | object or null | No | Extended thinking for models that support it, e.g. {"type": "enabled"} |
top_k | integer or null | No | Sample only from the top k tokens, for providers that support it |
cache | object or null | No | Per-request cache controls such as ttl, no-cache or use-cache |
provider | object or null | No | Provider preferences for this request, such as sort, only or ignore |
max_tool_calls | integer or null | No | Most server tool calls the gateway runs for this request |
structured_output_repair | enum: "off", "repair", "retry", "repair_and_retry" or null | No | Repair or re-ask when a JSON reply fails its schema |
structured_output_max_retries | integer or null | No | Most re-asks when structured_output_repair retries |
Example request:
curl -X POST "http://localhost:4000/engines/model-123/chat/completions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "What is a model group?"
}
],
"max_tokens": 256
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The completion in the OpenAI chat completion shape, or a stream of chat.completion.chunk events. | 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 structured output repair is on and the reply still did not match the requested JSON after the allowed retries (StructuredOutputRepairError). | 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 |
created | integer | Yes | Created |
model | string or null | No | Model |
object | string | Yes | Object |
system_fingerprint | string or null | No | System Fingerprint |
choices | array of object | Yes | Choices |