Python
TypeScript / Node
Async Python
Using environment variables
The OpenAI SDK readsOPENAI_API_KEY and OPENAI_BASE_URL by default.
Set them once and the SDK picks them up without per-call config:
What changes in your code
Only the base URL and the API key. Model names, request parameters, response shape, streaming protocol, error handling — all unchanged. You can callgpt-4o, claude-3-5-sonnet-latest, gemini-2.5-pro, etc.
through the same client object; OrcaRouter handles the cross-provider
translation internally.
Anthropic SDK
If you use the official Anthropic Python or TypeScript SDK, point it athttps://api.orcarouter.ai/v1 the same way (we expose /v1/messages).
See the Anthropic Messages
endpoint reference.