Error Codes
The API uses standard HTTP status codes and a consistent JSON error shape. Always check the status code and, when present, theerror (and optional message or details) field for details.
HTTP Status Codes
| Code | Meaning | When it occurs |
|---|---|---|
200 | OK | Request succeeded. |
400 | Bad Request | Invalid body, missing required fields, or invalid format (e.g. dataset, model ID). |
401 | Unauthorized | Missing or invalid API key; authentication required. |
402 | Payment Required | Insufficient balance. Add funds in the dashboard. |
403 | Forbidden | API key valid but not allowed for this resource (e.g. key scoped to another model). |
404 | Not Found | Model, job, or resource not found or not active. |
429 | Too Many Requests | Rate limit exceeded. See Rate limits. |
500 | Internal Server Error | Unexpected server error; retry with backoff. |
503 | Service Unavailable | Backend or dependency unavailable (e.g. INFRA_API_URL not configured). |
504 | Gateway Timeout | Request took too long (e.g. inference timeout). |
Error Response Format
Failed responses return JSON in this shape:error (or error.message) and HTTP status code for handling; details may contain extra context when available.
Common Errors
401 Unauthorized
- Cause: No
Authorizationheader, or API key invalid/revoked. - Fix: Create an API key in the dashboard and send
Authorization: Bearer sk_....
402 Payment Required
- Cause: User balance too low for inference or training.
- Fix: Add funds via the billing/usage section in the dashboard.
403 Forbidden
- Cause: API key is scoped to a specific deployed model and the request targets a different model.
- Fix: Use a universal API key or the key that matches the requested model.
404 Not Found
- Cause: Model ID not found, model not active, or job ID invalid.
- Fix: Verify the model is deployed and active, or the job ID exists for your workspace.
429 Too Many Requests
- Cause: Rate limit exceeded for that endpoint and IP.
- Fix: Wait for the time given in
Retry-Afterand retry; consider batching or reducing concurrency.
500 / 503
- Cause: Server or upstream (e.g. inference backend) error.
- Fix: Retry with exponential backoff; if persistent, check status or contact support.
Next Steps
- Rate limits for 429 behavior and limits
- Authentication for API key setup
- API Overview for base URL and usage