ClaudeZH Developer Docs
Integration guide, code examples, and API reference
1. API Reference
Base URL
https://api.claudezh.cc/v1Auth
Authorization: Bearer YOUR_API_KEYRequest format
JSONResponse format
JSON / SSE (streaming)Supported endpoints
POST
/v1/chat/completions—Chat completionPOST
/v1/responses—Responses APIGET
/v1/models—List available models2. Authentication
Include your API Key in every request header:
Authorization: Bearer ck-xxxxxxxxxxxxxxxx
- •Create your API Key in the dashboard. It is shown only once — save it immediately.
- •Keys are prefixed with
ck-, similar to OpenAI'ssk-format.
3. Code Examples
from openai import OpenAI
client = OpenAI(
api_key="ck-your-api-key",
base_url="https://api.claudezh.cc/v1"
)
response = client.chat.completions.create(
model="gpt-5.4",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)4. Supported Models
| Model | Type | Context window | Notes |
|---|---|---|---|
| gpt-5.4 | Chat / Code | 1M tokens | Latest flagship |
| gpt-5.4-mini | Chat / Code | 128K tokens | Fast & lightweight |
| gpt-5.2 | Chat / Code | 256K tokens | Balanced performance |
| gpt-5 / gpt-5.1 | Chat / Code | 128K tokens | Stable classic |
5. Billing
✓Pay-as-you-go: billed per token consumed
✓Cache hits are charged at 1/10 the normal rate — up to 90% savings
✓Subscription plans: monthly quota + daily cap, unlimited calls within quota
✓Unlimited plan (coming soon): 1.39× list price, no quota limits
✓Usage breakdown available in real-time from your dashboard
✓1 token ≈ 4 English characters or 1–2 CJK characters
6. Error Codes
| Code | Meaning | Fix |
|---|---|---|
| 401 | Invalid or missing API Key | Check your key is correct and not expired |
| 402 | Insufficient credit | Top up your balance or upgrade your plan |
| 429 | Rate limit exceeded | Slow down your request rate and retry |
| 500 | Internal server error | Retry later; contact support if it persists |
| 503 | Service temporarily unavailable | Upstream maintenance — retry shortly |
7. FAQ
Is it fully compatible with the OpenAI API?
Yes. It is compatible with the OpenAI SDK — just change base_url to migrate seamlessly without touching any other code.
Is my data safe?
We do not store any request or response data. All traffic is encrypted in transit.
Is streaming supported?
Yes. Add stream: true to your request parameters to enable SSE streaming.
How do I get help?
Email [email protected] and we will get back to you promptly.
Still have questions? Reach us at [email protected]