1. Resources
  2. Error Handling

​
Common Error Scenarios

  1. Missing Required Parameters If your request lacks required parameters for a function, the API will indicate this in the response.

  2. No Suitable Functions If none of the available functions can fulfill your request, the AI will point this out.

  3. Authentication Errors

    {
      "error": {
        "message": "Invalid API key",
        "type": "authentication_error",
        "code": 401
      }
    }
    
  4. Invalid Request Format

    {
      "error": {
        "message": "Invalid request format",
        "type": "invalid_request_error",
        "code": 400
      }
    }
    

​
HTTP Status Codes

200 OK
success

Request was successful and the response body contains the result.

400 Bad Request
error

The request was invalid or cannot be processed. Common causes:

  • Missing required parameters
  • Invalid JSON format
  • Unsupported parameter values
401 Unauthorized
error

Authentication failed. Possible reasons:

  • Invalid or missing API key
  • Expired authentication token
  • Insufficient permissions
429 Too Many Requests
error

Rate limit exceeded. The response will include:

  • Retry-After header indicating when to retry
  • Rate limit details in the response body
500 Internal Server Error
error

An unexpected error occurred on the server side. If this persists, contact support.