# Claude Anthropic (/en/ai/models/llm/claude)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Claude from Anthropic provides helpful, harmless, and honest AI assistance with strong reasoning capabilities and natural conversational abilities.

### Sample configuration [#sample-configuration]

The following examples show how to configure Claude (Anthropic) LLM when starting a conversational AI agent.

<Tabs defaultValue="python" groupId="ai-sdk-language">
  <TabsList>
    <TabsTrigger value="python">
      Python SDK
    </TabsTrigger>

    <TabsTrigger value="typescript">
      TypeScript SDK
    </TabsTrigger>

    <TabsTrigger value="go">
      Go SDK
    </TabsTrigger>

    <TabsTrigger value="rest-api">
      REST API
    </TabsTrigger>
  </TabsList>

  <TabsContent value="python">
    ```python
    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
    )
    ```
  </TabsContent>

  <TabsContent value="typescript">
    ```typescript
    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 */);
    ```
  </TabsContent>

  <TabsContent value="go">
    ```go
    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 */)
    ```
  </TabsContent>

  <TabsContent value="rest-api">
    Use the following `llm` configuration in your request:

    ```json
    "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"
    }
    ```
  </TabsContent>
</Tabs>

### Key parameters [#key-parameters]

The following parameters are required when using your own API key (BYOK).

<ParameterList title="llm">
  <Parameter name="api_key" type="string" required="true">
    Get your API key from the [Anthropic Console](https://console.anthropic.com/).
  </Parameter>

  <Parameter name="url" type="string" required="true">
    Use Anthropic's messages endpoint.
  </Parameter>

  <Parameter name="headers" type="string" required="true">
    Must include the `anthropic-version` header for API compatibility.
  </Parameter>

  <Parameter name="style" type="string" required="true">
    Set to `anthropic` to use Claude's message format.
  </Parameter>

  <Parameter name="params" type="object" required="true">
    <Parameter name="model" type="string" required="true">
      Refer to [Claude models](https://docs.anthropic.com/en/docs/about-claude/models) for available models.
    </Parameter>

    <Parameter name="max_tokens" type="integer" required="true">
      The maximum number of tokens to generate in the response.
    </Parameter>
  </Parameter>
</ParameterList>

For complete `llm` configuration options, see [LLM parameters](/en/api-reference/api-ref/conversational-ai/join#properties-llm). For Claude-specific options and model capabilities, see the [Claude API documentation](https://docs.anthropic.com/en/api/messages).
