Set up Your own code (curl / Python / Node)
One key, three APIs: OpenAI Chat, Responses and Claude Messages. Just change the base URL in the official SDKs
- API format: OpenAI Chat Completions
- Base URL format: Up to /v1 (https://gpt.cherrychat.org/v1)
- Recommended model: gpt-6.1-sol, claude-sonnet-5-5, deepseek-v4-flash
- Platforms: macOS, Windows, Linux
Steps
Note the three settings
The same key works with all three formats. With the OpenAI SDKs the base URL ends in /v1; with the Anthropic (Claude) SDKs it is the domain only.
- Base URL (OpenAI format): https://gpt.cherrychat.org/v1 (For both Chat and Responses)
- Base URL (Anthropic format): https://gpt.cherrychat.org (Domain only; the SDK adds /v1/messages)
- API key: sk-your-key
- Model name: gpt-6.1-sol
Test with curl first
Run it in a terminal. A JSON reply containing "content" means the URL and key are correct.
Python (OpenAI SDK)
Run pip install openai, save the code as demo.py and run python demo.py. The second half streams the reply as it is generated.
Node.js (OpenAI SDK)
Run npm install openai, save the code as demo.mjs and run node demo.mjs (Node.js 18 or later).
Native Claude format (Anthropic SDK)
For existing Anthropic SDK code, change only base_url and api_key; note the address is the domain only. Install with pip install anthropic or npm install @anthropic-ai/sdk.
Responses API
OpenAI's newer Responses API works too, at https://gpt.cherrychat.org/v1/responses.
List available models
The response lists every model name this key can use.
curl https://gpt.cherrychat.org/v1/models -H "Authorization: Bearer sk-your-key"
Common pitfalls
- OpenAI SDKs use /v1 (https://gpt.cherrychat.org/v1); Anthropic SDKs use the domain only (https://gpt.cherrychat.org). Do not swap them.
- Never hard-code the key in code you commit. The OpenAI SDKs read OPENAI_BASE_URL / OPENAI_API_KEY and the Anthropic SDKs read ANTHROPIC_BASE_URL / ANTHROPIC_API_KEY from the environment.
- Built-in Responses tools (web_search, file_search, code_interpreter, etc.) and background mode are not supported yet; implement browsing yourself with function calling.
- Check the Models page for which formats each model supports; model names are all lowercase.
- The last streamed chunk may carry only usage and no text, so check for empty content (the samples do).
- Mind concurrency in batch jobs: by default 120 requests per minute per key and 8 at a time per account.
Error → cause → fix
| What you see | Why | What to do |
|---|---|---|
| HTTP 401 (invalid api key / authentication_error) | The key is wrong, contains spaces or a newline, or was disabled | Copy the key again from My Keys; with env variables, make sure the old value is not still loaded |
| HTTP 404 Not Found | The OpenAI SDK URL lacks /v1, or the Anthropic SDK URL has an extra /v1 (/v1/v1/messages) | Use https://gpt.cherrychat.org/v1 for OpenAI SDKs and https://gpt.cherrychat.org for Anthropic SDKs |
| Model not found (model_not_found) | The model name is wrong, or the model does not support this API format | Use a name from step 7, or a model the Models page marks as supporting this format |
| HTTP 402 or "insufficient balance" (billing_error in Claude format) | Your credits cannot cover this call. API calls are paid from credits only; memberships and unlimited plans do not apply | Top up any amount in the CherryChat Store, then retry after a few seconds |
| HTTP 403: IP or model not allowed | This key has an IP allowlist or an allowed-models list that excludes the current IP or model | Edit the key under My Keys on the API page and adjust or remove the limit |
| HTTP 429 Too Many Requests | Too many requests: by default 120 per minute per key and 8 at a time per account | Lower the concurrency or requests per second in the tool and wait for the Retry-After seconds; most tools retry on their own |
Guide checked 2026-11-02. The tool's screens may change; the official docs win if they differ.
Operated by UK Company CHERRYCHAT LTD · Company Number 16096119 · Support WeChat: JsnonoChat · Content is AI-generated — please verify before relying on it
