{"version":"2.1.334","anchor":"new-typed-api-error-kinds-prompt-too-long-request-too-larg","canonical_anchor":"new-typed-api-error-kinds-prompt-too-long-request-too-larg","heading":"SDK errors now name four more causes, including prompt too long","tier":"internal","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/new-typed-api-error-kinds-prompt-too-long-request-too-larg","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### SDK errors now name four more causes, including prompt too long\n\nSDK results gain four typed error causes, and prompts too large for the model are now reported as prompt_too_long\n\n**Unclear.** Only `prompt_too_long` is known to be reported; when the other three labels are actually sent is not stated.\n\n**What**\n\nThe SDK lets other programs run Claude Code and read its results. When an API request fails, the result can carry a typed error kind, a fixed label for the cause. Four labels were added:\n\n- `prompt_too_long`: the request does not fit the model's context window.\n\n- `request_too_large`: the request is too large.\n\n- `no_credential`: Claude Code had no credential to send.\n\n- `token_revoked`: the API refused the request because the sign-in's OAuth token was revoked.\n\nA 400 or 413 invalid-request error now carries `prompt_too_long`, where before it had no typed kind. Each cause also maps to a suggested fix: `no_credential` and `token_revoked` point to fixing your setup, and `prompt_too_long` points to making room.\n\n**Why**\n\nPrograms built on Claude Code can react to these causes directly instead of reading the error message text.\n\n- Area: SDK\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}