Skip to main content

Llm passthrough API

This page documents the 121 gateway endpoints tagged llm_passthrough in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/anthropic/{endpoint}Forward a native Anthropic request
POST/anthropic/{endpoint}Forward a native Anthropic request
PUT/anthropic/{endpoint}Forward a native Anthropic request
PATCH/anthropic/{endpoint}Forward a native Anthropic request
DELETE/anthropic/{endpoint}Forward a native Anthropic request
GET/assemblyai/{endpoint}Forward a native AssemblyAI request
POST/assemblyai/{endpoint}Forward a native AssemblyAI request
PUT/assemblyai/{endpoint}Forward a native AssemblyAI request
PATCH/assemblyai/{endpoint}Forward a native AssemblyAI request
DELETE/assemblyai/{endpoint}Forward a native AssemblyAI request
GET/azure/{endpoint}Forward a native Azure request
POST/azure/{endpoint}Forward a native Azure request
PUT/azure/{endpoint}Forward a native Azure request
PATCH/azure/{endpoint}Forward a native Azure request
DELETE/azure/{endpoint}Forward a native Azure request
GET/azure_ai/{endpoint}Forward a native Azure request
POST/azure_ai/{endpoint}Forward a native Azure request
PUT/azure_ai/{endpoint}Forward a native Azure request
PATCH/azure_ai/{endpoint}Forward a native Azure request
DELETE/azure_ai/{endpoint}Forward a native Azure request
GET/azure_speech/{endpoint}Forward a native Azure AI Speech request
POST/azure_speech/{endpoint}Forward a native Azure AI Speech request
PUT/azure_speech/{endpoint}Forward a native Azure AI Speech request
PATCH/azure_speech/{endpoint}Forward a native Azure AI Speech request
DELETE/azure_speech/{endpoint}Forward a native Azure AI Speech request
GET/bedrock/{endpoint}Forward a native Bedrock request
POST/bedrock/{endpoint}Forward a native Bedrock request
PUT/bedrock/{endpoint}Forward a native Bedrock request
PATCH/bedrock/{endpoint}Forward a native Bedrock request
DELETE/bedrock/{endpoint}Forward a native Bedrock request
POST/bespoke/v1/systemoneForward a System One request to a Bespoke Nimble server
GET/cohere/{endpoint}Forward a native Cohere request
POST/cohere/{endpoint}Forward a native Cohere request
PUT/cohere/{endpoint}Forward a native Cohere request
PATCH/cohere/{endpoint}Forward a native Cohere request
DELETE/cohere/{endpoint}Forward a native Cohere request
POST/comprehendmedicalCall an Amazon Comprehend Medical operation
POST/comprehendmedical/{operation}Call an Amazon Comprehend Medical operation
GET/cursor/{endpoint}Forward a native Cursor Cloud Agents request
POST/cursor/{endpoint}Forward a native Cursor Cloud Agents request
PUT/cursor/{endpoint}Forward a native Cursor Cloud Agents request
PATCH/cursor/{endpoint}Forward a native Cursor Cloud Agents request
DELETE/cursor/{endpoint}Forward a native Cursor Cloud Agents request
GET/eu.assemblyai/{endpoint}Forward a native AssemblyAI request
POST/eu.assemblyai/{endpoint}Forward a native AssemblyAI request
PUT/eu.assemblyai/{endpoint}Forward a native AssemblyAI request
PATCH/eu.assemblyai/{endpoint}Forward a native AssemblyAI request
DELETE/eu.assemblyai/{endpoint}Forward a native AssemblyAI request
GET/fal_ai/{endpoint}Submit a priced Fal queue request
POST/fal_ai/{endpoint}Submit a priced Fal queue request
PUT/fal_ai/{endpoint}Submit a priced Fal queue request
PATCH/fal_ai/{endpoint}Submit a priced Fal queue request
DELETE/fal_ai/{endpoint}Submit a priced Fal queue request
GET/gemini/{endpoint}Forward a native Gemini API request
POST/gemini/{endpoint}Forward a native Gemini API request
PUT/gemini/{endpoint}Forward a native Gemini API request
PATCH/gemini/{endpoint}Forward a native Gemini API request
DELETE/gemini/{endpoint}Forward a native Gemini API request
GET/gigachat/{endpoint}Forward a native GigaChat request
POST/gigachat/{endpoint}Forward a native GigaChat request
PUT/gigachat/{endpoint}Forward a native GigaChat request
PATCH/gigachat/{endpoint}Forward a native GigaChat request
DELETE/gigachat/{endpoint}Forward a native GigaChat request
POST/laya/v1/systemoneForward a System One request to a Laya server
GET/milvus/{endpoint}Search a managed Milvus collection
POST/milvus/{endpoint}Search a managed Milvus collection
PUT/milvus/{endpoint}Search a managed Milvus collection
PATCH/milvus/{endpoint}Search a managed Milvus collection
DELETE/milvus/{endpoint}Search a managed Milvus collection
GET/mistral/{endpoint}Forward a native Mistral request
POST/mistral/{endpoint}Forward a native Mistral request
PUT/mistral/{endpoint}Forward a native Mistral request
PATCH/mistral/{endpoint}Forward a native Mistral request
DELETE/mistral/{endpoint}Forward a native Mistral request
GET/nvidia_nim/{endpoint}Relay a native NVIDIA NIM request through a model group
POST/nvidia_nim/{endpoint}Relay a native NVIDIA NIM request through a model group
PUT/nvidia_nim/{endpoint}Relay a native NVIDIA NIM request through a model group
PATCH/nvidia_nim/{endpoint}Relay a native NVIDIA NIM request through a model group
DELETE/nvidia_nim/{endpoint}Relay a native NVIDIA NIM request through a model group
POST/openai/v1/realtime/callsStart a WebRTC realtime call
POST/openai/v1/realtime/client_secretsCreate an ephemeral realtime client secret
POST/openai/v1/realtime/transcription_sessionsCreate a realtime transcription session
GET/openai/{endpoint}Forward a native OpenAI request
POST/openai/{endpoint}Forward a native OpenAI request
PUT/openai/{endpoint}Forward a native OpenAI request
PATCH/openai/{endpoint}Forward a native OpenAI request
DELETE/openai/{endpoint}Forward a native OpenAI request
GET/openrouter/{endpoint}Forward a native OpenRouter request
POST/openrouter/{endpoint}Forward a native OpenRouter request
PUT/openrouter/{endpoint}Forward a native OpenRouter request
PATCH/openrouter/{endpoint}Forward a native OpenRouter request
DELETE/openrouter/{endpoint}Forward a native OpenRouter request
GET/tinyfish/{endpoint}Run a TinyFish web agent task
POST/tinyfish/{endpoint}Run a TinyFish web agent task
POST/transcribeCall an Amazon Transcribe operation
POST/transcribe/{operation}Call an Amazon Transcribe operation
GET/typesafe/{endpoint}Forward a native Typesafe request
POST/typesafe/{endpoint}Forward a native Typesafe request
PUT/typesafe/{endpoint}Forward a native Typesafe request
PATCH/typesafe/{endpoint}Forward a native Typesafe request
DELETE/typesafe/{endpoint}Forward a native Typesafe request
GET/vertex_ai/discovery/{endpoint}Forward a Vertex AI Search request
POST/vertex_ai/discovery/{endpoint}Forward a Vertex AI Search request
PUT/vertex_ai/discovery/{endpoint}Forward a Vertex AI Search request
PATCH/vertex_ai/discovery/{endpoint}Forward a Vertex AI Search request
DELETE/vertex_ai/discovery/{endpoint}Forward a Vertex AI Search request
GET/vertex_ai/{endpoint}Forward a native Vertex AI request
POST/vertex_ai/{endpoint}Forward a native Vertex AI request
PUT/vertex_ai/{endpoint}Forward a native Vertex AI request
PATCH/vertex_ai/{endpoint}Forward a native Vertex AI request
DELETE/vertex_ai/{endpoint}Forward a native Vertex AI request
GET/vllm/{endpoint}Forward a request to a self-hosted vLLM server
POST/vllm/{endpoint}Forward a request to a self-hosted vLLM server
PUT/vllm/{endpoint}Forward a request to a self-hosted vLLM server
PATCH/vllm/{endpoint}Forward a request to a self-hosted vLLM server
DELETE/vllm/{endpoint}Forward a request to a self-hosted vLLM server
GET/watsonx/{endpoint}Forward a native watsonx.ai request
POST/watsonx/{endpoint}Forward a native watsonx.ai request
PUT/watsonx/{endpoint}Forward a native watsonx.ai request
PATCH/watsonx/{endpoint}Forward a native watsonx.ai request
DELETE/watsonx/{endpoint}Forward a native watsonx.ai request

