Skip to main content
This guide shows you how to point the official Anthropic SDK at the to11 gateway. Set the base_url to your gateway’s /v1 endpoint and use the Anthropic messages API as usual, naming the provider in the model string — anthropic::claude-sonnet-4-6, where anthropic is the routing identifier of your Anthropic provider in to11. See Naming the provider in a request.

Python

TypeScript / Node.js

Streaming

Streamed responses are traced just like non-streaming calls — the gateway captures the same span and token counts either way.

System messages

Pass a top-level system parameter as you normally would:

Tool use

Tool definitions follow the Anthropic input_schema format:

Extended thinking

Extended thinking blocks are preserved in Anthropic-format responses when enabled on the model. The thinking content type passes through the gateway as-is.

Providers the Anthropic SDK reaches

The gateway forwards your request to the provider as you wrote it and does not convert between wire formats. The Anthropic SDK sends the Anthropic Messages format, so it reaches Anthropic providers. To call OpenAI or an OpenAI-compatible provider, use the OpenAI SDK. An Anthropic-format request that names one of them, such as openai::gpt-4o, is rejected with 400 Bad Request and the x-to11-error-code: cross_dialect header before anything is sent to the provider. See Which SDK to call a provider with.