> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/ai/multi-models/anthropic-integration.md).

# Anthropic integration

`provider` value: `anthropic`

Claude is a good default for editing and longer prose. Same pattern as OpenAI: configure Anthropic in the portal (your key or DNotifier subscription), then pass `provider` + `model` from the SDK.

Snapshot ids change over time — copy whatever the portal shows (examples people use a lot: `claude-sonnet-4-20250514`, faster Haiku variants).

## Portal

**Projects** (pick the project) → **AI Studio** → **Providers** → **Anthropic** → paste an Anthropic API key **or** turn on subscription-managed access → save.

## Code

{% tabs %}
{% tab title="JavaScript" %}

```js
await notifier.sendAI({
  senderId: USER_ID,
  provider: "anthropic",
  model: "claude-sonnet-4-20250514",
  message: {
    messages: [
      { role: "user", content: "Summarize this ticket in two bullets." },
    ],
  },
  saveHistory: true,
});
```

{% endtab %}

{% tab title="Python" %}

```python
await notifier.send_ai(
    sender_id=user_id,
    provider="anthropic",
    model="claude-sonnet-4-20250514",
    message={
        "messages": [
            {"role": "user", "content": "Summarize this ticket in two bullets."},
        ],
    },
    save_history=True,
)
```

{% endtab %}

{% tab title="Dart" %}

```dart
await notifier.sendAI(
  senderId: userId,
  provider: 'anthropic',
  model: 'claude-sonnet-4-20250514',
  message: {
    'messages': [
      {'role': 'user', 'content': 'Summarize this ticket in two bullets.'},
    ],
  },
  saveHistory: true,
);
```

{% endtab %}
{% endtabs %}

Writer agent pinned to Sonnet:

```js
const editor = DNotifier.defineAgent({
  name: "editor",
  provider: "anthropic",
  model: "claude-sonnet-4-20250514",
  async run(ctx) {
    return ctx.sendAI({
      message: {
        messages: [
          { role: "system", content: "Edit for clarity. Don't invent facts." },
          { role: "user", content: String(ctx.input.draft) },
        ],
      },
      saveHistory: false,
    });
  },
});
```

Need a cheaper step inside the same agent? Override on that call:

```js
await ctx.sendAI({
  provider: "anthropic",
  model: "claude-haiku-4-5-20251001",
  message: { text: "Classify: billing | technical | other" },
  saveHistory: false,
});
```

[Overview](https://dnotifier.gitbook.io/product-docs/ai/multi-models.md) · [OpenAI](https://dnotifier.gitbook.io/product-docs/ai/multi-models/open-ai-integration.md) · [Gemini](https://dnotifier.gitbook.io/product-docs/ai/multi-models/google-gemini-integration.md)
