@runbit/anthropic
v0.1.1
Published
An Anthropic (Claude) `ChatModel` for Runbit. Zero dependencies — uses global `fetch`.
Readme
@runbit/anthropic
An Anthropic (Claude) ChatModel for Runbit. Zero dependencies — uses global fetch.
npm install @runbit/anthropic @runbit/runtimeimport { anthropic } from "@runbit/anthropic";
import { agent } from "@runbit/runtime";
const model = anthropic("claude-sonnet-5"); // reads ANTHROPIC_API_KEY
const assistant = agent({ model, tools: [weather] });Options
anthropic("claude-sonnet-5", {
apiKey: process.env.ANTHROPIC_API_KEY, // default
baseURL: "https://api.anthropic.com/v1",
maxTokens: 1024, // Anthropic requires a limit
temperature: 0.7,
version: "2023-06-01", // anthropic-version header
});Pick any current model id from Anthropic's model list — e.g. claude-sonnet-5, claude-opus-4-8, or claude-haiku-4-5-20251001 for a cheaper option.
Supports tool calling and reports token usage, so @runbit/devtools can show cost. Pass the result straight to agent({ model }) — because the agent only knows ChatModel, switching from OpenAI to Claude is a one-line change.
Part of Runbit — the AI Runtime. Providers ship separately so you install only what you use.
- Umbrella:
@runbit/runtime - License: MIT
