Coding CLI · configuration guide + live pricing · sign up for trial credit
Claude Code is Anthropic's official command-line coding assistant. Point it at 321AI with environment variables and the same toolchain reaches the whole Claude model family.
Claude Code in one line: Point Claude Code at 321AI with ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN — no /v1 suffix. Recommended models and their market floor prices are in the table below; the full catalog is at https://321ai.cc/en/models/.
| Setting | Value | Notes |
|---|---|---|
ANTHROPIC_BASE_URL | https://321ai.cc | relay base URL (no /v1 suffix) |
ANTHROPIC_AUTH_TOKEN | API key from the console | replaces official OAuth login |
ANTHROPIC_MODEL | e.g. claude-fable-5-2 | optional — pins the main model |
ANTHROPIC_SMALL_FAST_MODEL | e.g. claude-haiku-4-5 | optional — cheap model for background tasks |
1. Sign in to the 321AI console, create an API key and copy it
2. Export the environment variables above in your shell (or write them into the env block of ~/.claude/settings.json)
3. Reopen the terminal, run claude, and confirm the model and endpoint with /status
| What | Where | Notes |
|---|---|---|
| Live market floor pricing | https://321ai.cc/en/models/ | input per 1M tokens, per-supplier quotes on the marketplace |
Prices are the multi-supplier market floor and move in realtime; see all model prices →
Switch to ANTHROPIC_AUTH_TOKEN authentication (no /login needed) and set ANTHROPIC_BASE_URL to the relay address; also confirm the key is valid and the balance is sufficient.
Claude Code uses a small model for background jobs such as file summaries; a cheap model there cuts total cost noticeably.