Skip to main content
This guide provides a reference for all HTTP error codes with the following error response format:
{
  "error": {
    "message": "Human-readable error message",
    "type": "error_type_identifier",
  }
}

Authentication Errors

If authentication fails, you will receive the following error response:
This error occurs when your API key is missing, invalid, or expired.
{
  "error": {
    "message": "Invalid authentication credentials",
    "type": "authentication_error",
  }
}
Common causes:
  • Missing Authorization header.
  • API key is not properly formatted (missing “Bearer” prefix).
  • Incorrect API key format.
  • Expired or revoked API key.
Troubleshooting:
  • Verify that your API key is correct.
  • Make sure that the Authorization header is present: Authorization: Bearer YOUR_FORTYTWO_API_KEY.
  • Contact support if the issue persists.

Model Errors

{
  "error": {  
    "message": "Model not found.",  
    "type": "model_not_found"  
  }  
}
Common causes:
  • The model ID is incorrectly defined.
Troubleshooting:
  • Use the models endpoint GET /v1/models to find IDs of currently available models.

Chat Completion Errors

Validation Errors

Returned when the request body is invalid or contains validation errors.
{
  "error": {  
    "message": "Missing required field: messages",  
    "type": "invalid_request_error"
  }  
}
Common causes:
  • Messages array is empty.
  • Invalid message role (must be: system, user, or assistant).
  • Required fields missing.
  • Type mismatches (e.g. string instead of number).
Troubleshooting:

Rate Limiting Errors

Returned when rate limits or usage quotas are exceeded.
{  
  "error": {  
    "message": "Too many concurrent requests. Retry after <X>s.",  
    "type": "rate_limit_exceeded"  
  }  
}  
Common causes:
  • More than X simultaneous active requests.
  • Queue is full: you already have X requests waiting in queue.
Troubleshooting:
  • Wait for the timeout to expire.
  • Refer to your personal quotas and limits for preview access to keep within the limits.
{
  "error": {  
    "message": "Daily quota exceeded. Resets at <Datetime>.",  
    "type": "rate_limit_exceeded"  
  }  
}
Common causes:
  • Exceeded daily request limit.
Troubleshooting:
  • Wait for the quota reset at midnight UTC.
  • Refer to your personal quotas and limits for preview access to keep within the limits.
{
  "error": {  
    "message": "Monthly quota exceeded. Resets at <Datetime>.",  
    "type": "rate_limit_exceeded"  
  }  
}
Common causes:
  • Exceeded monthly request limit.
Troubleshooting:
  • Wait for the quota reset at midnight UTC on the 1st of each month.
  • Refer to your personal quotas and limits for preview access to keep within the limits.

Internal Server Errors

Returned when an unexpected error occurs on the server.
{  
  "error": {  
    "message": "Internal server error",  
    "type": "internal_error"  
  }  
}  
Common causes:
  • Connection failure.
  • Unexpected exception in the server logic.
  • Serialization/deserialization errors.
Troubleshooting:
  • Try again later.
  • Contact support if the issue persists.

Support

If you encounter any issues or have questions about the API: