51cowork APIDocs
Open docs navigation

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.

Quick answer

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
01

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.
02

Four core concepts

ConceptPurposeSource of truth
AccountRegistration, sign-in, and sessionDashboard
API KeyAuthenticate model requestsAPI Keys page
ModelsCurrent callable model IDs/v1/models
GatewayReceive model requestshttps://api.51cowork.com
03

First request in five steps

  1. 1Register or sign in to Dashboard.
  2. 2Create and copy an API Key from the API Keys page.
  3. 3Select a model through https://api.51cowork.com/v1/models.
  4. 4Set the environment variables below and send a smoke request.
  5. 5Verify tokens and cost in Dashboard usage records.
Terminalbash
export COWORK_GATEWAY_URL="https://api.51cowork.com"
export COWORK_API_KEY="<key-from-dashboard>"
export COWORK_MODEL="<model-from-gateway>"
04

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.

GET /v1/modelsbash
curl "$COWORK_GATEWAY_URL/v1/models" \
  -H "Authorization: Bearer $COWORK_API_KEY"
05

Choose a request format

FormatEndpointBest fit
Anthropic MessagesPOST /v1/messagesAnthropic SDK and Claude Code
OpenAI Chat CompletionsPOST /v1/chat/completionsOpenCode, Cursor, Cherry Studio, WorkBuddy
OpenAI ResponsesPOST /v1/responsesCodex 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.

06

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.