- Resources
- Error Handling
Resources
Error Handling
Handle errors and understand HTTP status codes
Common Error Scenarios
-
Missing Required Parameters If your request lacks required parameters for a function, the API will indicate this in the response.
-
No Suitable Functions If none of the available functions can fulfill your request, the AI will point this out.
-
Authentication Errors
{ "error": { "message": "Invalid API key", "type": "authentication_error", "code": 401 } } -
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-Afterheader 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.