messages.create(...).
Install
AVERTA_API_KEY from the environment. Pass avertaApiKey only when this client should use a different Averta key.
Wrap the Client
Send a Guarded Message
Add Tools
tool_use blocks, Averta has already checked those tool calls before your app receives them. When your app sends tool_result blocks back, Averta checks those results before Anthropic sees them.
Confirm Decisions
With an allowing policy and a tool call, Events should show a sequence like:tool_call and tool_result. The SDK generates requestId and traceId automatically; pass requestContext only when you need your own conversationId, requestId, or traceId.
Runnable Example
The SDK repository includes a complete Anthropic Messages tool-loop example:ANTHROPIC_API_KEY and AVERTA_API_KEY in examples/.env before running it.
Current Limit
Anthropic streaming is not supported yet. Streaming calls fail closed before provider execution. Use non-streamingmessages.create(...) for guarded Anthropic flows today.
Next Steps
Messages API
Understand the guarded Anthropic surface.
Tools
Learn how tool exposure and tool-call checks work.
Tool results
Screen returned tool content before continuation calls.
Events
Investigate decisions in the dashboard.