Error Handling
The API uses standard HTTP status codes and returns detailed error messages.
400 Bad Request
{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error",
"code": "invalid_parameter"
}
}401 Unauthorized
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}429 Too Many Requests
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}Check the Retry-After header for when to retry.