First Request
Prerequisites
- A Chuizi.AI API key (starts with
ck-). See Create Account & API Key if you need one.
Send a Request
Install the SDK for your language. For Python, run pip install openai (or pip install anthropic for the Anthropic SDK). For Node.js, run npm install openai.
Then send a chat completion request. The curl example uses the OpenAI protocol; Python and Node.js use the OpenAI SDK; the last example uses the Anthropic SDK with the native protocol:
terminal
bash
curl https://api.chuizi.ai/v1/chat/completions \ -H "Authorization: Bearer ck-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4-6", "messages": [ {"role": "user", "content": "What is the capital of France?"} ] }'
Verify in the Dashboard
After sending a request, go to app.chuizi.ai and check:
- Logs — your request appears with model, token count, cost, and latency
- Billing — the cost has been deducted from your balance
- Overview — request count and token usage charts update
If the request shows up in the dashboard, your integration is working correctly.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid or missing API key | Check that the key starts with ck- and is correctly set |
402 Insufficient quota | Balance is zero | Top up at app.chuizi.ai/billing |
404 Model not found | Incorrect model name | Use provider/model format (e.g., anthropic/claude-sonnet-4-6) |
429 Rate limited | Too many requests | Wait and retry, or adjust your rate limit settings |
Next Steps
- Choose a Model — find the right model for your use case
- Streaming Guide — detailed streaming implementation
- Error Handling — handle errors gracefully in production