In the event an issue occurs with our system, or with one of the model providers we integrate with, our API will raise a predictable and interpretable error.

HTTP error codes

Our API will return one of the following HTTP error codes in the event of an issue:

Your request was improperly formatted or presented.

Your API key is incorrect or missing, or your user does not have the rights to access the relevant resource.

The requested resource could not be located.

Modifying the resource would leave it in an illegal state.

Your request was properly formatted but contained invalid instructions or did not match the fields required by the endpoint.

You’ve exceeded the maximum allowed number of requests in a given time period.

An unexpected issue occurred on the server.

The service is temporarily overloaded and you should try again.

Error details

Our prompt/call endpoint acts as a unified interface across all popular model providers. The error returned by this endpoint may be raised by the model provider’s system. Details of the error are returned in the detail object of the response.

1{
2 "type": "unprocessable_entity_error",
3 "message": "This model's maximum context length is 4097 tokens. However, you requested 10000012 tokens (12 in the messages, 10000000 in the completion). Please reduce the length of the messages or completion.",
4 "code": 422,
5 "origin": "OpenAI"
6}
Built with