Tawa docs

Error codes

Every status and code the Tawa Guard proxy returns, with the OpenAI and Anthropic error shapes, the meaning of each code and the headers it can set.

Response format

Errors use the provider's own error format, so the official SDKs raise their usual exceptions.

OpenAI shape:

{
  "error": {
    "message": "Invalid or expired TawaGuard proxy token",
    "type": "invalid_request_error",
    "param": null,
    "code": "tawa_invalid_token"
  }
}

Anthropic shape (no code field; the message names the code):

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid or expired TawaGuard proxy token"
  }
}
Statuscode (OpenAI shape)Anthropic error.typeMeaning
400tawa_blockedinvalid_request_errorBlocked by a scan. The message starts with Blocked by TawaGuard.
400tawa_upstream_unresolvedinvalid_request_errorThe provider is not named or is not on the app's list. See Routing rules.
400tawa_provider_not_allowedinvalid_request_errorNone of the requested OpenRouter providers is allowed.
400tawa_provider_policy_invalidinvalid_request_errorThe provider field of the request is not an object.
400tawa_provider_policy_unenforceableinvalid_request_errorThe entry has provider limits and the body is compressed, not JSON or too large.
401tawa_invalid_tokenauthentication_errorToken unknown, revoked, expired or malformed. One response for all four.
404tawa_path_not_proxiednot_found_errorPath is not served.
413tawa_request_too_largeinvalid_request_errorRequest body over the limit.
429tawa_rate_limitedrate_limit_errorA limit above was reached.
502tawa_scan_unavailableapi_errorScan failed and Fallback is closed.
502tawa_upstream_blockedapi_errorThe provider's address is not reachable from the proxy (private or non-HTTPS).
502tawa_upstream_unreachableapi_errorThe proxy could not reach the provider.
503tawa_auth_unavailableapi_errorToken could not be verified. Retry-After: 5.
503tawa_proxy_overloadedapi_errorProcess-wide limit reached. Retry-After: 1.

A blocked response carries the header x-tawa-blocked-stage with the stage that blocked it: prompt, tool-output, tool-call or response.

When a streamed response is blocked after it has started, the status is already 200. The proxy ends the stream with an error event in the same provider format.

Common fixes

CodeWhat to do
tawa_upstream_unresolvedName a provider in the URL or in x-tawa-upstream, or set a Default provider and use /auto. Check the name is on the app's allowed providers.
tawa_provider_not_allowedThe request asked for OpenRouter providers that your provider limits exclude. Ask for a provider the limits allow.
tawa_provider_policy_unenforceableSend the request as uncompressed JSON within the body limit. Remove any Content-Encoding header.
tawa_upstream_blockedUse a public HTTPS address for the custom endpoint. See Custom endpoints.
tawa_path_not_proxiedCall a path that matches the entry's format. See Paths and limits.
tawa_invalid_tokenCheck the token is complete, active and from the right app. See Proxy tokens.

On this page