Modules
An Anthropic-focused API client built on Req.
The Managed Agents Agents API: define reusable, versioned agent configurations (model, system prompt, tools, MCP servers, skills).
Raised when no API key can be resolved. ReqAnthropic checks, in order
The Message Batches API: submit large volumes of Messages requests for asynchronous processing at a 50% discount.
Helpers for managing the anthropic-beta request header.
Internal builder used by every resource module. It guarantees that all resource calls share the same option-resolution and step-attachment pipeline, so cross-cutting concerns (auth, error decoding, test stubs) live in exactly one place.
A small client-side helper for multi-turn Messages conversations.
The Managed Agents Environments API: configure container templates (packages, network policy) that sessions run inside.
Normalized error returned by ReqAnthropic when the Anthropic API responds with a non-2xx status, or when the client itself fails before sending.
The Files API: upload files for use across multiple requests.
The Messages API: send prompts to Claude, count tokens, and stream responses as parsed events.
Struct representation of an Anthropic model and its capabilities.
Per-model capability flags. Anthropic doesn't currently expose these on
GET /v1/models, so the table is hard-coded here. Update this module
when models change.
The Models API: list available Claude models, retrieve a specific model, and look up per-model capabilities.
Parsed rate-limit metadata from Anthropic API response headers.
Returned when the Anthropic API responds with HTTP 429 (Too Many Requests).
Minimal Server-Sent Events parser used by streaming endpoints.
The Managed Agents Sessions API: run stateful agent sessions against an environment. Covers session lifecycle, event submission, event history, and the SSE event stream.
Builders for Anthropic tool definitions, so callers don't need to memorize tool type strings or beta header names.
The Managed Agents Vaults API: store third-party credentials that
sessions can use to authenticate with MCP servers at runtime. Credentials
themselves are managed by ReqAnthropic.Vaults.Credentials.
Credentials nested under a vault. Each credential binds to a single
mcp_server_url and provides auth material (static bearer token or
OAuth refresh config) that the session runtime injects when the agent
connects to the MCP server.