
Guides 6 min read· 20 Jul 2026· By Guides
Migrate from OpenAI to TokenBaazar in 5 minutes
A step-by-step migration guide. Zero code changes beyond the base_url and key.
If your code already uses the OpenAI SDK, migration is a two-line change. Nothing else has to move.
Step 1 — Get a key#
Sign up at tokenbaazar.in/auth, topup any amount, and generate a key from the dashboard.
Step 2 — Swap two lines#
diff
- client = OpenAI(api_key="sk-...")
+ client = OpenAI(
+ api_key="sk-tb-...",
+ base_url="https://tokenbaazar.in/api/public/v1",
+ )Step 3 — Update the model name#
Model IDs on TokenBaazar are provider-prefixed. gpt-5.4-mini becomes openai/gpt-5.4-mini. See the models catalog.
Streaming, tool calls, JSON mode, and vision inputs all work unchanged. If it worked against api.openai.com, it works here.
Rollback plan#
Change the two lines back. There is no lock-in and no proprietary shape.