> ## Documentation Index
> Fetch the complete documentation index at: https://docs.krixaisecurity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes Reference

> Understanding Krixai API error codes

When Krixai returns an error, the response body will contain a JSON object with an `error` field detailing what went wrong.

### HTTP Error Codes

| HTTP Code | Error Code                  | Meaning                            | What to Do                            |
| --------- | --------------------------- | ---------------------------------- | ------------------------------------- |
| `400`     | `invalid_request`           | Malformed request body             | Check your JSON payload               |
| `401`     | `invalid_krixai_key`        | Missing or invalid `X-Krixai-Key`  | Check your Krixai API key             |
| `401`     | `invalid_llm_key`           | LLM provider rejected your API key | Check your OpenAI/Anthropic key       |
| `403`     | `prompt_injection_detected` | Krixai blocked a prompt injection  | Handle gracefully in your app         |
| `403`     | `jailbreak_detected`        | Krixai blocked a jailbreak attempt | Handle gracefully in your app         |
| `403`     | `pii_detected`              | Krixai blocked PII in input/output | Handle or use `redact` mode instead   |
| `403`     | `custom_rule_triggered`     | A custom rule was triggered        | Review your custom rules config       |
| `429`     | `rate_limit_exceeded`       | Too many requests to Krixai        | Implement backoff; upgrade plan       |
| `502`     | `upstream_error`            | LLM provider returned an error     | Krixai passes through upstream errors |
| `503`     | `krixai_unavailable`        | Krixai is temporarily down         | Implement fallback (direct to LLM)    |
