Anthropic SDK
Wrap Anthropic clients for use with the Reminix runtime
The Anthropic adapter wraps an AsyncAnthropic client for use with the Reminix runtime.
Installation
pip install reminix[runtime,anthropic]Usage
from anthropic import AsyncAnthropic
from reminix.adapters.anthropic import from_anthropic
from reminix.runtime import serve
client = AsyncAnthropic()
agent = from_anthropic(
client,
name="claude-agent",
model="claude-sonnet-4-20250514",
system="You are a helpful assistant.",
)
serve(agent)Options
| Parameter | Type | Default | Description |
|---|---|---|---|
client | AsyncAnthropic | required | The Anthropic client instance |
name | str | required | Name for the Reminix agent |
model | str | "claude-sonnet-4-20250514" | The model to use |
system | str | None | None | Optional system prompt |
max_tokens | int | 4096 | Maximum tokens in the response |
metadata | dict | None | Optional metadata for the agent |
Handler Mapping
| Reminix Handler | Anthropic Method |
|---|---|
@agent.invoke | client.messages.create() |
@agent.invoke_stream | client.messages.stream() |
@agent.chat | client.messages.create() |
@agent.chat_stream | client.messages.stream() |
Example: Streaming Response
from anthropic import AsyncAnthropic
from reminix.adapters.anthropic import from_anthropic
from reminix.runtime import serve
client = AsyncAnthropic()
agent = from_anthropic(
client,
name="claude-stream",
model="claude-sonnet-4-20250514",
system="You are a creative writing assistant.",
max_tokens=2048,
)
if __name__ == "__main__":
serve(agent, port=8080)Test streaming:
curl -X POST http://localhost:8080/agent/claude-stream/invoke \
-H "Content-Type: application/json" \
-d '{"input": {"prompt": "Write a haiku about coding."}, "stream": true}'