Status codes
Endpoints return appropriate HTTP status codes based on the success or failure of the request in the HTTP status line (e.g.HTTP/1.1 200 OK or HTTP/1.1 400 Bad Request). Common status codes are:
200: Success400: Bad Request (missing parameters, invalid JSON, etc.)404: Not Found (model doesn’t exist, etc.)429: Too Many Requests (e.g. when a rate limit is exceeded)500: Internal Server Error502: Bad Gateway (e.g. when a cloud model cannot be reached)
Error messages
Errors are returned in theapplication/json format with the following structure, with the error message in the error property:
Errors that occur while streaming
If an error occurs mid-stream, the error will be returned as an object in theapplication/x-ndjson format with an error property. Since the response has already started, the status code of the response will not be changed.

