Getting started
51cowork API documentation
51cowork supports GPT, Claude, Grok, DeepSeek, GLM, and Kimi. Create an API Key in Dashboard, then call https://api.51cowork.com with a model ID returned by /v1/models.
Create an API Key in Dashboard, fetch a current GPT, Claude, Grok, DeepSeek, GLM, or Kimi model ID from https://api.51cowork.com/v1/models, then use a compatible Messages, Chat Completions, or Responses endpoint.
- Account
- Methods enabled in Dashboard
- Key
- Managed in Dashboard
- Models
- Runtime catalog
- Billing
- Shown in Dashboard
What these docs cover
These docs are for developers using the model gateway.
- Discovery and calls for the GPT, Claude, Grok, DeepSeek, GLM, and Kimi model families.
- Account authentication, API Keys, balance, optional purchase entry points, and usage.
- Gateway authentication and Messages, Chat Completions, and Responses formats.
- Claude Code, Codex, OpenCode, Cursor, Cherry Studio, and WorkBuddy configuration.
- Common errors, retries, and security guidance.
Four core concepts
| Concept | Purpose | Source of truth |
|---|---|---|
| Account | Registration, sign-in, and session | Dashboard |
| API Key | Authenticate model requests | API Keys page |
| Models | Current callable model IDs | /v1/models |
| Gateway | Receive model requests | https://api.51cowork.com |
First request in five steps
- 1Register or sign in to Dashboard.
- 2Create and copy an API Key from the API Keys page.
- 3Select a model through https://api.51cowork.com/v1/models.
- 4Set the environment variables below and send a smoke request.
- 5Verify tokens and cost in Dashboard usage records.
bashexport COWORK_GATEWAY_URL="https://api.51cowork.com"
export COWORK_API_KEY="<key-from-dashboard>"
export COWORK_MODEL="<model-from-gateway>"Discover available models
The gateway and operator configuration determine the current model catalog.
The gateway supports the GPT, Claude, Grok, DeepSeek, GLM, and Kimi model families. Call the model-list endpoint with the current Key and use the exact returned model ID in requests; do not send a family name or an ID copied from an old screenshot.
bashcurl "$COWORK_GATEWAY_URL/v1/models" \
-H "Authorization: Bearer $COWORK_API_KEY"Choose a request format
| Format | Endpoint | Best fit |
|---|---|---|
| Anthropic Messages | POST /v1/messages | Anthropic SDK and Claude Code |
| OpenAI Chat Completions | POST /v1/chat/completions | OpenCode, Cursor, Cherry Studio, WorkBuddy |
| OpenAI Responses | POST /v1/responses | Codex and Responses clients |
For a new project, use the protocol your client supports natively. Existing projects usually migrate by changing only Base URL, Key, and model ID.
Where to go next
- Use API Reference for auth headers, request fields, streaming, and errors.
- Use Client guides for Claude Code, Codex, OpenCode, Cursor, Cherry Studio, and WorkBuddy.
- Use SDK examples for minimal cURL, Python, and TypeScript code.
- Use Account and billing for Keys, balance, usage, and optional purchase entry points.
