321AI Model MarketplaceLive marketplace →

Connect Claude Code Router to 321AI

Coding CLI · configuration guide + live pricing · sign up for trial credit

Claude Code Router (CCR) is an open-source routing layer: Claude Code requests first hit a local router, which forwards them by scenario (default / long context / thinking / background) to different models — cheap models can replace the default route to cut cost.

Claude Code Router in one line: Local routing layer: split scenarios across models to cut cost. 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
Provider name321ai (custom)Providers section of config.json
api_base_urlhttps://321ai.cc/v1OpenAI-compatible provider, include /v1
api_keyAPI key from the console
modelsarray of model names on salee.g. claude-fable-5-2, deepseek-v4
Router.default321ai,<model name>route the default scenario to that provider

Steps

1. Install: npm install -g @musistudio/claude-code-router (check the official README)

2. Edit ~/.claude-code-router/config.json: add the relay under Providers and point Router.default at it

3. Start with ccr code instead of claude — requests flow through the local router into the relay

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

CCR vs plain environment variables?

Environment variables send every request to one model; CCR splits by scenario (long-context work on a big-window model, background jobs on a cheap one) for further savings.

Where is the config file?

Default ~/.claude-code-router/config.json; field names follow the official README.

Other setup guides

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