Endpoints​

GET /anthropic/{endpoint}​

Forward a native Anthropic request

Send any Anthropic API path, such as /v1/messages, /v1/messages/count_tokens or /v1/messages/batches, exactly as Anthropic defines it. Put the virtual key in the x-api-key header, where the Anthropic SDK puts its own key. When the model names a deployment from model_list the gateway routes through that deployment with its retries and fallbacks. Skills sent to /v1/skills or /v1/skills/{skill_id}/versions are checked by skill scanning before they are forwarded, and any other change to skills here answers 400 skill_scan_unsupported. Deleting a skill with DELETE /v1/skills/{skill_id} also deletes its scan results once the provider confirms it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Example request:

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

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /anthropic/{endpoint}​

Forward a native Anthropic request

Send any Anthropic API path, such as /v1/messages, /v1/messages/count_tokens or /v1/messages/batches, exactly as Anthropic defines it. Put the virtual key in the x-api-key header, where the Anthropic SDK puts its own key. When the model names a deployment from model_list the gateway routes through that deployment with its retries and fallbacks. Skills sent to /v1/skills or /v1/skills/{skill_id}/versions are checked by skill scanning before they are forwarded, and any other change to skills here answers 400 skill_scan_unsupported. Deleting a skill with DELETE /v1/skills/{skill_id} also deletes its scan results once the provider confirms it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/anthropic/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_tokens": 256,
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "claude-sonnet-5-5"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /anthropic/{endpoint}​

Forward a native Anthropic request

Send any Anthropic API path, such as /v1/messages, /v1/messages/count_tokens or /v1/messages/batches, exactly as Anthropic defines it. Put the virtual key in the x-api-key header, where the Anthropic SDK puts its own key. When the model names a deployment from model_list the gateway routes through that deployment with its retries and fallbacks. Skills sent to /v1/skills or /v1/skills/{skill_id}/versions are checked by skill scanning before they are forwarded, and any other change to skills here answers 400 skill_scan_unsupported. Deleting a skill with DELETE /v1/skills/{skill_id} also deletes its scan results once the provider confirms it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/anthropic/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_tokens": 256,
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "claude-sonnet-5-5"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /anthropic/{endpoint}​

Forward a native Anthropic request

Send any Anthropic API path, such as /v1/messages, /v1/messages/count_tokens or /v1/messages/batches, exactly as Anthropic defines it. Put the virtual key in the x-api-key header, where the Anthropic SDK puts its own key. When the model names a deployment from model_list the gateway routes through that deployment with its retries and fallbacks. Skills sent to /v1/skills or /v1/skills/{skill_id}/versions are checked by skill scanning before they are forwarded, and any other change to skills here answers 400 skill_scan_unsupported. Deleting a skill with DELETE /v1/skills/{skill_id} also deletes its scan results once the provider confirms it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/anthropic/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_tokens": 256,
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "claude-sonnet-5-5"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /anthropic/{endpoint}​

Forward a native Anthropic request

Send any Anthropic API path, such as /v1/messages, /v1/messages/count_tokens or /v1/messages/batches, exactly as Anthropic defines it. Put the virtual key in the x-api-key header, where the Anthropic SDK puts its own key. When the model names a deployment from model_list the gateway routes through that deployment with its retries and fallbacks. Skills sent to /v1/skills or /v1/skills/{skill_id}/versions are checked by skill scanning before they are forwarded, and any other change to skills here answers 400 skill_scan_unsupported. Deleting a skill with DELETE /v1/skills/{skill_id} also deletes its scan results once the provider confirms it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/anthropic/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /azure/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/azure/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

POST /azure/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/azure/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PUT /azure/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/azure/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PATCH /azure/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/azure/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

DELETE /azure/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/azure/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

GET /azure_ai/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/azure_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

POST /azure_ai/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/azure_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PUT /azure_ai/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/azure_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PATCH /azure_ai/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/azure_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

DELETE /azure_ai/{endpoint}​

Forward a native Azure request

Send any Azure OpenAI or Azure AI path, such as /openai/deployments/{deployment}/chat/completions?api-version=2024-10-21. When the deployment names a model_list entry the gateway routes through it, otherwise it forwards to AZURE_API_BASE with the gateway's Azure key. Creating an Azure AI Search index needs a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/azure_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

GET /azure_speech/{endpoint}​

Forward a native Azure AI Speech request

Send a short-audio path under /speech/ with the audio as the body, the fast transcription path /speechtotext/transcriptions:transcribe as multipart form data, or a batch transcription path under /speechtotext/. Batch transcription paths create shared resources and need a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/azure_speech/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contentUrls": [
"https://files.example.com/standup.wav"
],
"displayName": "standup-2026-11-21",
"locale": "en-US"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is outside the supported prefixes, or no Azure Speech region, endpoint or key is set.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403A key that is not a proxy admin called a batch transcription path.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /azure_speech/{endpoint}​

Forward a native Azure AI Speech request

Send a short-audio path under /speech/ with the audio as the body, the fast transcription path /speechtotext/transcriptions:transcribe as multipart form data, or a batch transcription path under /speechtotext/. Batch transcription paths create shared resources and need a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/azure_speech/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contentUrls": [
"https://files.example.com/standup.wav"
],
"displayName": "standup-2026-11-21",
"locale": "en-US"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is outside the supported prefixes, or no Azure Speech region, endpoint or key is set.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403A key that is not a proxy admin called a batch transcription path.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /azure_speech/{endpoint}​

