ClaudeZH Developer Docs

Integration guide, code examples, and API reference

1. API Reference

Base URLhttps://api.claudezh.cc/v1
AuthAuthorization: Bearer YOUR_API_KEY
Request formatJSON
Response formatJSON / SSE (streaming)

Supported endpoints

POST/v1/chat/completionsChat completion
POST/v1/responsesResponses API
GET/v1/modelsList available models

2. 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's sk- 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

ModelTypeContext windowNotes
gpt-5.4Chat / Code1M tokensLatest flagship
gpt-5.4-miniChat / Code128K tokensFast & lightweight
gpt-5.2Chat / Code256K tokensBalanced performance
gpt-5 / gpt-5.1Chat / Code128K tokensStable 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

CodeMeaningFix
401Invalid or missing API KeyCheck your key is correct and not expired
402Insufficient creditTop up your balance or upgrade your plan
429Rate limit exceededSlow down your request rate and retry
500Internal server errorRetry later; contact support if it persists
503Service temporarily unavailableUpstream 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]