Errors
Learn about error handling in the Meibel AI API
Error Handling
The Meibel AI API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx
range indicate success, codes in the 4xx
range indicate an error due to the information provided (e.g., a required parameter was missing), and codes in the 5xx
range indicate an error with our servers.
HTTP Status Codes
Code | Description |
---|---|
200 - OK | The request was successful. |
201 - Created | The resource was successfully created. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
403 - Forbidden | The API key doesn’t have permissions to perform the request. |
404 - Not Found | The requested resource doesn’t exist. |
409 - Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
422 - Validation Error | The request was well-formed but was unable to be processed due to semantic errors. |
429 - Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 - Server Errors | Something went wrong on our end. (These are rare.) |
Error Response Format
All API errors include a standard JSON response body that provides detailed information about the error:
Field | Description |
---|---|
message | A human-readable message providing details about the error. |
type | The type of error returned. |
code | A machine-readable code specifying the error type. |
param | If the error is parameter-specific, the parameter related to the error. |
request_id | A unique identifier for the request. This is helpful when contacting support. |
Common Error Types
Authentication Errors
Validation Errors
Rate Limit Errors
Error Handling in SDKs
Our official SDKs handle errors by throwing exceptions that you can catch and process:
Tips for Error Handling
Always implement proper error handling in your application to provide a good user experience and facilitate debugging.
Implement retry logic
Use exponential backoff for retrying failed requests, especially for rate limit errors (429)
Log request IDs
Always log the request_id
from error responses to help with troubleshooting
Handle expected errors
Handle common error cases gracefully in your application
Provide user feedback
Translate API errors into helpful messages for your users
Getting Help
If you’re experiencing persistent errors or need help debugging an issue:
- Ensure you have the complete error message and request ID
- Check if there are any service disruptions on our status page
- Contact our support team at support@meibel.ai with details about the error