Installation
This installs
anthropic as a dependency.Chat Agent
UseAnthropicChatAgent for conversational agents with streaming support.
claude-sonnet-4-5-20250929. Override it with the model parameter:
Streaming
Chat agents support streaming out of the box:Task Agent
UseAnthropicTaskAgent for structured output with a defined schema.
Options
The first argument to all Anthropic agent constructors is anAsyncAnthropic client instance.
Agent name. Used as the endpoint identifier.
Anthropic model to use. Defaults to
claude-sonnet-4-5-20250929.Maximum number of tokens to generate.
System prompt for the model.
Agent description for discovery and documentation.
Output schema for task agents. Defines the structured output format.
Tags for filtering and organizing agents.
Additional metadata attached to the agent.
Next steps
Deploying
Ship your Anthropic agent to production.
Configuration & Secrets
Where to put your
ANTHROPIC_API_KEY.OpenAI
Same flow with the OpenAI SDK.
TypeScript: Anthropic
The same integration in TypeScript.