Client guides
AI tool setup guides
These configurations use the current public gateway https://api.51cowork.com. Keys and model values come from Dashboard; check file permissions and version-control rules before persisting a Key.
Use environment variables or user-level files for CLI tools. In Cursor, Cherry Studio, and WorkBuddy, enter the endpoint, API Key, and model ID in settings. Keep Keys out of Git.
- Claude Code
- Anthropic environment
- Codex
- config.toml + auth.json
- OpenCode
- opencode.json
- Cursor
- OpenAI Base URL
- Cherry Studio
- Custom provider
- WorkBuddy
- Custom model
Before you start
- 1Create and copy an API Key in Dashboard.
- 2Use https://api.51cowork.com and select a model through https://api.51cowork.com/v1/models.
- 3Back up existing client files and merge rather than overwrite providers.
- 4Test CLI tools in a temporary shell. For desktop tools, save the configuration, select the model, and send a test request.
Claude Code
Claude Code uses the Gateway root and ANTHROPIC_AUTH_TOKEN.
bashexport ANTHROPIC_BASE_URL="https://api.51cowork.com"
export ANTHROPIC_AUTH_TOKEN="<key-from-dashboard>"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export CLAUDE_CODE_ATTRIBUTION_HEADER=0
claudepowershell$env:ANTHROPIC_BASE_URL="https://api.51cowork.com"
$env:ANTHROPIC_AUTH_TOKEN="<key-from-dashboard>"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
$env:CLAUDE_CODE_ATTRIBUTION_HEADER="0"
claudeFor user-level persistence, save the following to ~/.claude/settings.json. On Windows use %USERPROFILE%\.claude\settings.json.
json{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"ANTHROPIC_BASE_URL": "https://api.51cowork.com",
"ANTHROPIC_AUTH_TOKEN": "<key-from-dashboard>",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}Codex CLI / Extension
Codex uses the Responses wire API.
Merge the provider into ~/.codex/config.toml; Windows uses %USERPROFILE%\.codex\config.toml. Replace the model placeholder with a current gateway model.
tomlmodel_provider = "51cowork"
model = "<model-from-gateway>"
[model_providers."51cowork"]
name = "51cowork"
base_url = "https://api.51cowork.com"
wire_api = "responses"
requires_openai_auth = truejson{
"OPENAI_API_KEY": "<key-from-dashboard>"
}- Create the directory if needed.
- Do not remove other providers or settings from an existing config.
- Quit and restart the CLI or extension, then open a new task.
OpenCode
Save this OpenAI-compatible provider to ~/.config/opencode/opencode.json or opencode.jsonc. Use a real model ID from /v1/models.
json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"51cowork": {
"npm": "@ai-sdk/openai",
"name": "51cowork",
"options": {
"baseURL": "https://api.51cowork.com/v1",
"apiKey": "<key-from-dashboard>"
}
}
}
}Cursor
- 1Open model or API settings and enable a custom OpenAI Base URL.
- 2Enter https://api.51cowork.com/v1 and the API Key from Dashboard.
- 3Add a model ID returned by /v1/models, select it, and send a test request.
Cherry Studio
- 1Open Model Services in settings and add a provider named 51cowork with type OpenAI.
- 2Set API Address to the gateway root https://api.51cowork.com; Cherry Studio appends /v1/chat/completions automatically.
- 3Enter the API Key from Dashboard, fetch the model list, and add the models you need.
- 4Enable the provider, select a model in chat, and send a test request.
WorkBuddy
- 1Open Settings → Model, add a custom model, and choose Custom.
- 2Enter the full endpoint URL: https://api.51cowork.com/v1/chat/completions.
- 3Enter the API Key from Dashboard and an exact model ID returned by /v1/models.
- 4Enable Custom Protocol in advanced settings to use the full URL without appending a path.
- 5Save, select the custom model in chat, send a test request, and check Dashboard usage.
Update a Key
- 1Create or select a replacement Key in Dashboard.
- 2Update every environment or user config with the new Key.
- 3Fully restart clients that cache credentials.
- 4Send a minimal request and verify it in Usage.
- 5Delete an unused Key only after the migration is complete.
Configuration acceptance checklist
- Gateway root is https://api.51cowork.com; OpenAI SDK Base URL is https://api.51cowork.com/v1.
- The Key has no extra spaces, quotes, or line breaks.
- The model ID comes from /v1/models.
- Client protocol matches the selected endpoint.
- The successful request appears in Dashboard Usage.
