Anthropic
Configure Anthropic Claude models — API key, models, and usage.
Setup
export ANTHROPIC_API_KEY=your-key-hereimport { createLLM } from '@ahzan-agentforge/core';
const llm = createLLM({
provider: 'anthropic',
model: 'claude-sonnet-4-20250514',
});Available Models
| Model | Identifier | Best For |
|---|---|---|
| Claude Opus 4 | claude-opus-4-20250514 | Complex reasoning, analysis |
| Claude Sonnet 4 | claude-sonnet-4-20250514 | Balanced performance/cost |
| Claude Haiku 3.5 | claude-haiku-4-5-20251001 | Fast, cost-effective |
Configuration Options
const llm = createLLM({
provider: 'anthropic',
model: 'claude-sonnet-4-20250514',
maxTokens: 8192,
temperature: 0.5,
apiKey: 'sk-ant-...', // Or use ANTHROPIC_API_KEY env var
});Cost Model
AgentForge tracks costs automatically using built-in cost models:
| Model | Input (per 1K tokens) | Output (per 1K tokens) |
|---|---|---|
| claude-opus-4 | Refer to Anthropic pricing | Refer to Anthropic pricing |
| claude-sonnet-4 | Refer to Anthropic pricing | Refer to Anthropic pricing |
| claude-haiku-4.5 | Refer to Anthropic pricing | Refer to Anthropic pricing |
Use Budget Governance to set cost limits.