Improvements / v2.1.274
Link raw API bodies to requests
CHANGELOG · original
Improved OTEL_LOG_RAW_API_BODIES=file:<dir> output: a new index.jsonl and request_body_id / message.id event attributes link each response to its request file and transcript message Open official changelog ↗ Documentation
Documentation excerpt
API response body event
Logged for each successful API response when OTEL_LOG_RAW_API_BODIES is set.
In file mode (OTEL_LOG_RAW_API_BODIES=file:<dir>), Claude Code also appends one JSON line to <dir>/index.jsonl for each successful response, with the fields timestamp, session_id, query_source, model, request_id, message_id, message_uuid, request_file, and response_file. Read it to find the request and response files behind a given transcript message without querying your telemetry backend. The index file requires Claude Code v2.1.274 or later.
Event Name: claude_code.api_response_body
Attributes:
- All standard attributes
event.name:"api_response_body"event.timestamp: ISO 8601 timestampevent.sequence: per-process counter for ordering events, described under Event correlation attributesbody: JSON-serialized Messages API response, including the id, content blocks, usage, and stop reason, truncated at the content limit (60 KB by default). Extended-thinking content is redacted. Emitted only in inline mode (OTEL_LOG_RAW_API_BODIES=1).body_ref: Absolute path to a<dir>/<request_id>.response.jsonfile containing the untruncated body. Emitted only in file mode (OTEL_LOG_RAW_API_BODIES=file:<dir>).body_length: Untruncated body length. UTF-8 bytes whenOTEL_LOG_RAW_API_BODIES=file:<dir>, or UTF-16 code units when=1body_truncated:"true"when inline truncation occurred. Absent in file mode and when no truncation occurred.model: Model identifierquery_source: Subsystem that issued the requestrequest_id: Anthropic API request ID from the response'srequest-idheader, such as"req_011...". Present only when the API returns one.request_body_id: Therequest_body_idof theapi_request_bodyevent that this response answers. Requires Claude Code v2.1.274 or latermessage.id: Message ID the API assigned to the response, theidfield of the response body. Requires Claude Code v2.1.274 or latermessage.uuid: UUID of the response's final transcript entry. Together withrequest_body_id, it links a transcript message to the request and response bodies behind it. Requires Claude Code v2.1.274 or later
Documentation snapshot · 2026-09-23