CodeBair Client Integration Guide
This guide exists for one purpose: connect common clients to https://api.codebair.com / https://api.codebair.com/v1.
1. Shared Parameters
- Base URL:
https://api.codebair.com/v1 - API Key: CodeBair key (
sk-...) - Model: use a model returned by
/v1/models
Some clients use Anthropic- or Gemini-style variables and may not need /v1. Each section below notes that explicitly.
2. Choose Your Client
| Client | Best for | Key configuration |
|---|---|---|
| Claude Code | terminal users / developers | ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN |
| CC Switch | users who want a GUI for Claude config | import custom config |
| Codex | terminal users / developers | config.toml + auth.json |
| Cursor | IDE users | Models settings |
| Cherry Studio | desktop chat client users | Anthropic provider |
| Kilo | VS Code / Kilo users | Anthropic provider + custom base URL |
| OpenCode | developers | opencode.json + OPENCODE_CONFIG |
| OpenClaw | developers | openclaw.json |
| Chatbox | desktop chat users | OpenAI API config |
| WorkBuddy | enterprise chat / office users | custom model / OpenAI-compatible |
| Gemini CLI | CLI users | GOOGLE_GEMINI_BASE_URL + GEMINI_API_KEY |
3. Claude Code
Install
Official install (recommended)
NPM install
Configure settings.json
- Windows:
C:\Users\<username>\.claude\settings.json - macOS / Linux:
~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.codebair.com",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx"
}
}
Do not append
/v1toANTHROPIC_BASE_URL.
Temporary bootstrap if settings.json is ignored
$env:ANTHROPIC_BASE_URL="https://api.codebair.com"
$env:ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxxxxxxxxxx"
claude
Verify
Run:
If Claude opens and responds normally, setup is complete.
4. CC Switch
- Open CC Switch
- Switch the group to
Claude - Choose
自定义配置/ custom configuration - Paste this config and replace the token
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.codebair.com",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx"
}
}
- Give it a name such as
CodeBair - Click
启用/ Enable
5. Codex
Install
config.toml
model_provider = "codebair"
model = "gpt-5.3-codex"
[model_providers.codebair]
name = "codebair"
base_url = "https://api.codebair.com/v1"
wire_api = "responses"
requires_openai_auth = true
auth.json
Verify
6. Cursor
In Settings -> Models:
- Enable
OpenAI API Key - Paste your CodeBair key
- Enable
Override OpenAI Base URL - Set it to
https://api.codebair.com/v1 - Add or enable a supported model
7. Cherry Studio
- Open
Settings -> Model Services -> Add - Choose provider type
Anthropic - Fill in:
- API URL:
https://api.codebair.com - API Key: CodeBair key
- Refresh the model list and add the models you need
8. VS Code Kilo
- Choose API provider
Anthropic - Enable custom base URL
- Set:
- Base API URL:
https://api.codebair.com - API Key: CodeBair key
- Test one reply
9. OpenCode
Create C:\Users\<username>\opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"zenchao": {
"models": {
"claude-haiku-4-5-20251001": { "name": "haiku 4.5" },
"claude-opus-4-5-20251101": { "name": "opus 4.5" },
"claude-opus-4-6": { "name": "opus 4.6" },
"claude-sonnet-4-5-20250929": { "name": "sonnet 4.5" },
"claude-sonnet-4-6": { "name": "sonnet 4.6" }
},
"npm": "@ai-sdk/anthropic",
"options": {
"apiKey": "sk-***",
"baseURL": "https://api.codebair.com/v1"
}
}
}
}
Set environment variable:
OPENCODE_CONFIG = C:\Users\<username>\opencode.json
Save auth:
- Provider ID:
codeflow - Choose
Other
Verify:
Then run /models.
10. OpenClaw
Open config:
or
Use the same JSON structure as the Chinese guide, with provider base URL https://api.codebair.com and your CodeBair API key.
Apply changes:
11. Chatbox
- Provider:
OpenAI API - Base URL:
https://api.codebair.com/v1 - API Key: CodeBair key
- Model: any supported model from
/v1/models
12. WorkBuddy
Look for:
- custom model
- OpenAI-compatible
- custom API
Use:
- Base URL:
https://api.codebair.com/v1 - API Key: CodeBair key
- Model: a supported model from
/v1/models
13. Gemini CLI
Install
Environment variables
export GOOGLE_GEMINI_BASE_URL="https://api.codebair.com"
export GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxx"
or on Windows PowerShell:
.env file
- Windows:
C:\Users\<username>\.gemini\.env - macOS / Linux:
~/.gemini/.env
Verify
14. Troubleshooting
| Error | Common reason | Fix |
|---|---|---|
401 |
wrong key / extra spaces / not a CodeBair key | recopy the key |
403 |
not enough permission / no balance / restriction | check account and balance |
404 |
wrong Base URL | confirm whether the client needs /v1 |
429 |
rate limit | retry later with lower concurrency |
5xx |
upstream instability | retry with backoff |
Model not found |
wrong model name | use a model from /v1/models |