{"version":"2.1.292","anchor":"new-typed-api-error-kind-usage-limit-reached","canonical_anchor":"new-typed-api-error-kind-usage-limit-reached","heading":"SDK errors can now say your own plan usage limit was reached","tier":"use","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292\/e\/new-typed-api-error-kind-usage-limit-reached","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292","markdown":"### SDK errors can now say your own plan usage limit was reached\n\nSDK error messages gain a usage_limit_reached kind for refusals caused by your plan limit or usage-credit spend cap, with which limit and when it resets\n\n**What**\n\nThe Agent SDK lets programs run Claude Code. The kinds of error its messages can report in `api_error` now include `usage_limit_reached`. It means the request was refused because of your account's own limit:\n\n- a plan limit, whether per session, per week or per model\n\n- a spend cap on usage credits\n\nWhen this happens, `api_error_params.rate_limit_info` says which limit was hit and when it resets.\n\nIf the SDK receives an error kind it does not recognise, it now treats the field as empty instead of failing to read the message.\n\n**Why**\n\nPrograms using the SDK can tell that a plan limit was hit, rather than a rule set by an organization, the server slowing requests down, or a rate limit on an API key, without having to read the error text. An unfamiliar error kind no longer breaks reading the whole message.\n\n- Area: SDK\n- Names: `usage_limit_reached`, `api_error`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}