Esc to close · ⌘K / Ctrl-K opens search anywhere
Frontier APIwire-format change
Move from the Anthropic Messages API to the OpenAI shape — then it's the usual swap.
Before — Anthropic (Claude)
# Anthropic Messages API (native shape)
from anthropic import Anthropic
client = Anthropic(api_key="sk-ant-...")
msg = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=512,
messages=[{"role": "user", "content": "namaste"}],
)After — BharatRouter
# OpenAI shape through BharatRouter
from openai import OpenAI
client = OpenAI(
base_url="https://api.bharatrouter.com/v1",
api_key="br-...",
)
r = client.chat.completions.create(
model="claude-sonnet-4-6", # via BYOK
messages=[{"role": "user", "content": "namaste"}],
max_tokens=512,
)| Anthropic (Claude) | BharatRouter |
|---|---|
client.messages.create() | client.chat.completions.create() |
Top-level system string | A {"role": "system"} message |
max_tokens (required) | max_tokens (optional, but supported) |
x-api-key header | Authorization: Bearer br-… |
data_policy: "india_only".Stuck on a migration? Email [email protected], see the FAQ, or keep your accounts and rates with BYOK.