@standardagents/anthropic
v0.21.1
Published
Anthropic (Claude) provider for Standard Agents
Readme
@standardagents/anthropic
Anthropic (Claude) provider for Standard Agents. Wraps the official @anthropic-ai/sdk and translates between the Standard Agents provider spec and the Anthropic Messages API.
Features
- Streaming and non-streaming generation through the Messages API
- Tool use with parallel tool results and image tool outputs
- Extended thinking across model generations: adaptive thinking + effort on Claude 4.6+, token budgets on Claude 4.0-4.5, with thinking blocks (text + signature) round-tripped exactly on multi-turn conversations
- Anthropic server-side
web_searchtool exposed as a provider tool - Vision (images), PDF and plain-text document inputs
- Structured outputs via
output_config.formatfor JSON schema response formats - Prompt caching opt-in for the system prompt (
providerOptions.cacheSystemPrompt) - Live model listing and per-model capability detection via the Anthropic Models API
- Usage normalization (prompt/completion/cached/reasoning tokens) plus exact per-request cost derived from raw billing buckets (cache writes at 1.25x/2x, cache reads at 0.1x) for documented Claude models
Usage
import { defineModel } from '@standardagents/spec';
import { anthropic } from '@standardagents/anthropic';
export default defineModel({
name: 'claude-opus',
provider: anthropic,
model: 'claude-opus-4-8',
inputPrice: 5,
outputPrice: 25,
providerOptions: {
cacheSystemPrompt: true,
},
});Set ANTHROPIC_API_KEY in your environment.
