Skip to main content

Installation

npm install @reminix/anthropic @anthropic-ai/sdk
Requires @anthropic-ai/sdk as a peer dependency.

Chat Agent

Use AnthropicChatAgent for conversational agents with streaming support.
import Anthropic from "@anthropic-ai/sdk"
import { AnthropicChatAgent } from "@reminix/anthropic"
import { serve } from "@reminix/runtime"

const anthropic = new Anthropic()

const chatbot = new AnthropicChatAgent(anthropic, {
  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 option:
const chatbot = new AnthropicChatAgent(anthropic, {
  name: "chatbot",
  model: "claude-opus-4-5-20250929",
  maxTokens: 8192,
  instructions: "You are a helpful assistant.",
})

Streaming

Chat agents support streaming out of the box:
import Reminix from "@reminix/sdk"

const client = new Reminix()

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

for await (const event of stream) {
  if (event.type === "text_delta") {
    process.stdout.write(event.delta)
  }
}

Task Agent

Use AnthropicTaskAgent for structured output with a defined schema.
import Anthropic from "@anthropic-ai/sdk"
import { AnthropicTaskAgent } from "@reminix/anthropic"
import { serve } from "@reminix/runtime"

const anthropic = new Anthropic()

const analyzer = new AnthropicTaskAgent(anthropic, {
  name: "analyzer",
  maxTokens: 1024,
  instructions: "Analyze the sentiment of the given text.",
  outputSchema: {
    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 Anthropic client instance.
name
string
required
Agent name. Used as the endpoint identifier.
model
string
Anthropic model to use. Defaults to claude-sonnet-4-5-20250929.
maxTokens
number
Maximum number of tokens to generate.
instructions
string
System prompt for the model.
description
string
Agent description for discovery and documentation.
outputSchema
JSONSchema
Output schema for task agents. Defines the structured output format.
tags
string[]
Tags for filtering and organizing agents.
metadata
Record<string, unknown>
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.

Python: Anthropic

The same integration in Python.