GitHubDocsCocode Nut
Checking sign-in status
Documentation中文

Start here

Start with your first Cocode task

Quickstart

Quickstart

Guides

GUI desktop workspaceTUI terminal interface

Core concepts

Core conceptsPermissions and approvals

Models and teams

Cocode Nut model serviceTeams and organizations

Developers

API overview

Reference and help

CLI and shortcuts referenceTroubleshooting
Cocode Docs / API overview

API overview

Cocode exposes account, organization, model, inference, Connector, and download APIs. Inference endpoints include OpenAI-compatible entry points for existing tools.

Base URL and authentication

The production API base URL is https://cocode.agency/v1. Create a personal API key in the account center and send it as Authorization: Bearer $COCODE_API_KEY. The raw key is shown only once; default personal scopes are models:read and inference:write.

Models and inference

curl https://cocode.agency/v1/models \
  -H "Authorization: Bearer $COCODE_API_KEY"

curl https://cocode.agency/v1/chat/completions \
  -H "Authorization: Bearer $COCODE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"<model-id>","messages":[{"role":"user","content":"Hello"}]}'

The main entry points are GET /models, POST /chat/completions, and POST /responses; both inference APIs support streaming. Send Idempotency-Key when an operation needs idempotent retry behavior.

/responses currently has non-persistent create semantics. Do not assume support for the full OpenAI Responses storage, background, conversation, or previous_response_id lifecycle.

Usage and extension APIs

Usage is available through /me/model-usage and /me/model-usage/events with time windows, model, project, and cursor pagination. It does not return prompts or provider keys. Account, organization, Connector, and download routes follow the OpenAPI contract; Connector OAuth requires the corresponding account authorization.

Errors use an OpenAI-compatible error/problem contract. Never commit API keys; prefer environment variables or a secret manager for server-side integrations.

Recommended path

  1. Create and store a personal API key.
  2. List available models.
  3. Send a non-streaming request.
  4. Enable streaming.
  5. Implement error and rate-limit handling.
Documentation is continuously updated.support@cocode.agency