Skip to content
v0.8.4stable

Gateway error codes and handling

This reference covers the public Gateway data plane and Run Governance, not Admin form validation. OpenAI-shaped endpoints and Run Governance expose error.code; the Anthropic facade has no error.code, so branch on HTTP status and error.type. Record the Request ID on both facades. message is a redacted human explanation, not a stable protocol field.

The same code can use different HTTP statuses at different stages; every observed status is listed. The same status does not imply the same handling.

Request, identity, and capability
codeHTTPMeaning and handling
invalid_api_key401Key is missing, malformed, invalid, or revoked; repair the credential and do not retry the same value
gateway_key_scope_denied403Key lacks the required Scope; an administrator must issue a least-privilege Key
model_not_allowed403Project is not authorized for the public alias
source_not_allowed403Source address is outside the Project allowlist
model_not_found404Public Route alias does not exist
invalid_request_error400Body, field combination, or endpoint semantics are invalid; change the request before retrying
invalid_forwarded_for400X-Forwarded-For in the trusted proxy chain cannot be parsed safely; repair proxy configuration
request_too_large400, 413400 can mean one multipart field is too large; 413 means the entire request exceeds the instance or Project limit
unsupported_feature400, 501Route/Profile cannot represent the request; 501 only means deferred execution is unavailable on this instance
streaming_unsupported500Current HTTP writer cannot stream safely; retain the Request ID and notify the administrator
endpoint_not_implemented404Path is outside Halro’s supported surface; choose an endpoint from the compatibility reference
method_not_allowed405Known path does not accept this HTTP method
route_required400File creation omitted the Halro-Route header
ambiguous_resource_route409A resource Route has no unique eligible Deployment
token_limit_exceeded400Per-request input or output token ceiling rejected the request
native_redaction_incompatible400Redacting the native-protocol body would change its semantics, so Halro fails closed
streaming_redaction_incompatible400Current streaming request cannot be combined safely with configured redaction
Idempotency and resource state
codeHTTPMeaning and handling
invalid_idempotency_key400Key is empty or violates format or length requirements
idempotency_conflict409Same Key was used for a different body or attribution; do not hide the conflict with a new Key
idempotency_in_progress409Same create operation is running or indeterminate; query a returned resource ID, otherwise retry with the same Key, body, and attribution under a bound
resource_not_found404Resource does not exist, belongs to another Project, or was deleted
resource_owner_unavailable409Target bound when the resource was created cannot continue the operation
resource_store_unavailable503Local resource state cannot be read or written safely; retry under a bound and notify the administrator
provider_cancel_unsupported409Upstream has no provable cancellation operation; do not treat the task as stopped
response_not_found404Deferred Response is absent, belongs to another Project, or passed retention
deferred_response_in_flight409Response is still running and this operation requires a terminal state
deferred_response_not_cancellable409Current state cannot be cancelled
deferred_response_route_unavailable409Original target bound to the deferred task cannot be restored
deferred_response_unreadable500Stored deferred result cannot be read safely; stop repeating the operation and notify the administrator
Budget, pricing, and rate limits
codeHTTPMeaning and handling
budget_exceeded403Project daily budget cannot reserve this request; it did not reach a Provider and blind retry is useless
run_budget_exceeded403Run lifecycle balance is insufficient; adjust the request or close the Run
price_unavailable409, 503409 means the request needs a known price or candidate prices conflict; 503 means effective pricing could not be read. Never coerce either to zero cost
token_guard_blocked403Fixed threshold or temporary block; change request/policy or wait for its TTL according to details
rate_limit_exceeded429Source or Project RPM; honor Retry-After with bounded backoff when present
token_rate_limit_exceeded429Project TPM is full
concurrency_limit_exceeded429Project concurrency is full
deployment_concurrency_limit_exceeded429Deployment concurrency is full
provider_concurrency_limit_exceeded429Every eligible Provider target is at its concurrency ceiling
Run Governance
codeHTTPMeaning and handling
invalid_run_id400X-Halro-Run-ID is malformed
run_governance_disabled403Project has not enabled Run Governance
run_not_found404Run is absent or belongs to another Project
run_not_active409Run is closed or expired
run_governance_unavailable503Governance authority cannot be verified; Halro fails closed and the administrator must recover it
unsupported_content_type415Governance write endpoint requires application/json
invalid_request400Governance body cannot be decoded or violates the endpoint shape
invalid_outcome_definitions400Outcome Definition count, uniqueness, format, or enabled state is invalid
work_unit_not_found404Work Unit or its Definition is absent or belongs to another Project
invalid_outcome400Outcome has no matching frozen Definition or the value is invalid
outcome_revision_conflict409supersedes_outcome_id is not the current revision; read the latest Outcome first
outcome_write_closed409Outcome write window has closed
governance_unavailable503Outcome governance state cannot be read or written safely; Halro fails closed
invalid_run400Run budget or TTL exceeds Project limits
invalid_close_reason400Close reason is outside the 1–64 character range
governance_rate_limited429Per-Key Governance API request rate exceeded
governance_resource_limit429Project reached its Run Governance resource count limit
work_unit_closed409Work Unit is closed and cannot accept this write
Content policy and Provider
codeHTTPMeaning and handling
content_rejected400File or audio failed content policy
sensitive_data_detected400, 502400 is an inbound rejection; 502 means an upstream or resource result cannot be delivered safely
sensitive_output_detected422Provider returned content but output redaction refused delivery; the call may already be billable
policy_error503Policy state cannot be read or executed safely
redaction_policy_error500Internal redaction failure; stop automatic retries and notify the administrator
provider_authentication_error502Upstream rejected Halro’s Provider credential; administrator must repair the Credential
provider_rate_limit429Upstream throttled; Retry-After exists only when the Provider supplied a parseable value
provider_timeout504Upstream result is indeterminate and may be billable; do not treat a resend as free
provider_error502Upstream or response conversion failed; inspect the Attempt by Request ID and preserve uncertain cost state
provider_unavailable503No healthy eligible Deployment; use bounded backoff and inspect Route state

