Unclear When api_error is actually filled in is not stated.
What
The Agent SDK lets programs run Claude Code. The result message it returns at the end of a run now includes an api_error field when one is present. Before, it carried only api_error_status and api_error_code.
Why
Programs using the SDK get more detail about an API error.
Names in the bundleapi_error
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed since
Anthropic's documentation has since written up api_error, on Configure a custom OpenTelemetry collector.
| `office_agent.api_error` | Each model call that is refused, fails, is cut off, or that the user stops |office-agents/opentelemetry see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
When `api_error` is actually filled in is not stated.
Anthropic's documentation agrees
Anthropic's documentation has since written up api_error, on Configure a custom OpenTelemetry collector.