51cowork APIDocs
Open docs navigation

Guides

Configure and update API Keys

A 51cowork API Key authenticates model calls; it is not an account-management token.

Quick answer

Key creation, listing, and deletion follow the current Dashboard. Verify replacement configuration before deleting an old Key.

Create
Dashboard
Copy
Store safely once
Update
Verify replacement
Store
Secret / local file
01

Environment variables

Terminalbash
export COWORK_GATEWAY_URL="https://api.51cowork.com"
export COWORK_API_KEY="<key-from-dashboard>"
export COWORK_MODEL="<model-from-v1-models>"

Environment variables are useful for local tests and service injection. Production should use a Secret Manager or deployment Secret.

02

Configuration files

  • Claude Code uses user-level settings.json.
  • Codex uses config.toml and auth.json.
  • OpenCode uses user-level opencode.json.
  • Save and update API Keys in the model settings of Cursor, Cherry Studio, and WorkBuddy.
  • Restrict each file so only the current user can read it.
03

Key update checklist

  1. 1Create or select a replacement Key in Dashboard.
  2. 2Update every Secret.
  3. 3Fully restart clients that cache credentials.
  4. 4Send a minimal request and verify it in Usage.
  5. 5Delete the old Key after migration is complete.