anthropic.resources.messages.Messages.create and its async counterpart, intercepting every call to the Messages API.
Requirements
| Requirement | Version |
|---|---|
anthropic SDK | any recent release |
| Python | ≥ 3.9 |
What gets patched
Non-streaming
Streaming
actguard readsmessage_start (input tokens) and message_delta (output tokens) SSE events and records usage after the stream is exhausted.
