Skip to main content

Installation

pip install reminix-anthropic
This installs anthropic as a dependency.

Chat Agent

Use AnthropicChatAgent for conversational agents with streaming support.
from anthropic import AsyncAnthropic
from reminix_anthropic import AnthropicChatAgent
from reminix_runtime import serve

client = AsyncAnthropic()

chatbot = AnthropicChatAgent(client, name="chatbot", instructions="You are a helpful assistant.")

serve(agents=[chatbot])
The default model is claude-sonnet-4-5-20250929. Override it with the model parameter:
chatbot = AnthropicChatAgent(
    client,
    name="chatbot",
    model="claude-opus-4-5-20250929",
    max_tokens=8192,
    instructions="You are a helpful assistant.",
)

Streaming

Chat agents support streaming out of the box:
from reminix import Reminix

client = Reminix()

stream = client.agents.chat(
    "chatbot",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)

for event in stream:
    if event.type == "text_delta":
        print(event.delta, end="", flush=True)

Task Agent

Use AnthropicTaskAgent for structured output with a defined schema.
from anthropic import AsyncAnthropic
from reminix_anthropic import AnthropicTaskAgent
from reminix_runtime import serve

client = AsyncAnthropic()

analyzer = AnthropicTaskAgent(
    client,
    name="analyzer",
    max_tokens=1024,
    instructions="Analyze the sentiment of the given text.",
    output_schema={
        "type": "object",
        "properties": {
            "sentiment": {"type": "string", "enum": ["positive", "negative", "neutral"]},
            "confidence": {"type": "number"},
        },
        "required": ["sentiment", "confidence"],
    },
)

serve(agents=[analyzer])

Options

The first argument to all Anthropic agent constructors is an AsyncAnthropic client instance.
name
str
required
Agent name. Used as the endpoint identifier.
model
str
Anthropic model to use. Defaults to claude-sonnet-4-5-20250929.
max_tokens
int
Maximum number of tokens to generate.
instructions
str
System prompt for the model.
description
str
Agent description for discovery and documentation.
output_schema
dict
Output schema for task agents. Defines the structured output format.
tags
list[str]
Tags for filtering and organizing agents.
metadata
dict
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.