Under the hood
API error responses now carry structured error codes like pdf_too_large alongside plain-text messages
What
When the API returns a rate-limit or invalid-request error, Claude Code now attaches a structured apiError code identifying the specific cause, in addition to the existing free-text error message. New codes include:
model_requires_usage_creditslong_context_credits_requiredpdf_too_largepdf_password_protected
Why
Structured error codes let Claude Code (and anything reading these errors) distinguish specific failure causes, such as an oversized or password-protected PDF, rather than relying only on parsing a text message.