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.

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.

Cross-format routing

If you route an Anthropic-format request to an OpenAI model, the gateway translates automatically:
The system parameter is converted to a {"role": "system"} message, and tool definitions are translated to OpenAI’s parameters format.