Forward a native Azure AI Speech request

Send a short-audio path under /speech/ with the audio as the body, the fast transcription path /speechtotext/transcriptions:transcribe as multipart form data, or a batch transcription path under /speechtotext/. Batch transcription paths create shared resources and need a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/azure_speech/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contentUrls": [
"https://files.example.com/standup.wav"
],
"displayName": "standup-2026-11-21",
"locale": "en-US"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is outside the supported prefixes, or no Azure Speech region, endpoint or key is set.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403A key that is not a proxy admin called a batch transcription path.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /azure_speech/{endpoint}​

Forward a native Azure AI Speech request

Send a short-audio path under /speech/ with the audio as the body, the fast transcription path /speechtotext/transcriptions:transcribe as multipart form data, or a batch transcription path under /speechtotext/. Batch transcription paths create shared resources and need a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/azure_speech/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contentUrls": [
"https://files.example.com/standup.wav"
],
"displayName": "standup-2026-11-21",
"locale": "en-US"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is outside the supported prefixes, or no Azure Speech region, endpoint or key is set.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403A key that is not a proxy admin called a batch transcription path.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /azure_speech/{endpoint}​

Forward a native Azure AI Speech request

Send a short-audio path under /speech/ with the audio as the body, the fast transcription path /speechtotext/transcriptions:transcribe as multipart form data, or a batch transcription path under /speechtotext/. Batch transcription paths create shared resources and need a proxy admin key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/azure_speech/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contentUrls": [
"https://files.example.com/standup.wav"
],
"displayName": "standup-2026-11-21",
"locale": "en-US"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is outside the supported prefixes, or no Azure Speech region, endpoint or key is set.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403A key that is not a proxy admin called a batch transcription path.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /bedrock/{endpoint}​

Forward a native Bedrock request

Send a Bedrock runtime path such as /model/{modelId}/converse, /model/{modelId}/invoke or /model/{modelId}/count-tokens, or a Bedrock agent runtime path such as knowledge base retrieval. The gateway signs the request with its own AWS credentials, so callers need no AWS access. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/bedrock/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path carries no model id the gateway can read.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key is not allowed here, or the operator turned off agent runtime pass-through with general_settings.disable_bedrock_agent_runtime_passthrough.application/json ErrorDetail
404AWS does not know the model id, or the model is not enabled in the gateway's region. The body is Bedrock's own ResourceNotFoundException.application/json object
422Validation Errorapplication/json HTTPValidationError
429Bedrock is throttling the gateway's account, in Bedrock's own ThrottlingException shape. A gateway rate limit on the key answers 429 in the OpenAI error shape instead.application/json object

POST /bedrock/{endpoint}​

Forward a native Bedrock request

Send a Bedrock runtime path such as /model/{modelId}/converse, /model/{modelId}/invoke or /model/{modelId}/count-tokens, or a Bedrock agent runtime path such as knowledge base retrieval. The gateway signs the request with its own AWS credentials, so callers need no AWS access. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/bedrock/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path carries no model id the gateway can read.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key is not allowed here, or the operator turned off agent runtime pass-through with general_settings.disable_bedrock_agent_runtime_passthrough.application/json ErrorDetail
404AWS does not know the model id, or the model is not enabled in the gateway's region. The body is Bedrock's own ResourceNotFoundException.application/json object
422Validation Errorapplication/json HTTPValidationError
429Bedrock is throttling the gateway's account, in Bedrock's own ThrottlingException shape. A gateway rate limit on the key answers 429 in the OpenAI error shape instead.application/json object

PUT /bedrock/{endpoint}​

Forward a native Bedrock request

Send a Bedrock runtime path such as /model/{modelId}/converse, /model/{modelId}/invoke or /model/{modelId}/count-tokens, or a Bedrock agent runtime path such as knowledge base retrieval. The gateway signs the request with its own AWS credentials, so callers need no AWS access. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/bedrock/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path carries no model id the gateway can read.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key is not allowed here, or the operator turned off agent runtime pass-through with general_settings.disable_bedrock_agent_runtime_passthrough.application/json ErrorDetail
404AWS does not know the model id, or the model is not enabled in the gateway's region. The body is Bedrock's own ResourceNotFoundException.application/json object
422Validation Errorapplication/json HTTPValidationError
429Bedrock is throttling the gateway's account, in Bedrock's own ThrottlingException shape. A gateway rate limit on the key answers 429 in the OpenAI error shape instead.application/json object

PATCH /bedrock/{endpoint}​

Forward a native Bedrock request

Send a Bedrock runtime path such as /model/{modelId}/converse, /model/{modelId}/invoke or /model/{modelId}/count-tokens, or a Bedrock agent runtime path such as knowledge base retrieval. The gateway signs the request with its own AWS credentials, so callers need no AWS access. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/bedrock/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path carries no model id the gateway can read.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key is not allowed here, or the operator turned off agent runtime pass-through with general_settings.disable_bedrock_agent_runtime_passthrough.application/json ErrorDetail
404AWS does not know the model id, or the model is not enabled in the gateway's region. The body is Bedrock's own ResourceNotFoundException.application/json object
422Validation Errorapplication/json HTTPValidationError
429Bedrock is throttling the gateway's account, in Bedrock's own ThrottlingException shape. A gateway rate limit on the key answers 429 in the OpenAI error shape instead.application/json object

DELETE /bedrock/{endpoint}​

Forward a native Bedrock request

Send a Bedrock runtime path such as /model/{modelId}/converse, /model/{modelId}/invoke or /model/{modelId}/count-tokens, or a Bedrock agent runtime path such as knowledge base retrieval. The gateway signs the request with its own AWS credentials, so callers need no AWS access. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/bedrock/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path carries no model id the gateway can read.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key is not allowed here, or the operator turned off agent runtime pass-through with general_settings.disable_bedrock_agent_runtime_passthrough.application/json ErrorDetail
404AWS does not know the model id, or the model is not enabled in the gateway's region. The body is Bedrock's own ResourceNotFoundException.application/json object
422Validation Errorapplication/json HTTPValidationError
429Bedrock is throttling the gateway's account, in Bedrock's own ThrottlingException shape. A gateway rate limit on the key answers 429 in the OpenAI error shape instead.application/json object

POST /bespoke/v1/systemone​

Forward a System One request to a Bespoke Nimble server

Send a native System One decisions request to the Bespoke Nimble server named by BESPOKE_API_BASE. The model must be nimble-latest, nimble or bespokelabs/Bespoke-Nimble-9B, and streaming is not supported. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/bespoke/v1/systemone" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nimble-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model is not one Bespoke Nimble serves, or the body asks for streaming or a custom_body.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
503BESPOKE_API_BASE is missing or is not a plain HTTP or HTTPS server URL.application/json ErrorDetail

GET /cohere/{endpoint}​

Forward a native Cohere request

Send any Cohere API path, such as /v2/chat, /v2/embed or /v2/rerank, exactly as Cohere defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/cohere/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"Refunds are issued within five business days.",
"Our office is closed on Mondays."
],
"model": "rerank-v4.0-pro",
"query": "refund for a duplicate charge",
"top_n": 1
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /cohere/{endpoint}​

