ERRORS

Public error and refusal contract

Versioned customer-facing classes. Internal routing and provider detail are not returned.

Contract id whoisjohngalt.public-api.errors.v1. Always log x-request-id.

Shape

Structured JSON

{ "error": { "message": "human-readable summary", "type": "authentication_error | invalid_request_error | server_error", "param": null, "code": "stable_machine_code", "request_id": "uuid-from-x-request-id" } }

Auth

401 authentication_error

Missing or invalid access key. Send Authorization: Bearer <key>. Code: invalid_api_key. No inference runs.

Validation

400 invalid_request_error

Malformed JSON, unsupported parameters, or contract validation failures. Check the param field when present.

Not found

404 not_found

Unknown endpoint or unknown model id. Do not retry the same path.

Rate limit

429 rate_limited

Respect Retry-After when provided. Reduce request rate, then retry with backoff. Code may be rate_limit_exceeded.

Refusal / fallback

Policy decline is a first-class outcome

Some prompts are declined by policy. Treat refusal as terminal for that prompt content. Narrow the request or choose an admitted job from GET https://api.whoisjohngalt.ai/v1/jobs.

Chat-style responses may include a refusal stop signal when the request was authenticated and declined. Do not confuse refusal with 5xx availability failures.

Availability

5xx server_error

Temporary service failure. Retry with bounded backoff. Do not interpret opaque bodies as provider identity.