51cowork APIDocs
Open docs navigation

API Reference

OpenAI-compatible API

The OpenAI-compatible Base URL is https://api.51cowork.com/v1; Key and model still come from Dashboard.

Quick answer

Use the /v1 Base URL in OpenAI SDKs. Direct HTTP requests use complete /v1/chat/completions or /v1/responses paths.

Chat
POST /v1/chat/completions
Responses
POST /v1/responses
Base URL
https://api.51cowork.com/v1
Auth
Bearer
01

Chat Completions

Chat Completionsbash
curl "https://api.51cowork.com/v1/chat/completions" \
  -H "Authorization: Bearer <key-from-dashboard>" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model-from-v1-models>","messages":[{"role":"user","content":"Hello"}]}'

Common fields are model, messages, stream, and options explicitly supported by the target model.

02

Responses

Responsesbash
curl "https://api.51cowork.com/v1/responses" \
  -H "Authorization: Bearer <key-from-dashboard>" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model-from-v1-models>","input":"Hello"}'

Responses is the wire API used by the Codex configuration. Enable additional fields only when both client and model support them.

03

Migrate an OpenAI SDK

  1. 1Keep the existing SDK and business code.
  2. 2Set base_url to https://api.51cowork.com/v1.
  3. 3Set api_key to the current full Key from Dashboard.
  4. 4Call /v1/models and replace the model ID.
  5. 5Start with a minimal non-streaming request before tools or streaming.