anthropic
@providerprotocol/ai / anthropic
anthropic
Section titled “anthropic”Anthropic provider for UPP (Unified Provider Protocol)
This module exports the Anthropic provider for use with Claude models. Anthropic’s Claude models are known for their strong reasoning capabilities and safety-focused design.
Example
Section titled “Example”import { anthropic, betas } from '@providerprotocol/ai/anthropic';import { llm } from '@providerprotocol/ai';
// Create an LLM instance with Claudeconst model = llm({ model: anthropic('claude-sonnet-4-20250514'), params: { max_tokens: 1000 }});
// Generate a responseconst turn = await model.generate('Explain quantum computing.');console.log(turn.response.text);
// With beta featuresconst modelWithBetas = llm({ model: anthropic('claude-sonnet-4-20250514', { betas: [betas.structuredOutputs], }), structure: { properties: { answer: { type: 'string' } } },});Interfaces
Section titled “Interfaces”- AnthropicBashTool
- AnthropicCodeExecutionTool
- AnthropicComputerTool
- AnthropicHeaders
- AnthropicLLMParams
- AnthropicModelOptions
- AnthropicOutputFormat
- AnthropicTextEditorTool
- AnthropicToolSearchTool
- AnthropicUserLocation
- AnthropicWebSearchTool