Skip to content
Docs/API Reference/Error Codes

HTTP Error Codes

Complete reference for every HTTP status code the Guardrail API returns, with causes and resolution steps.

200OK

Evaluated. Read status and risk_score from the body. The X-LLMFence-Source header names which stage produced the verdict.

Resolution: Nothing to do. A 200 does not mean the text was approved — check the body.
400Bad Request

The request body could not be parsed as JSON.

Resolution: Send a JSON body and set Content-Type: application/json.
401Unauthorized

The API key is missing, malformed or revoked. A key that never existed and one that was revoked return the same response, deliberately — the difference is not something we disclose.

Resolution: Send `Authorization: Bearer sk_...`. If the key was revoked, mint a new one in the dashboard.
402Payment Required

A limit you control, not a problem with the key. Either the included calls are exhausted on a plan that stops rather than charging, or the monthly spend cap has been reached.

Resolution: Raise the spend cap or change plan in the billing dashboard. The message names which limit was hit.
403Forbidden

The account is suspended.

Resolution: Contact support. Retrying will not help.
413Payload Too Large

proposed_text is longer than your plan's maximum request size.

Resolution: Split the text and check the parts, or move to a plan with a larger request size.
422Unprocessable Entity

proposed_text is missing or empty, or agent_id is not 1-128 characters of [A-Za-z0-9_.-]. The message never echoes the value received.

Resolution: Send a non-empty proposed_text string. agent_id is optional.
429Too Many Requests

The per-minute ceiling for your plan. The request is not counted toward your included calls and is not charged.

Resolution: Wait the number of seconds in the Retry-After header, then retry once. A tight retry loop consumes the next window as it opens.
503Service Unavailable

Authorisation could not be completed. The API fails closed rather than serving a request it could not authenticate, so this is never a silently-approved call.

Resolution: Retry with exponential backoff starting at two seconds. Contact support if it persists.

Handling errors in production

For non-critical AI outputs, we recommend a fail-open strategy: if Guardrail returns a 5xx error, pass the content through rather than breaking your user experience. For high-stakes scenarios (medical, legal, financial), implement fail-closed and serve a safe fallback message.