Migrate from the Anthropic API to TokenRex

Keep using the Anthropic SDK for Claude, or switch to the OpenAI format to reach every model.

Steps

What to check after switching

Example

import anthropic

client = anthropic.Anthropic(api_key="YOUR_TOKENREX_KEY", base_url="https://tokenrex.ai/api/public")
Get API keyCost calculatorDocs

Questions

Can I switch back?
Yes. Nothing is locked in: change the base URL and key back and your code keeps working.

Related