HTTP status codes
Unfortunately, sometimes requests to the API are not successful. Failures can occur for a wide range of reasons. In all cases, the API should return an HTTP response status code that indicates the nature of the failure (below), with a response body in JSON format containing additional information.| code | Meaning | Description |
|---|---|---|
200 | OK | If data was requested, it will be available in the data field at the top level of the response body. |
201 | Created | Its information is available in the data field at the top level of the response body. The API URL where the object can be retrieved is also returned in the Location header of the response. |
400 | Bad Request | This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again. |
401 | Unauthorized | A valid authentication token was not provided with the request, so the API could not associate a user with the request. |
403 | Forbidden | The request is understood, but it has been refused or access is not allowed. This can occur if the user does not have the necessary permissions for a resource. |
404 | Not Found | The requested resource could not be found. This can occur if the resource does not exist or if the user does not have access to it. |
422 | Unprocessable Entity | The request was well-formed but was unable to be followed due to semantic errors. This can occur if a parameter is invalid or missing. |
429 | Too Many Requests | The request could not be completed due to rate limiting. See Rate Limit for more information. |
451 | Unavailable For Legal Reasons | The user requested a resource that cannot legally be provided, such as a resource that tedi should not have access to. |
500 | Internal Server Error | An error occurred on the server. This is usually a temporary condition and may be resolved by retrying the request. If the problem persists, please contact support. |
503 | Service Unavailable | The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state. in this case you should retry the request or check our status page. |
Examples
Missing authorization header
You must include your API key in theAuthorization header of your request with the format Bearer tedi_[YOUR_API_KEY].
HTTP
401 Not Authorized response.
HTTP
2FA Required
If you have not enabled Two-Factor Authentication (2FA) on your account, you will receive a403 Forbidden response when trying to access the API.
Validation error
A validation error occurs when the request is well-formed but contains invalid parameters or is missing required parameters. usually methods such asPOST or PUT require a request body with specific fields.
HTTP
content field from a message in a chat completion request, you will receive a 422 Unprocessable Entity response.
HTTP
Evergreen had a problem
Sometime the server encounters an unexpected condition that prevents it from fulfilling the request. In this case, you will receive a500 Internal Server Error response.
HTTP
HTTP

