Skip to main content
Sometimes, requests to the API are not successful. There are a variety of reasons why this might happen, for example some resources may under maintenance, or you may have exceeded your rate limit. You can always find services status on our status page.

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.
codeMeaningDescription
200OKIf data was requested, it will be available in the data field at the top level of the response body.
201CreatedIts 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.
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.
403ForbiddenThe 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.
404Not FoundThe 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.
422Unprocessable EntityThe request was well-formed but was unable to be followed due to semantic errors. This can occur if a parameter is invalid or missing.
429Too Many RequestsThe request could not be completed due to rate limiting. See Rate Limit for more information.
451Unavailable For Legal ReasonsThe user requested a resource that cannot legally be provided, such as a resource that tedi should not have access to.
500Internal Server ErrorAn 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.
503Service UnavailableThe 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.
In the event of a server error, the response body will contain an error phrase. These phrases are automatically generated and can be used by Evergreen Developers to quickly look up the incident that caused the server error.

Examples

Missing authorization header

You must include your API key in the Authorization header of your request with the format Bearer tedi_[YOUR_API_KEY].
HTTP
POST https://api.evergreens.ai/v1/completions HTTP/1.1
Authorization: Bearer tedi_[YOUR_API_KEY]
If you do not include this header, you will receive a 401 Not Authorized response.
HTTP
HTTP/1.1 401 Not Authorized
{
    "status": false,
    "error": "Authorization header missing"
}

2FA Required

If you have not enabled Two-Factor Authentication (2FA) on your account, you will receive a 403 Forbidden response when trying to access the API.
{
    "status": false,
    "error": "Starting October 13, 2025, Two-Factor Authentication (2FA) is required to access the API. Please enable it by logging in to your dashboard: https://dashboard.evergreen.ai",
    "docs": "https://docs.evergreens.ai/docs/en/api-reference/errors#2fa-required"
}

Validation error

A validation error occurs when the request is well-formed but contains invalid parameters or is missing required parameters. usually methods such as POST or PUT require a request body with specific fields.
HTTP
POST https://api.evergreens.ai/v1/completions HTTP/1.1
{
    "messages": [
        {
            "role": "user"
        }
    ]
}
For example, if you omit the content field from a message in a chat completion request, you will receive a 422 Unprocessable Entity response.
HTTP
HTTP/1.1 422 Unprocessable Entity
{
    "status": false,
    "error": "Validation failed",
    "errors": {
        "messages": "messages[0] is missing required property 'content'"
    }
}

Evergreen had a problem

Sometime the server encounters an unexpected condition that prevents it from fulfilling the request. In this case, you will receive a 500 Internal Server Error response.
HTTP
POST https://api.evergreens.ai/v1/completions HTTP/1.1
{
    "model": "evergreen-xyz",
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}
HTTP
HTTP/1.1 500 Internal Server Error
{
    "status": false,
    "error": "Internal Error",
}