Forward a native Cohere request

Send any Cohere API path, such as /v2/chat, /v2/embed or /v2/rerank, exactly as Cohere defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/cohere/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"Refunds are issued within five business days.",
"Our office is closed on Mondays."
],
"model": "rerank-v4.0-pro",
"query": "refund for a duplicate charge",
"top_n": 1
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /cohere/{endpoint}​

Forward a native Cohere request

Send any Cohere API path, such as /v2/chat, /v2/embed or /v2/rerank, exactly as Cohere defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/cohere/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"Refunds are issued within five business days.",
"Our office is closed on Mondays."
],
"model": "rerank-v4.0-pro",
"query": "refund for a duplicate charge",
"top_n": 1
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /cohere/{endpoint}​

Forward a native Cohere request

Send any Cohere API path, such as /v2/chat, /v2/embed or /v2/rerank, exactly as Cohere defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/cohere/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"Refunds are issued within five business days.",
"Our office is closed on Mondays."
],
"model": "rerank-v4.0-pro",
"query": "refund for a duplicate charge",
"top_n": 1
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /cohere/{endpoint}​

Forward a native Cohere request

Send any Cohere API path, such as /v2/chat, /v2/embed or /v2/rerank, exactly as Cohere defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/cohere/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"Refunds are issued within five business days.",
"Our office is closed on Mondays."
],
"model": "rerank-v4.0-pro",
"query": "refund for a duplicate charge",
"top_n": 1
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /comprehendmedical​

Call an Amazon Comprehend Medical operation

Send the operation name in the path, such as /comprehendmedical/DetectEntitiesV2, or send an AWS SDK request to /comprehendmedical with the X-Amz-Target header. The gateway signs the request with its own AWS credentials in AWS_REGION_NAME. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/comprehendmedical" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Text": "Patient takes 20mg lisinopril daily for hypertension."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400No AWS region is set, the body is not a JSON object, or the operation is not one the gateway prices.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail

POST /comprehendmedical/{operation}​

Call an Amazon Comprehend Medical operation

Send the operation name in the path, such as /comprehendmedical/DetectEntitiesV2, or send an AWS SDK request to /comprehendmedical with the X-Amz-Target header. The gateway signs the request with its own AWS credentials in AWS_REGION_NAME. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
operationpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/comprehendmedical/operation-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Text": "Patient takes 20mg lisinopril daily for hypertension."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400No AWS region is set, the body is not a JSON object, or the operation is not one the gateway prices.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /cursor/{endpoint}​

Forward a native Cursor Cloud Agents request

Send any Cursor Cloud Agents API path, such as POST /v0/agents to launch an agent or GET /v0/agents/{id} for its status. The gateway signs in with the Cursor credential from a deployment, the LLM Credentials tab or CURSOR_API_KEY. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/cursor/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": {
"text": "Add unit tests for the refund calculator."
},
"source": {
"ref": "main",
"repository": "https://git.example.com/example/billing"
}
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /cursor/{endpoint}​

Forward a native Cursor Cloud Agents request

Send any Cursor Cloud Agents API path, such as POST /v0/agents to launch an agent or GET /v0/agents/{id} for its status. The gateway signs in with the Cursor credential from a deployment, the LLM Credentials tab or CURSOR_API_KEY. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/cursor/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": {
"text": "Add unit tests for the refund calculator."
},
"source": {
"ref": "main",
"repository": "https://git.example.com/example/billing"
}
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /cursor/{endpoint}​

Forward a native Cursor Cloud Agents request

Send any Cursor Cloud Agents API path, such as POST /v0/agents to launch an agent or GET /v0/agents/{id} for its status. The gateway signs in with the Cursor credential from a deployment, the LLM Credentials tab or CURSOR_API_KEY. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/cursor/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": {
"text": "Add unit tests for the refund calculator."
},
"source": {
"ref": "main",
"repository": "https://git.example.com/example/billing"
}
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /cursor/{endpoint}​

Forward a native Cursor Cloud Agents request

Send any Cursor Cloud Agents API path, such as POST /v0/agents to launch an agent or GET /v0/agents/{id} for its status. The gateway signs in with the Cursor credential from a deployment, the LLM Credentials tab or CURSOR_API_KEY. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/cursor/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": {
"text": "Add unit tests for the refund calculator."
},
"source": {
"ref": "main",
"repository": "https://git.example.com/example/billing"
}
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /cursor/{endpoint}​

Forward a native Cursor Cloud Agents request

Send any Cursor Cloud Agents API path, such as POST /v0/agents to launch an agent or GET /v0/agents/{id} for its status. The gateway signs in with the Cursor credential from a deployment, the LLM Credentials tab or CURSOR_API_KEY. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/cursor/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": {
"text": "Add unit tests for the refund calculator."
},
"source": {
"ref": "main",
"repository": "https://git.example.com/example/billing"
}
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /eu.assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/eu.assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /eu.assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/eu.assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /eu.assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/eu.assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /eu.assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/eu.assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /eu.assemblyai/{endpoint}​

Forward a native AssemblyAI request

Send any AssemblyAI API path, such as /v2/transcript or /v2/upload, exactly as AssemblyAI defines it. /eu.assemblyai forwards to the EU region instead of the default one. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/eu.assemblyai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://files.example.com/standup.mp3",
"speaker_labels": true
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /fal_ai/{endpoint}​

Submit a priced Fal queue request

Submit a Fal queue request such as /fal-ai/flux-pro/v1.1, or poll and fetch its result under /requests/{request_id}. Only models with a price entry can be submitted, so every image is costed. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/fal_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_size": "landscape_4_3",
"num_images": 1,
"prompt": "A lighthouse at dawn, watercolour"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model has no price entry, so the request cannot be costed.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /fal_ai/{endpoint}​

Submit a priced Fal queue request

Submit a Fal queue request such as /fal-ai/flux-pro/v1.1, or poll and fetch its result under /requests/{request_id}. Only models with a price entry can be submitted, so every image is costed. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/fal_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_size": "landscape_4_3",
"num_images": 1,
"prompt": "A lighthouse at dawn, watercolour"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model has no price entry, so the request cannot be costed.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /fal_ai/{endpoint}​

Submit a priced Fal queue request

Submit a Fal queue request such as /fal-ai/flux-pro/v1.1, or poll and fetch its result under /requests/{request_id}. Only models with a price entry can be submitted, so every image is costed. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/fal_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_size": "landscape_4_3",
"num_images": 1,
"prompt": "A lighthouse at dawn, watercolour"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model has no price entry, so the request cannot be costed.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /fal_ai/{endpoint}​

Submit a priced Fal queue request

Submit a Fal queue request such as /fal-ai/flux-pro/v1.1, or poll and fetch its result under /requests/{request_id}. Only models with a price entry can be submitted, so every image is costed. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/fal_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_size": "landscape_4_3",
"num_images": 1,
"prompt": "A lighthouse at dawn, watercolour"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model has no price entry, so the request cannot be costed.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /fal_ai/{endpoint}​

