Skip to main content

Error Codes

Standard error responses across all Zihin API endpoints.

Error Format

{
error: string; // Error code
message: string; // Human-readable description
status: "error";
details?: object; // Additional context (optional)
}

Authentication Errors

CodeHTTP StatusDescription
authentication_required401No authentication provided
invalid_api_key401API key is invalid or expired
invalid_token401JWT token is invalid or expired
insufficient_permissions403User lacks required role

Rate Limiting Errors

CodeHTTP StatusDescription
rate_limit_exceeded429Too many requests
quota_exceeded429Monthly/daily quota reached
token_limit_exceeded429Token pack exhausted

Request Errors

CodeHTTP StatusDescription
invalid_request400Malformed request body
model_not_found400Specified model doesn't exist
agent_not_found404Agent ID not found
tenant_not_found404Tenant ID not found

Provider Errors

CodeHTTP StatusDescription
provider_error502LLM provider returned an error
provider_timeout504LLM provider didn't respond in time
provider_unavailable503LLM provider is down

Handling Errors

# Example error response
HTTP/1.1 401 Unauthorized
{
"error": "invalid_api_key",
"message": "The provided API key is invalid or expired",
"status": "error"
}

For 429 errors, check the Retry-After header for when to retry.