Addis AI

Errors

Troubleshooting API errors and status codes.

The Addis AI API uses standard HTTP response codes to indicate the success or failure of an API request.

In general:

  • 2xx indicates success.
  • 4xx indicates an error that failed given the information provided (e.g., a required parameter was omitted, or a key was invalid).
  • 5xx indicates an error with Addis AI's servers.

Error Object

When an error occurs, the API returns a JSON object with a detailed message and a machine-readable code.

{
    "status": "error",
    "error": {
        "code": "invalid_api_key",
        "message": "Invalid or expired API key."
    }
}

Prop

Type


HTTP Status Codes

CodeStatusMeaning
200OKEverything worked as expected.
400Bad RequestThe request was unacceptable, often due to missing a required parameter.
401UnauthorizedNo valid API key provided.
403ForbiddenThe API key doesn't have permissions to perform the request.
402Payment RequiredYour wallet balance is too low to cover the request. Top up and retry.
404Not FoundThe requested resource (e.g., Model ID) doesn't exist.
409ConflictThe request conflicts with the current state: a request ID reused with different input, or a Scribe job that is finished or no longer takes parts.
413Payload Too LargeThe request body is over its limit. See request size limits.
422Unprocessable EntityThe request is well formed but cannot be used, such as an invalid setting, an empty or unreadable audio file, or a Scribe language other than am, om, ti, ha, sid, wal or sw (UNSUPPORTED_LANGUAGE).
429Too Many RequestsThe service is temporarily at capacity, or your account is temporarily limited. See Rate Limits.
500Server ErrorSomething went wrong on Addis AI's end.
503Service UnavailableThe engine is currently overloaded. Please retry.

Handling Errors Programmatically

You should wrap your API calls in a try/catch block to handle exceptions gracefully.

import AddisAI from "addisai";

const addis = new AddisAI();

try {
  const response = await addis.chat.completions.create({
    messages: [{ role: "user", content: "ሰላም" }],
  });
  console.log(response.choices[0].message.content);
} catch (error) {
  const status =
    typeof error === "object" && error !== null && "status" in error
      ? error.status
      : undefined;

  if (status === 429) {
    // Retry with bounded exponential backoff and jitter.
  } else {
    throw error;
  }
}
from addisai import AddisAI

addis = AddisAI()

try:
    response = addis.chat.completions.create(
        messages=[{"role": "user", "content": "ሰላም"}],
    )
    print(response["choices"][0]["message"]["content"])
except Exception as error:
    status = getattr(error, "status", None)
    if status == 429:
        # Retry with bounded exponential backoff and jitter.
        pass
    else:
        raise

Common Issues

401 Unauthorized

Cause: Your X-API-Key header is missing or incorrect.

Fix: Ensure there are no extra spaces in your key. Check if you accidentally revoked the key in the dashboard.

400 Bad Request

Cause: Invalid JSON format or missing required fields (like target_language).

Fix: Validate your JSON structure. Ensure request_data is stringified when using multipart forms.

429 Rate Limit

Cause: The model is temporarily at capacity, or account protection is limiting unusual traffic. There are no fixed per-plan quotas.

Fix: Implement exponential backoff (wait and retry). Contact sales before sustained high-volume traffic.

500 / 503 Errors

Cause: Temporary issue with the Addis AI inference engine or heavy load.

Fix: Retry the request after a short delay. If the issue continues, check Addis AI Status. If all systems are operational, contact support@addisassistant.com and include the endpoint, status code, request ID, and approximate request time.

Edit on GitHub

Last updated on

On this page