Status Code Mapping
Status Code Mapping
When an upstream model service returns an error, Chuizi.AI maps it into a consistent public error shape. Internal upstream error details are stored server-side for troubleshooting and audit, not exposed directly to clients.
| Case | Gateway status | Meaning |
|---|---|---|
| User key invalid | 401 | Your ck- key failed authentication |
| User balance insufficient | 402 | Wallet balance is insufficient |
| Key policy blocked | 403 | Model, IP, or daily cap policy blocked the request |
| Model unavailable or unpublished | 404 | Check available models with GET /v1/models |
| Too many requests | 429 | Key-, user-, or model-level limit reached |
| Model service auth/config issue | 502 | Service configuration or model access issue |
| Upstream 5xx | 502/503/504 | Upstream error, unavailable service, or timeout |
Public responses do not expose upstream keys, accounts, regional priority, or full failover chains.