OpenAI SDK
This guide shows you how to point the official OpenAI SDK at the to11 gateway. The only change is thebase_url — 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 Server-Sent Events. The gateway forwards SSE chunks from OpenAI with zero-copy passthrough — sub-millisecond overhead.
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: