Error codes
Business APIs use a unified envelope. On failure, meta.credits_charged is always 0 (not billed).
| HTTP | code | Meaning | Billed |
|---|---|---|---|
| 400 | 40001 | Bad parameters | No |
| 401 | 40101 | Missing / invalid key | No |
| 402 | 40201 | Insufficient credits | No |
| 403 | 40301 | IP / scope | No |
| 404 | 40401 | Endpoint or resource not found | No |
| 422 | 42201 | Quality gate failed | No |
| 429 | 42901 | Rate limited | No |
| 500 | 50001 | Internal / cost guard | No |
| 502 | 50201 / 50202 | Upstream / schema mismatch | No |
| 503 | 50301 / 50302 | Maintenance / no route | No |
| 504 | 50401 | Upstream timeout | No |
Success: code = 0, HTTP 200.
Tracing with request_id
Every response (including errors) includes X-Request-Id or meta.request_id.
1. Console → Request logs (/console/logs)
2. Search by request_id
3. Review billing explanation and failure rule
4. Still stuck? Contact support with the request_id
42201 · Quality gate
Triggered when upstream returns 200 but required fields are empty or workflow quality rules fail. Not billed.
{
"code": 42201,
"message": "quality",
"data": null,
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"endpoint": "xiaohongshu.note.detail",
"credits_charged": 0,
"failed_rule": "required_field:author.id",
"elapsed_ms": 412
}
}
Next: Try valid params; check failed_rule in logs; contact support with request_id.
40101 · Invalid key
Use the full secret (not the stored prefix). Recreate a key in the console if needed.
40201 · Insufficient credits
Top up in console billing. Check meta.credits_balance.
42901 · Rate limit
Reduce QPS or request a higher quota.