Skip to main content
A
Docs

Error Codes

HTTP status codes, product-specific error codes, and error response format reference.

Error Response Format

All Anar products return errors in a consistent JSON format:

{
  "error": "Human-readable error message"
}

Validation errors include additional detail:

{
  "error": "Validation error",
  "details": [
    {
      "loc": ["body", "text"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

HTTP Status Codes

Success Codes

CodeNameUsage
200OKStandard success for GET, PUT, PATCH requests
201CreatedResource successfully created (POST)
204No ContentResource successfully deleted (DELETE)

Client Error Codes

CodeNameError MessageCause
400Bad Request"Invalid request body"Malformed JSON, missing required fields
401Unauthorized"Invalid authentication token"Missing, expired, or malformed JWT
403Forbidden"Role 'X' not authorized. Requires: Y, Z"Valid JWT but insufficient permissions
404Not Found"Resource not found"Requested ID does not exist
409Conflict"Resource already exists"Duplicate name, ID collision
413Payload Too Large"Request body too large. Maximum: 10MB"Request body exceeds size limit
422Unprocessable Entity"Validation error"Request body fails schema validation
429Too Many Requests"Rate limit exceeded. Try again later."Per-IP rate limit exceeded

Server Error Codes

CodeNameError MessageCause
500Internal Server Error"Internal server error"Unhandled exception in the backend
502Bad Gateway"Upstream provider error"AI provider returned an error (via Gateway)
503Service Unavailable"Service starting up"Backend is initializing or shutting down
504Gateway Timeout"Request timed out"AI provider did not respond within timeout

Product-Specific Errors

Gateway

ErrorCodeDescription
"Unknown model: <model>"400Requested model is not configured in any provider
"All providers failed"502Every provider in the fallback chain returned an error
"Provider rate limited"429Upstream AI provider rate limit hit
"Invalid API key"401Gateway API key validation failed
"RBAC: insufficient scope"403API key lacks required scope for the model

Chat

ErrorCodeDescription
"Knowledge base not found"404Referenced knowledge base ID does not exist
"Conversation not found"404Referenced conversation ID does not exist
"Embedding generation failed"502Embedding provider returned an error during RAG ingest
"Document too large for ingestion"413Uploaded document exceeds ingestion size limit

Guard

ErrorCodeDescription
"Policy not found"404Referenced policy ID does not exist
"Scan failed: model unavailable"502Llama Guard model returned an error
"Invalid policy rule format"422Policy rule definition fails validation
"Webhook delivery failed"502Alert webhook could not be delivered
"Compliance framework not supported"400Requested framework is not available

Voice

ErrorCodeDescription
"Unsupported audio format"400Audio file format is not supported (use WAV, MP3, M4A, FLAC)
"Transcription failed"502Whisper model returned an error
"Audio too long"413Audio file exceeds maximum duration
"Language not supported"400Requested language code is not available

Docs

ErrorCodeDescription
"Unsupported file type"400File type is not supported for processing
"OCR failed: all providers exhausted"502Azure, EasyOCR, and Tesseract all failed
"File too large"413File exceeds MAX_FILE_SIZE_MB
"Document processing failed"500Internal error during document extraction

Translate

ErrorCodeDescription
"Unsupported language pair"400Source/target language combination is not supported
"Glossary not found"404Referenced glossary ID does not exist
"TMX import failed"422TMX file format is invalid
"Translation memory full"507Translation memory storage limit reached

Flow

ErrorCodeDescription
"Workflow not found"404Referenced workflow ID does not exist
"Maximum steps exceeded"400Workflow exceeds FLOW_MAX_WORKFLOW_STEPS
"Step execution failed"500A workflow step threw an unhandled error
"Circular dependency detected"422Workflow graph contains a cycle

Comply

ErrorCodeDescription
"Framework not found"404Compliance framework definition not found
"Assessment in progress"409An assessment is already running for this scope
"Guard integration unavailable"502Guard service is unreachable

Eval

ErrorCodeDescription
"Benchmark not found"404Referenced benchmark suite does not exist
"Evaluation timed out"504Evaluation run exceeded time limit
"Model not available"502Target model returned an error during evaluation

Present

ErrorCodeDescription
"Template not found"404Referenced presentation template does not exist
"Export failed"500PPTX or PDF generation failed
"Slide limit exceeded"400Presentation exceeds maximum slide count

Minutes

ErrorCodeDescription
"Meeting not found"404Referenced meeting ID does not exist
"Audio upload failed"500Audio file storage failed
"Transcription in progress"409Transcription is already running for this meeting

Procure

ErrorCodeDescription
"Tender not found"404Referenced tender ID does not exist
"Bid scoring failed"500Scoring engine returned an error
"Invalid scoring criteria"422Scoring criteria definition is invalid

Agents

ErrorCodeDescription
"Agent not found"404Referenced agent ID does not exist
"Execution limit reached"429Agent exceeded maximum execution steps
"Tool execution failed"500Agent tool call returned an error

Insights

ErrorCodeDescription
"Dataset not found"404Referenced dataset does not exist
"Query execution failed"500Analytics query failed
"Row limit exceeded"400Query returned more rows than MAX_QUERY_ROWS

Handling Errors in Client Code

Python

import httpx

async def safe_request(url: str, token: str):
    async with httpx.AsyncClient() as client:
        response = await client.get(
            url,
            headers={"Authorization": f"Bearer {token}"},
        )
        if response.status_code == 401:
            # Token expired or invalid — re-authenticate
            raise AuthenticationError("Token invalid")
        if response.status_code == 429:
            # Rate limited — back off and retry
            retry_after = int(response.headers.get("Retry-After", 60))
            await asyncio.sleep(retry_after)
            return await safe_request(url, token)
        response.raise_for_status()
        return response.json()

TypeScript

async function apiRequest(url: string, token: string): Promise<any> {
  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${token}` },
  });

  if (!response.ok) {
    const body = await response.json();
    if (response.status === 401) {
      throw new Error("Authentication failed");
    }
    if (response.status === 429) {
      throw new Error("Rate limited, retry later");
    }
    throw new Error(body.error || `HTTP ${response.status}`);
  }

  return response.json();
}