Error Codes
Understanding API errors and reason codes
HTTP Status Codes
| Status | Error | Description |
| 400 | validation_error | Invalid request parameters |
| 401 | unauthorized | Invalid or missing API key |
| 403 | forbidden | API key lacks permission |
| 404 | not_found | Endpoint not found |
| 429 | rate_limit_exceeded | Too many requests |
| 500 | internal_error | Server error |
| 503 | service_unavailable | Temporary outage |
Error Response Format
{
"error": "validation_error",
"message": "Missing required field: actions",
"request_id": "req_xxxxx"
}
Decision Reason Codes
| Code | Constant | Description |
| 0 | OK | Action approved |
| 1 | NO_VALID_ACTION | All actions failed thresholds |
| 2 | SAFETY_VETO | Safety constraint violated |
| 3 | MISSION_VETO | Mission constraint violated |
| 4 | ETHICS_VETO | Ethics constraint violated |
Handling Rate Limits
try:
result = ata.decide(actions=[0, 1, 2])
except RateLimitError as e:
time.sleep(60) # Wait and retry
result = ata.decide(actions=[0, 1, 2])