Submit a priced Fal queue request

Submit a Fal queue request such as /fal-ai/flux-pro/v1.1, or poll and fetch its result under /requests/{request_id}. Only models with a price entry can be submitted, so every image is costed. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/fal_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_size": "landscape_4_3",
"num_images": 1,
"prompt": "A lighthouse at dawn, watercolour"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model has no price entry, so the request cannot be costed.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /gemini/{endpoint}​

Forward a native Gemini API request

Send any Google AI Studio path, such as /v1beta/models/{model}:generateContent or :countTokens, exactly as the Gemini API defines it. The virtual key travels in the key query parameter or the x-goog-api-key header, where the Google SDKs put their own key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/gemini/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

POST /gemini/{endpoint}​

Forward a native Gemini API request

Send any Google AI Studio path, such as /v1beta/models/{model}:generateContent or :countTokens, exactly as the Gemini API defines it. The virtual key travels in the key query parameter or the x-goog-api-key header, where the Google SDKs put their own key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/gemini/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PUT /gemini/{endpoint}​

Forward a native Gemini API request

Send any Google AI Studio path, such as /v1beta/models/{model}:generateContent or :countTokens, exactly as the Gemini API defines it. The virtual key travels in the key query parameter or the x-goog-api-key header, where the Google SDKs put their own key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/gemini/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PATCH /gemini/{endpoint}​

Forward a native Gemini API request

Send any Google AI Studio path, such as /v1beta/models/{model}:generateContent or :countTokens, exactly as the Gemini API defines it. The virtual key travels in the key query parameter or the x-goog-api-key header, where the Google SDKs put their own key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/gemini/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

DELETE /gemini/{endpoint}​

Forward a native Gemini API request

Send any Google AI Studio path, such as /v1beta/models/{model}:generateContent or :countTokens, exactly as the Gemini API defines it. The virtual key travels in the key query parameter or the x-goog-api-key header, where the Google SDKs put their own key. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/gemini/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

GET /gigachat/{endpoint}​

Forward a native GigaChat request

Send any GigaChat API path, such as /chat/completions or /embeddings. The body must carry a model. When it names a deployment from model_list the gateway routes through that deployment, otherwise it calls GIGACHAT_API_BASE with the gateway's GigaChat credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/gigachat/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "GigaChat-2-Max"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body carries no model.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /gigachat/{endpoint}​

Forward a native GigaChat request

Send any GigaChat API path, such as /chat/completions or /embeddings. The body must carry a model. When it names a deployment from model_list the gateway routes through that deployment, otherwise it calls GIGACHAT_API_BASE with the gateway's GigaChat credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/gigachat/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "GigaChat-2-Max"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body carries no model.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /gigachat/{endpoint}​

Forward a native GigaChat request

Send any GigaChat API path, such as /chat/completions or /embeddings. The body must carry a model. When it names a deployment from model_list the gateway routes through that deployment, otherwise it calls GIGACHAT_API_BASE with the gateway's GigaChat credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/gigachat/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "GigaChat-2-Max"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body carries no model.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /gigachat/{endpoint}​

Forward a native GigaChat request

Send any GigaChat API path, such as /chat/completions or /embeddings. The body must carry a model. When it names a deployment from model_list the gateway routes through that deployment, otherwise it calls GIGACHAT_API_BASE with the gateway's GigaChat credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/gigachat/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "GigaChat-2-Max"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body carries no model.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /gigachat/{endpoint}​

Forward a native GigaChat request

Send any GigaChat API path, such as /chat/completions or /embeddings. The body must carry a model. When it names a deployment from model_list the gateway routes through that deployment, otherwise it calls GIGACHAT_API_BASE with the gateway's GigaChat credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/gigachat/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "GigaChat-2-Max"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body carries no model.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /laya/v1/systemone​

Forward a System One request to a Laya server

Send a native System One decisions request to the Laya server named by LAYA_API_BASE. The model must be english, multilingual or typed-decisions, and streaming is not supported. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/laya/v1/systemone" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "english",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The model is not one Laya serves, or the body asks for streaming or a custom_body.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
503LAYA_API_BASE is missing or is not a plain HTTP or HTTPS server URL.application/json ErrorDetail

GET /milvus/{endpoint}​

Search a managed Milvus collection

