Claude Anthropic
Updated
Integrate Anthropic Claude LLM into Conversational AI Engine.
Claude from Anthropic provides helpful, harmless, and honest AI assistance with strong reasoning capabilities and natural conversational abilities.
Sample configuration
The following examples show how to configure Claude (Anthropic) LLM when starting a conversational AI agent.
from agora_agent import Agent, Anthropic
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(Anthropic(
api_key='your-anthropic-key',
url='https://api.anthropic.com/v1/messages',
model='claude-opus-4-8',
max_tokens=1024,
headers={'anthropic-version': '2023-06-01'},
system_messages=[{'role': 'system', 'content': 'You are a helpful chatbot.'}],
greeting_message='Hello, how can I assist you?',
failure_message='Please hold on a second.',
max_history=32,
))
.with_tts(...) # configure your TTS vendor
)import { Agent, Anthropic } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(new Anthropic({
apiKey: 'your-anthropic-key',
url: 'https://api.anthropic.com/v1/messages',
model: 'claude-opus-4-8',
headers: { 'anthropic-version': '2023-06-01' },
params: { max_tokens: 1024 },
systemMessages: [{ role: 'system', content: 'You are a helpful chatbot.' }],
greetingMessage: 'Hello, how can I assist you?',
failureMessage: 'Please hold on a second.',
maxHistory: 32,
}))
.withTts(/* configure your TTS vendor */);import "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(
vendors.NewAnthropic(vendors.AnthropicOptions{
APIKey: "your-anthropic-key",
URL: "https://api.anthropic.com/v1/messages",
Model: "claude-opus-4-8",
MaxTokens: agora.Int(1024),
Headers: map[string]string{"anthropic-version": "2023-06-01"},
SystemMessages: []map[string]interface{}{
{"role": "system", "content": "You are a helpful chatbot."},
},
GreetingMessage: "Hello, how can I assist you?",
FailureMessage: "Please hold on a second.",
}),
).WithTts(/* configure your TTS vendor */)Use the following llm configuration in your request:
"llm": {
"url": "https://api.anthropic.com/v1/messages",
"api_key": "<your_llm_key>",
"headers": "{\"anthropic-version\":\"2023-06-01\"}",
"system_messages": [
{
"role": "system",
"content": "You are a helpful chatbot."
}
],
"max_history": 32,
"greeting_message": "Hello, how can I assist you?",
"failure_message": "Please hold on a second.",
"params": {
"model": "claude-opus-4-8",
"max_tokens": 1024
},
"style": "anthropic"
}Key parameters
The following parameters are required when using your own API key (BYOK).
api_keystringGet your API key from the Anthropic Console.
urlstringUse Anthropic's messages endpoint.
headersstringMust include the anthropic-version header for API compatibility.
stylestringSet to anthropic to use Claude's message format.
paramsobjectmodelstringRefer to Claude models for available models.
max_tokensintegerThe maximum number of tokens to generate in the response.
For complete llm configuration options, see LLM parameters. For Claude-specific options and model capabilities, see the Claude API documentation.
