API Reference
OpenAI-compatible API
The OpenAI-compatible Base URL is https://api.51cowork.com/v1; Key and model still come from Dashboard.
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
Chat Completions
Chat Completions
bashcurl "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.
Responses
Responses
bashcurl "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.
Migrate an OpenAI SDK
- 1Keep the existing SDK and business code.
- 2Set base_url to https://api.51cowork.com/v1.
- 3Set api_key to the current full Key from Dashboard.
- 4Call /v1/models and replace the model ID.
- 5Start with a minimal non-streaming request before tools or streaming.
