> ## Documentation Index
> Fetch the complete documentation index at: /help/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude (Anthropic API)

> Call Claude through Anthropic's Messages API from a campaign step with your own key, for example to rate a contact's fit.

> [!NOTE]
>
> **Pro plan.** Claude works through a connection and HTTP steps, which are part of Pro and Agency (and the free trial). Anything you already have keeps working on every plan. See [Plans and billing](/help/account/billing.md).

A **Webhook / HTTP** step sends the contact's title, headline and company description to Claude with your prompt, for example to rate their fit in one word. A **Condition** then branches on Claude's answer.

Kerux's own AI features (reply types, **Ask AI**, Reply with AI) use Kerux's AI credits. This guide is for teams that want their own Anthropic key, model choice and prompts.

> [!NOTE]
>
> **How it connects:** Anthropic's API with your key in the `x-api-key` header and an `anthropic-version` header. See Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) docs. The model id is yours to choose from Anthropic's docs.

## Before you start

* **Anthropic billing:** the API is billed per token on your Anthropic account, separately from Claude.ai plans.
* **An API key:** create one in the Anthropic Console.

## 1. Connect Anthropic

In Kerux, open **Integrations > Connections**, click **Connect** on **Custom API** (under **Developers**):

* **How it signs in:** **API key in a header**, **Header name** `x-api-key`, paste the key.
* **Base URL:** `https://api.anthropic.com`

Click **Save**.

## 2. Rate the fit

After **Invitation accepted**, add a **Webhook / HTTP** step named `claude`:

```json theme={null}
{
  "method": "POST",
  "url": "/v1/messages",
  "headers": { "anthropic-version": "2023-06-01" },
  "bodyType": "json",
  "body": {
    "model": "YOUR_MODEL_ID",
    "max_tokens": 10,
    "system": "We sell outbound tooling to B2B agencies. Answer with one word: strong, maybe or weak.",
    "messages": [
      {
        "role": "user",
        "content": "Title: {{contact.title}}. Headline: {{contact.headline}}. Company: {{contact.company}}. About the company: {{company.description | optional}}"
      }
    ]
  }
}
```

Claude answers (trimmed):

```json theme={null}
{ "content": [{ "type": "text", "text": "strong" }], "stop_reason": "end_turn" }
```

The answer is `{{steps.claude.response.body.content.0.text}}`. Add a **Condition** on it: `strong` notifies the owner, `weak` gets a lighter sequence. **Add tags** records the fit on the contact.

Kerux already sorts replies by itself (reply types), so you don't need Claude for that.

## Test with one contact

In the **Builder**, click **Test** to open **Test on one contact**. The journey shows the request and Claude's answer.

## Common errors

> [accordion] 401 authentication\_error
>
> The key is wrong or the header name isn't `x-api-key`.

> [accordion] 400 invalid\_request\_error
>
> A required field is missing (`model`, `max_tokens`, `messages`) or the model id is wrong. The message says which.

> [accordion] 429 or 529
>
> Rate limit or overload on Anthropic's side. Kerux retries later on its own.

Related: [Webhook steps](/help/integrations/webhook-steps.md), [OpenAI](/help/integration-guides/openai.md), [n8n](/help/integration-guides/n8n.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.