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
| Code | Status | Meaning |
|---|---|---|
| 200 | OK | Everything worked as expected. |
| 400 | Bad Request | The request was unacceptable, often due to missing a required parameter. |
| 401 | Unauthorized | No valid API key provided. |
| 403 | Forbidden | The API key doesn't have permissions to perform the request. |
| 404 | Not Found | The requested resource (e.g., Model ID) doesn't exist. |
| 429 | Too Many Requests | You have hit your rate limit or quota. |
| 500 | Server Error | Something went wrong on Addis AI's end. |
| 503 | Service Unavailable | The engine is currently overloaded. Please retry. |
Handling Errors Programmatically
You should wrap your API calls in a try/catch block to handle exceptions gracefully.
try {
const response = await fetch("https://api.addisassistant.com/api/v1/chat_generate", {
// ... options
});
if (!response.ok) {
const err = await response.json();
console.error(`API Error: ${err.error.code} - ${err.error.message}`);
// Handle specific codes
if (response.status === 401) {
alert("Please check your API Key.");
}
return;
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error("Network Error:", error);
}import requests
response = requests.post("https://api.addisassistant.com/api/v1/chat_generate", json={...})
if response.status_code != 200:
error_data = response.json()
print(f"Error {response.status_code}: {error_data['error']['message']}")
if response.status_code == 429:
print("Rate limit hit. Sleeping...")
else:
print(response.json())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: You are sending requests too fast for your plan (e.g., >60 RPM on Free).
Fix: Implement exponential backoff (wait and retry). Contact sales to increase limits.
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 persists, check our status page.