Skip to main content

Function: anthropic()

anthropic(modelId, config?): ModelConfig

Defined in: packages/core/src/providers/factories.ts:170

Configure Anthropic (Claude) provider explicitly

Parameters

modelId

string

Anthropic model ID (e.g., 'claude-3-5-sonnet', 'claude-3-opus', 'claude-3-7-sonnet')

config?

ProviderConfig & object

Optional configuration (provider settings + reasoning options)

Returns

ModelConfig

ModelConfig with provider set to 'anthropic'

Examples

const bot = new Baleybot({
model: anthropic('claude-3-5-sonnet')
});
const bot = new Baleybot({
model: anthropic('claude-3-5-sonnet', {
apiKey: 'sk-ant-...'
})
});
const bot = new Baleybot({
model: anthropic('claude-3-7-sonnet', {
reasoning: {
effort: 'high', // Automatically uses 20000 budget tokens
summary: 'detailed'
}
})
});