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 error | No |
| 502 | 50201 / 50202 | Source error / schema mismatch | No |
| 503 | 50301 / 50302 | Maintenance / temporarily unavailable | No |
| 504 | 50401 | Collection 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 collection 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
Returned when request rate exceeds quota. Not billed.
Default quotas
- Per API Key: 50 RPS (max 50 requests per second)
- Per endpoint: 10 RPS (max 10 requests per second to a single endpoint)
Both limits apply independently; hitting either triggers 42901.
Special cases
- Zero-topup / never-recharged API Keys may drop to 1 RPS to ensure fair resource allocation.
- Soft-throttle 429 responses may not appear in request logs, but
X-Request-Idis still provided for troubleshooting.
Example response
{
"code": 42901,
"message": "rate_limit",
"data": null,
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"credits_charged": 0,
"retry_after_ms": 1000
}
}
Next steps:
1. Verify request rate is within quota (50 RPS / 10 RPS per endpoint)
2. Implement exponential backoff retry strategy
3. Contact sales for higher quota if needed