CLIENT INTEGRATIONS
Connect the tools you already use
Choose the protocol first, then enter the key, matching Base URL, and an exact model ID from the live catalog.
Last updated:
Choose a client
Endpoint rules
| Client protocol | Base URL | Final request |
|---|---|---|
| OpenAI compatible | http://localhost:3000/v1 |
/v1/chat/completions or
/v1/responses
|
| Anthropic Messages | http://localhost:3000 | /v1/messages |
| Long-running generation | http://localhost:3000/v1 | The matching OpenAI-compatible resource path |
Inspect the final request URL for a duplicated
/v1 or resource path before changing the key or
model.
RECOMMENDED IMPORT
CC Switch (CCS)
Use one-click import from API keys for supported tools, including Claude Code, Cursor, OpenClaw, and Hermes.
- Install the latest CC Switch release.
- Open the target key and choose CCS import.
- Select the application and a model that is available to the key group.
-
Confirm the redacted key and endpoint before allowing the
browser to open
ccswitch://.
The target tool returns a response and the same model request appears in usage logs with HTTP 200.
The import also turns on CC Switch's balance query, refreshed
every 5 minutes. The remaining amount is what the key can still
spend: the account balance for an unlimited key, and for a key
with a quota the smaller of its remaining quota and the account
balance. The used amount is the key's own spend. Other tools can
call
GET http://localhost:3000/v1/dashboard/billing/credit_grants
with the same key; total_available is the remaining
amount, in CNY.
For Hermes OpenAI-compatible mode, use
http://localhost:3000/v1 as the Base URL and
keep the wire protocol on chat_completions. A named
custom provider should use the
custom:<name> form in
model.provider; a bare custom provider can be
reinterpreted by Hermes when the model name looks like a
Responses-only model.
model:
default: YOUR_MODEL_ID
provider: custom:ccapi
custom_providers:
- name: ccapi
base_url: http://localhost:3000/v1
api_key: sk-your-token
api_mode: chat_completions
model: YOUR_MODEL_IDOPENAI RESPONSES
Codex CLI
Define the provider in the user-level
~/.codex/config.toml and keep the key in an
environment variable.
model = "YOUR_MODEL_ID"
model_provider = "ccapi"
[model_providers.ccapi]
name = "懂api"
base_url = "http://localhost:3000/v1"
env_key = "DONGAPI_API_KEY"
wire_api = "responses"export DONGAPI_API_KEY="sk-your-key"
codex exec "Reply with ok"
Confirm a /v1/responses request in usage logs. See
the
official Codex configuration reference
for current keys.
ANTHROPIC MESSAGES
Claude Code
Use Bearer authentication through
ANTHROPIC_AUTH_TOKEN. The Base URL must not include
/v1.
export ANTHROPIC_BASE_URL="http://localhost:3000"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
export ANTHROPIC_MODEL="YOUR_MODEL_ID"
claude -p "Reply with ok"
Pi uses the short Claude prompt-cache retention by default. For
repository sessions that may pause for more than five minutes,
start Pi with PI_CACHE_RETENTION=long and enable
supportsLongCacheRetention plus
sendSessionAffinityHeaders in the custom Anthropic
provider compatibility settings. 懂api high-cache Claude groups
also fill in a one-hour TTL when the client requested caching
but omitted the TTL; explicit client TTLs remain unchanged.
export PI_CACHE_RETENTION=long
"compat": {
"supportsLongCacheRetention": true,
"sendSessionAffinityHeaders": true
}If the request still goes to the official host, inspect the variables in the current shell and restart Claude Code. See the Claude Code gateway reference.
OPENAI COMPATIBLE
Cursor and desktop clients
Cursor Chat, Cherry Studio, Chatbox, Open WebUI, LobeChat, and similar clients normally use these fields:
Provider: OpenAI compatible
API Key: sk-your-key
Base URL: http://localhost:3000/v1
Model: YOUR_MODEL_ID- Add the exact model ID shown in Models.
- Restart clients that cache provider settings.
- Send “Reply with ok” in a new chat and verify the request in usage logs.