Send a Milvus vector API path such as /v2/vectordb/entities/search. collectionName must name a vector store index managed by the gateway, which rewrites it to the real collection and signs in with the stored Milvus credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/milvus/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collectionName": "support-kb",
"data": [
[
0.12,
0.98,
0.33
]
],
"limit": 3,
"outputFields": [
"title"
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400collectionName is missing, or it is not a vector store index the gateway manages.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /milvus/{endpoint}​

Search a managed Milvus collection

Send a Milvus vector API path such as /v2/vectordb/entities/search. collectionName must name a vector store index managed by the gateway, which rewrites it to the real collection and signs in with the stored Milvus credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/milvus/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collectionName": "support-kb",
"data": [
[
0.12,
0.98,
0.33
]
],
"limit": 3,
"outputFields": [
"title"
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400collectionName is missing, or it is not a vector store index the gateway manages.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /milvus/{endpoint}​

Search a managed Milvus collection

Send a Milvus vector API path such as /v2/vectordb/entities/search. collectionName must name a vector store index managed by the gateway, which rewrites it to the real collection and signs in with the stored Milvus credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/milvus/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collectionName": "support-kb",
"data": [
[
0.12,
0.98,
0.33
]
],
"limit": 3,
"outputFields": [
"title"
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400collectionName is missing, or it is not a vector store index the gateway manages.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /milvus/{endpoint}​

Search a managed Milvus collection

Send a Milvus vector API path such as /v2/vectordb/entities/search. collectionName must name a vector store index managed by the gateway, which rewrites it to the real collection and signs in with the stored Milvus credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/milvus/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collectionName": "support-kb",
"data": [
[
0.12,
0.98,
0.33
]
],
"limit": 3,
"outputFields": [
"title"
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400collectionName is missing, or it is not a vector store index the gateway manages.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /milvus/{endpoint}​

Search a managed Milvus collection

Send a Milvus vector API path such as /v2/vectordb/entities/search. collectionName must name a vector store index managed by the gateway, which rewrites it to the real collection and signs in with the stored Milvus credentials. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/milvus/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collectionName": "support-kb",
"data": [
[
0.12,
0.98,
0.33
]
],
"limit": 3,
"outputFields": [
"title"
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400collectionName is missing, or it is not a vector store index the gateway manages.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /mistral/{endpoint}​

Forward a native Mistral request

Send any Mistral API path, such as /v1/chat/completions, /v1/ocr or /v1/agents/completions, exactly as Mistral defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/mistral/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "mistral-large-4"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /mistral/{endpoint}​

Forward a native Mistral request

Send any Mistral API path, such as /v1/chat/completions, /v1/ocr or /v1/agents/completions, exactly as Mistral defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/mistral/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "mistral-large-4"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /mistral/{endpoint}​

Forward a native Mistral request

Send any Mistral API path, such as /v1/chat/completions, /v1/ocr or /v1/agents/completions, exactly as Mistral defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/mistral/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "mistral-large-4"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /mistral/{endpoint}​

Forward a native Mistral request

Send any Mistral API path, such as /v1/chat/completions, /v1/ocr or /v1/agents/completions, exactly as Mistral defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/mistral/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "mistral-large-4"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /mistral/{endpoint}​

Forward a native Mistral request

Send any Mistral API path, such as /v1/chat/completions, /v1/ocr or /v1/agents/completions, exactly as Mistral defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/mistral/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "mistral-large-4"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /nvidia_nim/{endpoint}​

Relay a native NVIDIA NIM request through a model group

Send /nvidia_nim/{model_group}/v1/infer, or another NIM path, where model_group is a model_list entry whose deployments all use nvidia_nim/ models. The body goes unchanged to the deployment's api_base, so detection and OCR NIMs whose payload carries no model field still get key checks and spend logging. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/nvidia_nim/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"type": "image_url",
"url": "data:image/png;base64,iVBORw0KGgo..."
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no NVIDIA NIM model group.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /nvidia_nim/{endpoint}​

Relay a native NVIDIA NIM request through a model group

Send /nvidia_nim/{model_group}/v1/infer, or another NIM path, where model_group is a model_list entry whose deployments all use nvidia_nim/ models. The body goes unchanged to the deployment's api_base, so detection and OCR NIMs whose payload carries no model field still get key checks and spend logging. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/nvidia_nim/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"type": "image_url",
"url": "data:image/png;base64,iVBORw0KGgo..."
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no NVIDIA NIM model group.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /nvidia_nim/{endpoint}​

Relay a native NVIDIA NIM request through a model group

Send /nvidia_nim/{model_group}/v1/infer, or another NIM path, where model_group is a model_list entry whose deployments all use nvidia_nim/ models. The body goes unchanged to the deployment's api_base, so detection and OCR NIMs whose payload carries no model field still get key checks and spend logging. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/nvidia_nim/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"type": "image_url",
"url": "data:image/png;base64,iVBORw0KGgo..."
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no NVIDIA NIM model group.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /nvidia_nim/{endpoint}​

Relay a native NVIDIA NIM request through a model group

Send /nvidia_nim/{model_group}/v1/infer, or another NIM path, where model_group is a model_list entry whose deployments all use nvidia_nim/ models. The body goes unchanged to the deployment's api_base, so detection and OCR NIMs whose payload carries no model field still get key checks and spend logging. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/nvidia_nim/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"type": "image_url",
"url": "data:image/png;base64,iVBORw0KGgo..."
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no NVIDIA NIM model group.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /nvidia_nim/{endpoint}​

Relay a native NVIDIA NIM request through a model group

Send /nvidia_nim/{model_group}/v1/infer, or another NIM path, where model_group is a model_list entry whose deployments all use nvidia_nim/ models. The body goes unchanged to the deployment's api_base, so detection and OCR NIMs whose payload carries no model field still get key checks and spend logging. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/nvidia_nim/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"type": "image_url",
"url": "data:image/png;base64,iVBORw0KGgo..."
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no NVIDIA NIM model group.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /openai/v1/realtime/calls​

Start a WebRTC realtime call

Exchange the browser's SDP offer for the provider's SDP answer. The Authorization bearer token is the ephemeral client secret from /v1/realtime/client_secrets, not a virtual key.

This is the second step of a browser voice session: the app sends its WebRTC offer (application/sdp) and gets back the answer that opens the audio connection to the model. The call is billed and logged against the virtual key that created the client secret. An expired or unknown client secret answers 401.

Request body (application/sdp, string):

Example request:

curl -X POST "http://localhost:4000/openai/v1/realtime/calls" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The provider's SDP answer.application/sdp string
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401The client secret is missing, unreadable or expired: Missing or invalid Authorization header, Invalid or expired token, Token has expiredapplication/json object
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

POST /openai/v1/realtime/client_secrets​

Create an ephemeral realtime client secret

Issue a short lived client secret for a browser or mobile client so the long lived virtual key stays on your server. The secret is bound to the model and session settings in the body and expires after the time in expires_after.

Use it when a web page or phone app talks to a voice model directly over WebRTC: your server calls this with its virtual key, then hands the returned value to the app, which sends it to /v1/realtime/calls. Any virtual key allowed to use the model may call it, and the key's budget, rate limits and model access apply. A caller without a virtual key is refused with 400. The gateway encrypts the provider's secret before returning it, so the app never sees the provider key. Each secret writes an audit row on the calling key, without the secret value, and nothing else is stored.

Request body (application/json, object):

FieldTypeRequiredDescription
expires_afterobject or nullNoHow long the secret stays valid
modelstring or nullNoGateway model to route to when session.model is absent, not forwarded
sessionobject or nullNoThe realtime session the secret is bound to, model included

Example request:

curl -X POST "http://localhost:4000/openai/v1/realtime/client_secrets" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expires_after": {
"anchor": "created_at",
"seconds": 600
},
"session": {
"model": "gpt-realtime",
"type": "realtime"
}
}'

Responses:

StatusDescriptionBody
200The client secret for the browser or mobile app, encrypted by the gatewayapplication/json RealtimeClientSecretResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
expires_atinteger or nullNoWhen the secret expires, in Unix seconds
sessionobject or nullNoThe session as the provider created it
valuestringYesThe client secret to hand to the browser or mobile app

POST /openai/v1/realtime/transcription_sessions​

Create a realtime transcription session

Create an ephemeral Realtime transcription session (POST /v1/realtime/transcription_sessions) for the WebRTC/WebSocket flow.

Use it for live captions or dictation in a browser or phone app: your server calls this with its virtual key and hands the returned client_secret.value to the app, which streams audio and receives text. Any key allowed to use the transcription model may call it, and the key's budget, rate limits and model access apply. The gateway encrypts the provider's ephemeral key under client_secret.value, so the app never sees the provider key.

Request body (application/json, object):

FieldTypeRequiredDescription
input_audio_transcriptionobject or nullNoInput Audio Transcription
modelstring or nullNoModel

Example request:

curl -X POST "http://localhost:4000/openai/v1/realtime/transcription_sessions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_audio_transcription": {
"language": "en",
"model": "gpt-4o-transcribe"
},
"model": "gpt-realtime"
}'

Responses:

StatusDescriptionBody
200The ephemeral client secret for the transcription session.application/json RealtimeTranscriptionSessionResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
client_secretobject or nullNoClient Secret

GET /openai/{endpoint}​

Forward a native OpenAI request

Send any OpenAI API path, such as /v1/responses or /v1/chat/completions, exactly as OpenAI defines it. /openai_passthrough always reaches OpenAI, while /openai first checks whether the path names a deployment from model_list and routes through it when it does. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/openai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Say hello to the support team.",
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

POST /openai/{endpoint}​

Forward a native OpenAI request

Send any OpenAI API path, such as /v1/responses or /v1/chat/completions, exactly as OpenAI defines it. /openai_passthrough always reaches OpenAI, while /openai first checks whether the path names a deployment from model_list and routes through it when it does. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/openai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Say hello to the support team.",
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PUT /openai/{endpoint}​

Forward a native OpenAI request

Send any OpenAI API path, such as /v1/responses or /v1/chat/completions, exactly as OpenAI defines it. /openai_passthrough always reaches OpenAI, while /openai first checks whether the path names a deployment from model_list and routes through it when it does. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/openai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Say hello to the support team.",
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

PATCH /openai/{endpoint}​

Forward a native OpenAI request

Send any OpenAI API path, such as /v1/responses or /v1/chat/completions, exactly as OpenAI defines it. /openai_passthrough always reaches OpenAI, while /openai first checks whether the path names a deployment from model_list and routes through it when it does. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/openai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Say hello to the support team.",
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

DELETE /openai/{endpoint}​

Forward a native OpenAI request

Send any OpenAI API path, such as /v1/responses or /v1/chat/completions, exactly as OpenAI defines it. /openai_passthrough always reaches OpenAI, while /openai first checks whether the path names a deployment from model_list and routes through it when it does. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/openai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Say hello to the support team.",
"model": "gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no provider credential for this route.application/json ErrorDetail

GET /openrouter/{endpoint}​

Forward a native OpenRouter request

Send any OpenRouter API path, such as /chat/completions or /models, exactly as OpenRouter defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/openrouter/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "openai/gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /openrouter/{endpoint}​

Forward a native OpenRouter request

Send any OpenRouter API path, such as /chat/completions or /models, exactly as OpenRouter defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/openrouter/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "openai/gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /openrouter/{endpoint}​

Forward a native OpenRouter request

Send any OpenRouter API path, such as /chat/completions or /models, exactly as OpenRouter defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/openrouter/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "openai/gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /openrouter/{endpoint}​

Forward a native OpenRouter request

Send any OpenRouter API path, such as /chat/completions or /models, exactly as OpenRouter defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/openrouter/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "openai/gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /openrouter/{endpoint}​

Forward a native OpenRouter request

Send any OpenRouter API path, such as /chat/completions or /models, exactly as OpenRouter defines it. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/openrouter/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"content": "Summarise this ticket in one sentence.",
"role": "user"
}
],
"model": "openai/gpt-6.1-sol"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /tinyfish/{endpoint}​

