base_url to the gateway, authenticate to to11 with the x-to11-authorization header, and keep passing your provider key as the SDK’s api_key — the rest of your code stays the same.
Python
Install the SDK if you haven’t already:base_url to your gateway:
TypeScript / Node.js
Streaming
Addstream: true to receive the response incrementally. The gateway streams chunks back as they arrive from the provider, and the call is traced the same as a non-streaming one.
Cross-format routing
You can route OpenAI-format requests to Anthropic models. The gateway translates the request and returns the response in OpenAI format — your code doesn’t change:system field. Tool definitions are translated between formats.
Tool calling
Tool calling works identically to direct OpenAI usage:input_schema format automatically.
Environment variable configuration
If you prefer not to hard-code the base URL, use theOPENAI_BASE_URL environment variable: