Error types & status codes
The API uses standard HTTP status codes to indicate the success or failure of a request. Errors will always return:- An appropriate HTTP status code (
4xxor5xx) - A JSON response body containing:
status: the HTTP status codeerror: a human-readable error messagesupport_id: a unique reference ID you can provide to support for debugging
The
support_id fields are kept in our systems only up to a week, be sure to reach out to us within that time window or they might get lost.Common error codes
| Code | Description |
|---|---|
400 | Bad Request – The request was malformed or contained invalid parameters. |
401 | Unauthorized – Authentication failed. Your API key may be missing or incorrect. |
403 | Forbidden – You’re authenticated but don’t have permission to perform the requested action. |
404 | Not Found – The resource you are trying to access does not exist. |
406 | Not Acceptable – The requested response format is not supported (JSON is required). |
429 | Too Many Requests – You’ve exceeded your request quota. Retry after the time specified in the Retry-After header |
500 | Internal Server Error – An unexpected error occurred on our side. These are rare. |
503 | Service Unavailable – The system is temporarily offline (e.g., during maintenance). |
Rate-limiting
If your application sends too many requests in a short period, you may receive a 429 Too Many Requests error. Rate-limiting may be applied by:- BitGPT’s infrastructure
- Cloudflare, our edge network
- HTTP status code 429
- A JSON response with status, error, and support_id
- Optional Retry-After header or field to indicate when you can try again
Rate limits
Check out the rate limit specs, how they work and what you can do to increase them.
Best Practices
- Always check the status and error fields in responses, even for non-200 statuses.
- Log the
support_idfor every request and surface it in error reports, this helps us assist you faster. - Handle
5xxerrors gracefully using retries with exponential backoff. - Double-check authentication for
401and403errors, ensure your API key is valid and has the required scopes. - Back off properly on
429rate limit errors, —do not hammer the server.
Debugging Tips
- Use tools like curl, Postman, or HTTP clients with logging to inspect full request/response cycles.
- Ensure the request is targeting the correct endpoint, using the correct HTTP method (
GET,POST, etc.). - Validate that your request body matches expected structure and content types (e.g.,
application/json). - Refer to the Authentication and API Keys pages for access-related details.
support_id shown in the error response to help us resolve the issue quickly.
