Error contract#
Errors use { error: { message, type, code } }. Never retry indefinitely.
| HTTP | Code | What to do |
|---|---|---|
| 400 | invalid_request | Fix JSON, required fields or token limits. |
| 401 | invalid_api_key | Check the key and Bearer header; rotate if revoked. |
| 402 | insufficient_balance | Check the qualifying confirmed top-up, available credit and key budget; every new top-up must be at least USD 100. |
| 403 | model_not_allowed | Update the key allowlist or choose an allowed model. |
| 404 | model_not_found | Fetch /v1/models and use an exact ID. |
| 409 | pending_reconciliation | Wait for usage reconciliation before retrying the operation. |
| 413 | request_too_large | Split the input or use a larger context. |
| 422 | unsupported_feature | Choose a deployment that supports the feature. |
| 429 | quota_exceeded | Honor Retry-After if supplied and use bounded retries; no public free-trial quota is offered. |
| 502 | upstream_error | Retry with bounded backoff; check status. |
| 503 | service_unavailable | Check service status and model availability before retrying. |
Avoid duplicate work#
Do not assume an inference request was free because the connection dropped. Check your usage records. Deposits are independently idempotent by provider transaction identity.
Get help#
Use the support guide to diagnose the failing step and prepare a report with the error code, UTC time, model and a synthetic reproduction. The local report tool does not send a ticket. Keep credentials and customer content out of the report.
Request example
curl https://weightsapi.com/v1/chat/completions \
-H "Authorization: Bearer $WEIGHTSAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen3-32B",
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'