npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reminix/anthropic

v0.0.22

Published

Reminix agents for Anthropic - serve AI agents as REST APIs

Downloads

301

Readme

@reminix/anthropic

Reminix agents for the Anthropic API. Serve Claude models as a REST API.

Ready to go live? Deploy to Reminix Cloud for zero-config hosting, or self-host on your own infrastructure.

Installation

npm install @reminix/anthropic @anthropic-ai/sdk

This will also install @reminix/runtime as a dependency.

Quick Start

Chat Agent (streaming conversations)

import Anthropic from '@anthropic-ai/sdk';
import { AnthropicChatAgent } from '@reminix/anthropic';
import { serve } from '@reminix/runtime';

const client = new Anthropic();
const agent = new AnthropicChatAgent(client, { name: 'my-claude' });
serve({ agents: [agent] });

Task Agent (structured output)

import Anthropic from '@anthropic-ai/sdk';
import { AnthropicTaskAgent } from '@reminix/anthropic';
import { serve } from '@reminix/runtime';

const client = new Anthropic();
const schema = {
  type: 'object',
  properties: {
    sentiment: { type: 'string', enum: ['positive', 'negative', 'neutral'] },
    confidence: { type: 'number' },
  },
  required: ['sentiment', 'confidence'],
};
const agent = new AnthropicTaskAgent(client, { outputSchema: schema, name: 'sentiment-analyzer' });
serve({ agents: [agent] });

Thread Agent (tool-calling loop)

import Anthropic from '@anthropic-ai/sdk';
import { AnthropicThreadAgent } from '@reminix/anthropic';
import { serve, tool } from '@reminix/runtime';
import { z } from 'zod';

const getWeather = tool('get_weather', {
  description: 'Get the current weather for a city',
  inputSchema: z.object({ city: z.string() }),
  handler: async ({ city }) => ({ temperature: 72, condition: 'sunny' }),
});

const client = new Anthropic();
const agent = new AnthropicThreadAgent(client, { tools: [getWeather], name: 'weather-assistant' });
serve({ agents: [agent] });

Your agents are now available at:

  • POST /agents/{name}/invoke - Execute the agent

API Reference

new AnthropicChatAgent(client, options?)

Create an Anthropic chat agent. Supports streaming.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | client | Anthropic | required | An Anthropic client | | options.name | string | "anthropic-agent" | Name for the agent (used in URL path) | | options.model | string | "claude-sonnet-4-5-20250929" | Model to use | | options.maxTokens | number | 4096 | Maximum tokens in response | | options.description | string | "anthropic chat agent" | Description shown in agent metadata | | options.instructions | string | — | System instructions merged with system messages | | options.tags | string[] | — | Tags for categorizing/filtering agents | | options.metadata | Record<string, unknown> | — | Custom metadata merged into agent info |

Returns: AnthropicChatAgent - A Reminix chat agent instance

The chat agent:

  1. Converts incoming messages to Anthropic format
  2. Extracts system messages and merges with instructions as the system parameter
  3. Returns the assistant's text response
  4. Supports streaming via Server-Sent Events

new AnthropicTaskAgent(client, options)

Create an Anthropic task agent. Returns structured output via tool-use. Does not support streaming.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | client | Anthropic | required | An Anthropic client | | options.outputSchema | Record<string, unknown> | required | JSON Schema defining the structured output | | options.name | string | "anthropic-task-agent" | Name for the agent (used in URL path) | | options.model | string | "claude-sonnet-4-5-20250929" | Model to use | | options.maxTokens | number | 4096 | Maximum tokens in response | | options.description | string | "anthropic task agent" | Description shown in agent metadata | | options.instructions | string | — | System instructions passed as system parameter | | options.tags | string[] | — | Tags for categorizing/filtering agents | | options.metadata | Record<string, unknown> | — | Custom metadata merged into agent info |

Returns: AnthropicTaskAgent - A Reminix task agent instance

The task agent:

  1. Reads the task field from the request input
  2. Includes any additional input fields as context
  3. Forces a tool call using the provided outputSchema
  4. Extracts and returns the structured result from the tool-use block

new AnthropicThreadAgent(client, options)

Create an Anthropic thread agent with a tool-calling loop. Does not support streaming.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | client | Anthropic | required | An Anthropic client | | options.tools | Tool[] | required | List of tools available to the agent | | options.name | string | "anthropic-thread-agent" | Name for the agent (used in URL path) | | options.model | string | "claude-sonnet-4-5-20250929" | Model to use | | options.maxTokens | number | 4096 | Maximum tokens in response | | options.maxTurns | number | 10 | Maximum number of tool-calling turns | | options.description | string | "anthropic thread agent" | Description shown in agent metadata | | options.instructions | string | — | System instructions merged with system messages | | options.tags | string[] | — | Tags for categorizing/filtering agents | | options.metadata | Record<string, unknown> | — | Custom metadata merged into agent info |

Returns: AnthropicThreadAgent - A Reminix thread agent instance

The thread agent:

  1. Converts incoming messages to Anthropic format
  2. Calls the model in a loop, executing tool calls each turn
  3. Continues until the model produces a final response or maxTurns is reached
  4. Returns the full conversation including tool calls and results

System Messages

All three agents automatically handle Anthropic's system message format. System messages in your request are extracted and passed as the system parameter to the API.

// This works automatically:
const request = {
  messages: [
    { role: 'system', content: 'You are a helpful assistant' },
    { role: 'user', content: 'Hello!' },
  ],
};

Endpoint Input/Output Formats

Chat Agent -- POST /agents/{name}/invoke

Request with prompt:

{
  "input": {
    "prompt": "Summarize this text: ..."
  }
}

Request with messages:

{
  "input": {
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ]
  }
}

Response:

{
  "output": "Hello! How can I help you today?"
}

Task Agent -- POST /agents/{name}/invoke

Request:

{
  "input": {
    "task": "Analyze the sentiment of this review: 'Great product, love it!'"
  }
}

Response:

{
  "output": {
    "sentiment": "positive",
    "confidence": 0.95
  }
}

Thread Agent -- POST /agents/{name}/invoke

Request:

{
  "input": {
    "messages": [
      {"role": "user", "content": "What's the weather in San Francisco?"}
    ]
  }
}

Response:

{
  "output": [
    {"role": "user", "content": "What's the weather in San Francisco?"},
    {"role": "assistant", "content": "", "tool_calls": [{"id": "toolu_01...", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"San Francisco\"}"}}]},
    {"role": "tool", "content": "{\"temperature\": 72, \"condition\": \"sunny\"}", "tool_call_id": "toolu_01..."},
    {"role": "assistant", "content": "The weather in San Francisco is 72 degrees and sunny."}
  ]
}

Streaming

For streaming responses (chat agent only), set stream: true in the request:

{
  "input": {
    "prompt": "Tell me a story"
  },
  "stream": true
}

The response will be sent as Server-Sent Events (SSE).

Runtime Documentation

For information about the server, endpoints, request/response formats, and more, see the @reminix/runtime package.

Deployment

Ready to go live?

Links

License

Apache-2.0