Skip to main content

Anthropic

Anthropic is available on the Spanway gateway through the anthropic/ model prefix. You register an Anthropic model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

The gateway translates requests and responses for Anthropic natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Supported endpoints​

The gateway's endpoint support matrix lists the following endpoints for Anthropic. Each link explains the request shape and the gateway features that apply to that endpoint.

Model types​

The bundled price map lists 22 Anthropic models across these modes: Chat. The mode decides which gateway endpoint a model is meant for, and it is also used by the gateway's health checks to send the right kind of test request.

Environment variables​

The Anthropic integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
ANTHROPIC_API_KEYYesCredential the gateway sends to the provider
ANTHROPIC_AUTH_TOKENYesCredential the gateway sends to the provider
ANTHROPIC_API_BASENoOverrides the provider base URL
ANTHROPIC_BASE_URLNoOverrides the provider base URL

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Register a model on the gateway​

Add an entry to model_list in config.yaml. The model_name is the public name your applications send, and spanway_params.model tells the gateway which provider and upstream model to call.

model_list:
- model_name: claude-sonnet-5-5
spanway_params:
model: anthropic/claude-sonnet-5-5
api_key: os.environ/ANTHROPIC_API_KEY

Start the gateway with this file:

export ANTHROPIC_API_KEY="..."
export ANTHROPIC_AUTH_TOKEN="..."
spanway --config config.yaml
Private preview

Spanway is in private preview. The container images and Helm charts will be published soon. To request access, write to sales@spanway.ai, and preview customers receive download instructions in their onboarding pack.

To add the model without a restart, call POST /model/new with the same model_name and spanway_params, or use the Models + Endpoints page in the Admin UI. See model management for details.

Call the model through the gateway​

Send requests to the gateway's /v1/chat/completions endpoint with a virtual key. The gateway maps the public model name to the Anthropic deployment, translates the request, and returns the response in the OpenAI format.

curl -X POST http://localhost:4000/v1/chat/completions \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Summarize what an AI gateway does in two sentences."}]
}'

The same request works from any OpenAI SDK by setting the base URL to http://localhost:4000 and the API key to a Spanway virtual key. Create keys with POST /key/generate as described in virtual keys.

Models and pricing​

The table lists every Anthropic model in the gateway's bundled price map. Prices are shown in US dollars per 1 million tokens, computed from the per-token values the gateway uses for spend tracking. Context window sizes are the provider limits recorded in the same file. Capabilities are the supports_* flags set for each model.

info

Prices come from the price map bundled with this Spanway build. They are used to calculate the spend recorded for each request, key, team and user. Your negotiated rates may differ, and you can override them per deployment with custom pricing.

Model (model value)ModeMax input tokensMax output tokensInput per 1M tokensOutput per 1M tokensOther pricingCapabilities
anthropic/claude-fable-5Chat1,000,000128,000$10.00$50.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-fable-5-1Chat1,000,000128,000$10.00$50.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-haiku-4-5Chat200,00064,000$1.00$5.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-haiku-4-5-20251001Chat200,00064,000$1.00$5.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-haiku-5-5Chat1,000,000128,000$0.1$0.5tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-mythos-5Chat1,000,000128,000$10.00$50.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-mythos-5-1Chat1,000,000128,000$10.00$50.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-mythos-previewChat1,000,000128,000$10.00$50.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-opus-4-5Chat200,00064,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-opus-4-5-20251101Chat200,00064,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-opus-4-6Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-opus-4-6-20260205Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-opus-4-7Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-opus-4-7-20260416Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-opus-4-8Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-opus-5Chat1,000,000128,000$5.00$25.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-opus-5-5Chat1,000,000128,000$4.00$20.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-sonnet-4-5Chat200,00064,000$3.00$15.00tools, vision, reasoning, prompt caching, structured output, PDF input, computer use
anthropic/claude-sonnet-4-5-20250929Chat200,00064,000$3.00$15.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-sonnet-4-6Chat1,000,000128,000$3.00$15.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-sonnet-5Chat1,000,000128,000$2.00$10.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use
anthropic/claude-sonnet-5-5Chat1,000,000128,000$2.00$10.00tools, vision, reasoning, prompt caching, structured output, web search, PDF input, computer use