Status Codes
A comprehensive guide to API status codes used in Mixedbread's responses. Learn about common codes, their meanings, and best practices for error handling and debugging to optimize your API integration experience.
Status codes in API responses indicate success or failure. This guide explains common codes and how to handle them, helping you troubleshoot API issues effectively.
Common Status Codes
Code | Meaning | Description |
---|---|---|
200 | OK | Request successful. Response contains requested data. |
401 | Unauthorized | Missing or invalid auth credentials, or insufficient user permissions. |
402 | Payment Required | Valid request, but account needs balance top-up or valid payment method. |
403 | Forbidden | User lacks necessary permissions for the requested resource. |
404 | Not Found | Requested resource doesn't exist or can't be found at the given URL. |
422 | Validation Error | Issue with request parameters. Check input and retry. |
429 | Too Many Requests | Rate limit exceeded. Response includes retry timing info. |
500 | Internal Server Error | Unexpected server-side error. Retry later. |
503 | Service Unavailable | Temporary service outage. Retry later. |
504 | Gateway Timeout | Server response timeout. Possible network issues or overload. Retry later. |
Error Handling Best Practices
- Always check the status code before processing the response body.
- Implement retry logic for 5xx errors and 429 responses.
- Log detailed error information for debugging, including request parameters and full error responses.
- Use appropriate error messages in your app's UI to guide users.
- Handle authentication errors (401) by prompting for re-authentication or refreshing tokens.
Debugging Tips
- For 4xx errors, carefully review your request parameters and authentication.
- For 5xx errors, check our status page for any known issues before contacting support.
For more detailed information on specific errors or advanced error handling strategies, refer to our API reference documentation or contact our developer support team.