init() points the OpenAI client at the gateway for you — use the SDK exactly as
you do today.
How a bare OpenAI() reaches Orbitrage
You don’t pass a base_url — init() does it for you. On init() the SDK
patches the OpenAI / AsyncOpenAI constructor so that, when you don’t supply
your own base_url, every client you build:
- gets
base_url = https://api.orbitrage.ai/v1, and - is authenticated with your
orb_key — even ifOPENAI_API_KEYis set in your environment. (The gateway only acceptsorb_keys; your provider keys never leave your machine.)
OpenAI() always comes to Orbitrage with the right key:
base_url, Orbitrage never overrides it — you stay in
control.
Managed tools
Reference a managed tool by name and Orbitrage runs it server-side — no keys, no tool loop:model: "auto"routes to the cheapest capable model. Any model id pins it.- Streaming, tools, and vision all work unchanged — see Tool calling and Streaming.