Run a TinyFish web agent task

Send /v1/automation/run with a url and a goal. The other TinyFish Agent API endpoints are refused, because every caller shares the gateway's TinyFish account and must not see other callers' runs. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/tinyfish/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"goal": "Find the pricing page and return the plan names.",
"url": "https://example.com"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body is not a JSON object, or it carries fields the gateway reserves.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The path is not /v1/automation/run, or the body uses saved account credentials.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /tinyfish/{endpoint}​

Run a TinyFish web agent task

Send /v1/automation/run with a url and a goal. The other TinyFish Agent API endpoints are refused, because every caller shares the gateway's TinyFish account and must not see other callers' runs. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/tinyfish/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"goal": "Find the pricing page and return the plan names.",
"url": "https://example.com"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The body is not a JSON object, or it carries fields the gateway reserves.application/json ErrorDetail
401The gateway has no provider credential for this route.application/json ErrorDetail
403The path is not /v1/automation/run, or the body uses saved account credentials.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /transcribe​

Call an Amazon Transcribe operation

Send the operation name in the path, such as /transcribe/StartTranscriptionJob, or send an AWS SDK request to /transcribe with the X-Amz-Target header. Jobs are tagged with the calling key's owner, so only that owner or a proxy admin can read or delete them, and keys that are not proxy admins may only use the buckets in general_settings.transcribe_media_buckets. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/transcribe" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"LanguageCode": "en-US",
"Media": {
"MediaFileUri": "s3://my-media-bucket/standup.wav"
},
"OutputBucketName": "my-media-bucket",
"TranscriptionJobName": "standup-2026-11-21"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400No AWS region is set, the body is not a JSON object, or the media is outside the allowed buckets.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The operation is account wide and limited to proxy admins, or the job belongs to another key.application/json ErrorDetail

POST /transcribe/{operation}​

Call an Amazon Transcribe operation

Send the operation name in the path, such as /transcribe/StartTranscriptionJob, or send an AWS SDK request to /transcribe with the X-Amz-Target header. Jobs are tagged with the calling key's owner, so only that owner or a proxy admin can read or delete them, and keys that are not proxy admins may only use the buckets in general_settings.transcribe_media_buckets. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
operationpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/transcribe/operation-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"LanguageCode": "en-US",
"Media": {
"MediaFileUri": "s3://my-media-bucket/standup.wav"
},
"OutputBucketName": "my-media-bucket",
"TranscriptionJobName": "standup-2026-11-21"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400No AWS region is set, the body is not a JSON object, or the media is outside the allowed buckets.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The operation is account wide and limited to proxy admins, or the job belongs to another key.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /typesafe/{endpoint}​

Forward a native Typesafe request

Send a Typesafe path such as /v1/systemone with a body in the native System One format. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/typesafe/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /typesafe/{endpoint}​

Forward a native Typesafe request

Send a Typesafe path such as /v1/systemone with a body in the native System One format. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/typesafe/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /typesafe/{endpoint}​

Forward a native Typesafe request

Send a Typesafe path such as /v1/systemone with a body in the native System One format. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/typesafe/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /typesafe/{endpoint}​

Forward a native Typesafe request

Send a Typesafe path such as /v1/systemone with a body in the native System One format. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/typesafe/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /typesafe/{endpoint}​

Forward a native Typesafe request

Send a Typesafe path such as /v1/systemone with a body in the native System One format. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/typesafe/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"questions": {
"is_refund_request": {
"instructions": "Is the customer asking for a refund?",
"type": "noul"
},
"urgency": {
"criteria": {
"high": "needs action today",
"low": "can wait a week"
},
"instructions": "How urgent is this?",
"type": "choice"
}
},
"state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today."
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /vertex_ai/discovery/{endpoint}​

Forward a Vertex AI Search request

Send a Discovery Engine path, the API behind Vertex AI Search, such as /v1/projects/{project}/locations/global/collections/default_collection/engines/{engine}/servingConfigs/default_search:search. The gateway signs the call with its Vertex AI service account. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/vertex_ai/discovery/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 5,
"query": "refund policy for duplicate charges"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /vertex_ai/discovery/{endpoint}​

Forward a Vertex AI Search request

Send a Discovery Engine path, the API behind Vertex AI Search, such as /v1/projects/{project}/locations/global/collections/default_collection/engines/{engine}/servingConfigs/default_search:search. The gateway signs the call with its Vertex AI service account. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/vertex_ai/discovery/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 5,
"query": "refund policy for duplicate charges"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /vertex_ai/discovery/{endpoint}​

Forward a Vertex AI Search request

