{"version":1,"codes":{"TIMEOUT":"Request or upstream provider timed out. Retry later. Response includes retry_after_seconds (~20).","CONTENT_FILTERED":"Output blocked by safety/content moderation. Rephrase the prompt.","CONTENT_POLICY_HELD":"Prompt violates content policy (e.g. sexualizing or endangering a minor) and was not run. Payment is HELD, not auto-refunded. This is not a rephrase-and-retry: request a human review at /appeal (1 sat). Response includes `held:true`, `appeal_url`, `recover_url`.","RATE_LIMITED":"Too many requests. Wait and retry. Response includes retry_after_seconds (~10).","INVALID_INPUT":"Request parameters were rejected. Fix and resubmit.","SERVICE_ERROR":"Generic upstream service failure. Try a different model or contact support.","PAYMENT_NOT_FOUND":"No payment exists with this paymentId. Pass the exact paymentId returned by create_payment.","PAYMENT_PENDING":"The Lightning invoice has not been paid yet. Pay it, then retry with the same paymentId. Response includes retry_after_seconds (~5).","PAYMENT_ALREADY_USED":"Each payment covers one tool call and this one is spent. Call create_payment again.","L402_INVALID_PARAMS":"Pre-payment validation failed. No invoice was created; no sats charged.","L402_UPSTREAM_FAILED":"Upstream provider failed after payment. Refund issued via LNURL-withdraw.","L402_REFUND_ISSUED":"Response payload includes a `refund` object with an LNURL-withdraw link.","L402_DEDUP_HIT":"Identical request was served from the dedup cache. No new payment required.","L402_AUTO_ROUTED":"Request was routed via model:'auto'. The chosen model id is in the X-Route-Model header.","L402_ESTIMATE_ONLY":"This response is a price estimate from /api/estimate-cost. No invoice was created.","L402_CALLBACK_INVALID":"callback_url was rejected. Must be public HTTPS (no loopback / private ranges). Polling still works.","BOOK_QUALITY_CHECK_FAILED":"Source EPUB chapters failed runtime sanity checks (empty, undecoded HTML entities, mojibake, parser overlap, or wrong language). Refund issued. Webhook payload includes `smoke_failures` with per-chapter detail.","OUTPUT_DURATION_INSANE":"Rendered audiobook reports an impossible duration (>24h) — usually mixed audio formats from upstream TTS providers corrupting the AAC metadata. Refund issued. Webhook payload includes `output_duration_seconds`."},"response_envelope":{"error":"string — human-readable message (provider names stripped)","error_code":"string — one of the keys in `codes` above","suggestion":"string — what the agent should do next","example":"string — concrete next-action example","retry_after_seconds":"number — present for TIMEOUT and RATE_LIMITED only; how long to back off before retrying","refund":"object — present when a post-payment failure triggered an LNURL-withdraw refund; contains lnurl_withdraw, amount_sats (refund_amount is a deprecated alias), refund_secret, status, charge_id"},"docs_url":"https://sats4ai.com/docs#error-codes"}