SDK errors can now say your own plan usage limit was reached
SDK 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
What probably matters to youSection of the release
What
The 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:
a plan limit, whether per session, per week or per model
a spend cap on usage credits
When this happens, api_error_params.rate_limit_info says which limit was hit and when it resets.
If the SDK receives an error kind it does not recognise, it now treats the field as empty instead of failing to read the message.
Why
Programs 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.