Accounting, configuration, and internal state

Section titled “Accounting, configuration, and internal state”
Accounting, configuration, and internal state
codeHTTPMeaning and handling
accounting_error503Accounting operation failed and Halro refuses to call the Provider
accounting_unavailable503Reservation or settlement cannot complete safely; stop unbounded retries and notify the administrator
configuration_stale503Management change persisted but new configuration did not activate safely; data plane fails closed
internal_error500Internal gateway failure; retain the Request ID for the administrator to inspect logs, state, and integrity
  1. Save Request ID, HTTP status, and the facade’s error.code or error.type; never log the Key or request body.
  2. For 400, 401, 403, and 404, normally repair the request, permission, or configuration before retrying.
  3. For 409, read the resource or current state first. If idempotency_in_progress returns no resource ID, retry with the same Key, body, and attribution under bounded backoff. Preserve the Key and escalate persistent conflicts instead of changing it.
  4. For 429, honor Retry-After when present; otherwise use jittered application backoff and a maximum attempt count.
  5. A 502, 504, or disconnect can represent a Provider Attempt and cost that already happened; inspect Usage before resending.
  6. Accounting, governance, policy, or configuration_stale 503 means safe authority is unknown. Let the administrator recover it instead of creating a second failure with unbounded retries.

/v1/messages and /v1/messages/count_tokens return an Anthropic-shaped envelope with top-level type, error, and request_id. error has type and message but no code. Halro maps the final HTTP status as follows:

Anthropic facade error types
HTTPerror.type
401authentication_error
403permission_error
404not_found_error
413request_too_large
429rate_limit_error
500, 502, 504api_error
503overloaded_error
Actual upstream 529overloaded_error
Every other status, including 400, 409, 415, 501invalid_request_error

An Anthropic client therefore cannot read the preceding code table directly from the response. Map HTTP and error.type to the same retry and human-response policy.

See Authentication, request headers, and errors for the envelope, Request ID, and Scopes, and Daily operations, integrity checks, and alerts for production investigation.