Skip to main content

Errors

Errors before the stream opens are JSON with an HTTP status. Errors after it has opened arrive as {"type":"error","message":"..."} inside the stream — by then the status line is already 200 and cannot be changed.

Statuses

StatuscodeCauseDo
400Validation. Missing text, unknown register, bad modeFix the request
400notes_too_shortfromNotes with too little to work fromGive it more notes
401unauthorizedBad or revoked API keyCheck the key. Do not retry
402quota_exceededIncluded allowance gone, no wallet fallbackWait for resetAt, or upgrade
402credits_requiredAllowance gone and the wallet is shortBuy credits
402expand_promode: "expand" on a non-Pro planUpgrade, or use rewrite
413word_capDraft is longer than the plan's per-request capSplit the draft
413Body too large — text or previousRewrite over the byte limitSplit the draft
429rate_limitToo many requests per minuteBack off, respect the headers
429concurrencyToo many rewrites in flight for the planWait for one to finish
503kill_switchHUMANIZE_DISABLED is setNothing. Try later
503spend_capDaily spend breaker trippedNothing. Try later

The 402 body

{
"error": "Your included allowance is used and your credit balance is too low.",
"code": "credits_required",
"reason": "credits",
"plan": "free",
"resetAt": "2026-09-01T00:00:00.000Z",
"upgrade": true,
"buyCredits": true,
"requiredCredits": 4,
"creditBalance": 1,
"usage": { "requests": 40, "inputTokens": 198234 }
}

reason is requests, tokens, or credits — which limit you actually hit. upgrade and buyCredits say which routes out exist for this subject; an API key owned by an anonymous subject cannot buy credits, so buyCredits is false.

Retrying

  • 429 — back off. Concurrency clears in seconds; a rate limit clears at the minute boundary.
  • 503 — retry with a long delay. Both causes are operator-side and neither clears because you asked again.
  • 401, 400, 402 — do not retry the same request. Nothing about it will change on its own.
  • A mid-stream error event — safe to retry once. Partial output before it is incomplete, not wrong; discard it.

What you will not get

There is no error that means your draft was rejected on content. The endpoint does not moderate, classify, or refuse drafts. If something fails, it is a limit, a credential, or the service.