Send a Discovery Engine path, the API behind Vertex AI Search, such as /v1/projects/{project}/locations/global/collections/default_collection/engines/{engine}/servingConfigs/default_search:search. The gateway signs the call with its Vertex AI service account. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/vertex_ai/discovery/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 5,
"query": "refund policy for duplicate charges"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /vertex_ai/discovery/{endpoint}​

Forward a Vertex AI Search request

Send a Discovery Engine path, the API behind Vertex AI Search, such as /v1/projects/{project}/locations/global/collections/default_collection/engines/{engine}/servingConfigs/default_search:search. The gateway signs the call with its Vertex AI service account. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/vertex_ai/discovery/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 5,
"query": "refund policy for duplicate charges"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /vertex_ai/discovery/{endpoint}​

Forward a Vertex AI Search request

Send a Discovery Engine path, the API behind Vertex AI Search, such as /v1/projects/{project}/locations/global/collections/default_collection/engines/{engine}/servingConfigs/default_search:search. The gateway signs the call with its Vertex AI service account. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/vertex_ai/discovery/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 5,
"query": "refund policy for duplicate charges"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /vertex_ai/{endpoint}​

Forward a native Vertex AI request

Send any Vertex AI REST path, including the project and location, such as /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent. The gateway signs the call with the service account of a Vertex AI deployment marked use_in_pass_through, or with default_vertex_config. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/vertex_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no location and the gateway has no default Vertex AI location to fall back to.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /vertex_ai/{endpoint}​

Forward a native Vertex AI request

Send any Vertex AI REST path, including the project and location, such as /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent. The gateway signs the call with the service account of a Vertex AI deployment marked use_in_pass_through, or with default_vertex_config. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/vertex_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no location and the gateway has no default Vertex AI location to fall back to.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /vertex_ai/{endpoint}​

Forward a native Vertex AI request

Send any Vertex AI REST path, including the project and location, such as /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent. The gateway signs the call with the service account of a Vertex AI deployment marked use_in_pass_through, or with default_vertex_config. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/vertex_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no location and the gateway has no default Vertex AI location to fall back to.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /vertex_ai/{endpoint}​

Forward a native Vertex AI request

Send any Vertex AI REST path, including the project and location, such as /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent. The gateway signs the call with the service account of a Vertex AI deployment marked use_in_pass_through, or with default_vertex_config. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/vertex_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no location and the gateway has no default Vertex AI location to fall back to.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /vertex_ai/{endpoint}​

Forward a native Vertex AI request

Send any Vertex AI REST path, including the project and location, such as /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent. The gateway signs the call with the service account of a Vertex AI deployment marked use_in_pass_through, or with default_vertex_config. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/vertex_ai/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Summarise this ticket in one sentence."
}
],
"role": "user"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path names no location and the gateway has no default Vertex AI location to fall back to.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /vllm/{endpoint}​

Forward a request to a self-hosted vLLM server

Send any vLLM path, including the vLLM-only endpoints /classify, /score and /tokenize. When the model names a deployment from model_list the gateway routes through that deployment, otherwise it uses HOSTED_VLLM_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/vllm/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"Please refund one of the two charges."
],
"model": "my-vllm-model"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /vllm/{endpoint}​

Forward a request to a self-hosted vLLM server

Send any vLLM path, including the vLLM-only endpoints /classify, /score and /tokenize. When the model names a deployment from model_list the gateway routes through that deployment, otherwise it uses HOSTED_VLLM_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/vllm/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"Please refund one of the two charges."
],
"model": "my-vllm-model"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /vllm/{endpoint}​

Forward a request to a self-hosted vLLM server

Send any vLLM path, including the vLLM-only endpoints /classify, /score and /tokenize. When the model names a deployment from model_list the gateway routes through that deployment, otherwise it uses HOSTED_VLLM_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/vllm/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"Please refund one of the two charges."
],
"model": "my-vllm-model"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /vllm/{endpoint}​

Forward a request to a self-hosted vLLM server

Send any vLLM path, including the vLLM-only endpoints /classify, /score and /tokenize. When the model names a deployment from model_list the gateway routes through that deployment, otherwise it uses HOSTED_VLLM_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/vllm/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"Please refund one of the two charges."
],
"model": "my-vllm-model"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /vllm/{endpoint}​

Forward a request to a self-hosted vLLM server

Send any vLLM path, including the vLLM-only endpoints /classify, /score and /tokenize. When the model names a deployment from model_list the gateway routes through that deployment, otherwise it uses HOSTED_VLLM_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/vllm/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"Please refund one of the two charges."
],
"model": "my-vllm-model"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

GET /watsonx/{endpoint}​

Forward a native watsonx.ai request

Send any watsonx.ai path, such as /ml/v1/text/generation or /ml/v1/text/tokenization. The gateway exchanges WATSONX_APIKEY for an IAM token, adds the version query parameter when it is missing and forwards the request to WATSONX_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/watsonx/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarise this ticket in one sentence.",
"model_id": "mistralai/mistral-large",
"project_id": "a1b2c3d4-0000-1111-2222-333344445555"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
404The gateway has no watsonx pass-through configuration.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /watsonx/{endpoint}​

Forward a native watsonx.ai request

Send any watsonx.ai path, such as /ml/v1/text/generation or /ml/v1/text/tokenization. The gateway exchanges WATSONX_APIKEY for an IAM token, adds the version query parameter when it is missing and forwards the request to WATSONX_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/watsonx/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarise this ticket in one sentence.",
"model_id": "mistralai/mistral-large",
"project_id": "a1b2c3d4-0000-1111-2222-333344445555"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
404The gateway has no watsonx pass-through configuration.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /watsonx/{endpoint}​

Forward a native watsonx.ai request

Send any watsonx.ai path, such as /ml/v1/text/generation or /ml/v1/text/tokenization. The gateway exchanges WATSONX_APIKEY for an IAM token, adds the version query parameter when it is missing and forwards the request to WATSONX_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/watsonx/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarise this ticket in one sentence.",
"model_id": "mistralai/mistral-large",
"project_id": "a1b2c3d4-0000-1111-2222-333344445555"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
404The gateway has no watsonx pass-through configuration.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /watsonx/{endpoint}​

Forward a native watsonx.ai request

Send any watsonx.ai path, such as /ml/v1/text/generation or /ml/v1/text/tokenization. The gateway exchanges WATSONX_APIKEY for an IAM token, adds the version query parameter when it is missing and forwards the request to WATSONX_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/watsonx/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarise this ticket in one sentence.",
"model_id": "mistralai/mistral-large",
"project_id": "a1b2c3d4-0000-1111-2222-333344445555"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
404The gateway has no watsonx pass-through configuration.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /watsonx/{endpoint}​

Forward a native watsonx.ai request

Send any watsonx.ai path, such as /ml/v1/text/generation or /ml/v1/text/tokenization. The gateway exchanges WATSONX_APIKEY for an IAM token, adds the version query parameter when it is missing and forwards the request to WATSONX_API_BASE. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/watsonx/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarise this ticket in one sentence.",
"model_id": "mistralai/mistral-large",
"project_id": "a1b2c3d4-0000-1111-2222-333344445555"
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
404The gateway has no watsonx pass-through configuration.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError