Connect Claude Code to SuJin AI
Claude Code speaks the Anthropic protocol. To send it through SuJin AI, set the base URL and the API key from your SuJin console in the same terminal. This is not the official Anthropic console.
Calls use ordinary HTTPS. The OpenAI-compatible base URL is https://sujinai.com/v1. The Anthropic protocol and Claude Code use https://sujinai.com, with no /v1 suffix.
Environment variables
ANTHROPIC_BASE_URL must be https://sujinai.com. Put the key in either ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY. One of the two is enough, and the value is the same SuJin key. Do not append /v1, and do not use the OpenAI-compatible URL https://sujinai.com/v1 here. The homepage snippet uses ANTHROPIC_API_KEY.
With ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL="https://sujinai.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
claude
With ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL="https://sujinai.com"
export ANTHROPIC_API_KEY="YOUR_API_KEY"
claude
These exports last for the current terminal session. If you start Claude Code from another window, set the variables there too, or put them in a file that window reads on startup.
Get a key first
- Register at /register and create an API key in the console.
- Add credit at /purchase. A call fails when the balance is empty.
- Export one of the variable pairs above, then run
claude.
Check that it took
- In the same terminal, confirm the base URL and that the key variable is non-empty. Do not print the whole key.
- Run
claudeand send a very short message. - If you get an auth error, switch to the other key variable and retry in that same terminal.
test "$ANTHROPIC_BASE_URL" = "https://sujinai.com" && echo "base url ok"
test -n "$ANTHROPIC_AUTH_TOKEN" -o -n "$ANTHROPIC_API_KEY" && echo "key is set"
Model IDs come from Pricing. The homepage Claude example uses claude-sonnet-5-5; the card name is sonnet-5-5. Nothing outside GPT and Claude is on the list.
Common mistakes
ANTHROPIC_BASE_URLincludes/v1,/v1/messages, or the OpenAI base URL. Leave it as exactlyhttps://sujinai.com.- The key was copied with a space or a missing chunk. Copy it again from the console.
- The variables were set in one terminal and
claudewas started in another. - Both
ANTHROPIC_AUTH_TOKENandANTHROPIC_API_KEYare set, to different values. Keep one, set to the SuJin key. - The model id is not on the GPT / Claude list, or it still has an OpenRouter
anthropic/...prefix.
If it still fails, send the error text without the key to [email protected].
Related pages
FAQ
Which variables does Claude Code need?
ANTHROPIC_BASE_URL=https://sujinai.com, plus either ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY. One SuJin key is enough.
Should I add /v1 to the base URL?
No. Claude Code uses https://sujinai.com. https://sujinai.com/v1 is for OpenAI-compatible clients.
How do I tell the variables were picked up?
In the same terminal, check that ANTHROPIC_BASE_URL is https://sujinai.com and the key variable is non-empty, then send a short message with claude.
Which model id should I use?
The card says sonnet-5-5. The homepage example writes claude-sonnet-5-5. Other ids are on the pricing page. Do not keep an OpenRouter vendor prefix.
Register and create a key
Register with your email, create an API key in the console, then add credit. You can also reach [email protected].
Register to start Add credit