321AI Model MarketplaceLive marketplace →

Connect Claude Code to 321AI

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/.

Sign up & get trial creditSee live pricing

Configuration

SettingValueNotes
ANTHROPIC_BASE_URLhttps://321ai.ccrelay base URL (no /v1 suffix)
ANTHROPIC_AUTH_TOKENAPI key from the consolereplaces official OAuth login
ANTHROPIC_MODELe.g. claude-fable-5-2optional — pins the main model
ANTHROPIC_SMALL_FAST_MODELe.g. claude-haiku-4-5optional — cheap model for background tasks

Steps

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

Recommended models (live market floor)

WhatWhereNotes
Live market floor pricinghttps://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 →

FAQ

Claude Code shows "Login expired" — what now?

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.

Why configure SMALL_FAST_MODEL separately?

Claude Code uses a small model for background jobs such as file summaries; a cheap model there cuts total cost noticeably.

Other setup guides

Cursor Cherry Studio Cline Dify Immersive Translate LobeChat NextChat Open WebUI Codex CLI Python OpenAI SDK LangChain LiteLLM
All model pricesFeatured · 321AI communityFeatured · Open-source toolsFeatured · Advertise with usFeatured