{"version":"2.1.305","anchor":"set-model-errors-split-into-finer-reason-codes","canonical_anchor":"set-model-errors-split-into-finer-reason-codes","heading":"Failed model changes now report a more specific reason","tier":"notice","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305\/e\/set-model-errors-split-into-finer-reason-codes","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305","markdown":"### Failed model changes now report a more specific reason\n\nWhen a controlling program's request to change the model fails, Claude Code now reports a finer reason, such as rate limit or failed sign-in\n\n**What**\n\nA program that drives Claude Code, such as one built with the SDK (the toolkit for building on Claude Code), can ask it to switch models. When that request fails, the reason it gets back is now more specific. The listed reasons are:\n\n- `not_found`\n\n- `check_rejected`, when the API returned an error that no retry or sign-in clears\n\n- `credits_required`\n\n- `rate_limit`\n\n- `auth_failed`\n\n- `verdict_pending`, which is not a refusal: the outcome follows as a separate informational message\n\n- `internal_error`\n\nThese reasons also cover settings changes sent through `apply_flag_settings`. Sign-in errors, errors a retry will not fix, and rate limits (too many requests) are now told apart. A \"forbidden\" error is treated as worth retrying only when `CLAUDE_CODE_REMOTE` is set or the session is otherwise remote.\n\n**Why**\n\nPrograms that control Claude Code can now tell why a model change failed and react to it, for example by waiting out a rate limit or asking the user to sign in again.\n\n- Area: SDK\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}