Migrate from Anthropic SDK
If you are using Anthropic’s SDK directly, switching to Routor takes two changes. You swap to the OpenAI-compatible SDK format, which Routor uses as its standard interface.Before and After
Python (Anthropic SDK → Routor)
Before:Node.js (Anthropic SDK → Routor)
Before:Key Differences
The Anthropic SDK uses a different response format than the OpenAI SDK. The main changes when moving to Routor’s OpenAI-compatible format:| Anthropic SDK | Routor (OpenAI format) |
|---|---|
message.content[0].text | response.choices[0].message.content |
client.messages.create() | client.chat.completions.create() |
max_tokens param | max_tokens param (same) |
claude-opus-4-5 as model | "auto" as model |