<!-- BusyBot node reference — https://busybot.net/tools/claude-chat/ -->

> Node: Claude Chat (`claude_chat`) · Action · v1
> Category: AI · Credentials: Anthropic (`anthropic`)
> Updated: 2026-08-16

# Claude Chat

> Chat with Anthropic Claude models using the Messages API.

## Overview

Sends a user message to Anthropic's Claude chat completion API (POST /v1/messages) and returns the model's response text. Supports Claude Opus, Sonnet, and Haiku models with configurable system prompt, temperature, top_p, top_k, and max_tokens. Each input item produces one API call. The response text is stored in a configurable output field (default: "response") along with model name, token usage, and stop reason.

**Category:** AI  
**Tool Name:** `claude_chat`  
**Version:** 1

**Appearance:** Icon: `anthropic` | Color: `#d4a574`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Anthropic** credentials.
See the [Credentials Guide](https://busybot.net/credentials/anthropic/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | `Claude Sonnet` | The Claude model to use for chat completion. Always uses the latest version (auto-updated). |
| | | | | Options: Claude Opus (most capable — complex analysis, coding and multi-step reasoning), Claude Sonnet (balanced — strong quality at lower cost and latency), Claude Haiku (fastest — simple tasks, classification and high-volume work). Each option tracks the current release of its tier, so the underlying model ID updates without any change to your node. |
| System Prompt | `string` | No | — | Optional system prompt to set the model's behavior and context. Leave empty for default behavior. Supports expressions. |
| User Message | `string` | Yes | — | The user message to send to Claude. Falls back to item.message or item.prompt if empty. Supports expressions like {{ $json.text }}. |
| Attachment File ID | `string` | No | — | Optional Anthropic file_id from a previous Claude File Upload node. When set, the file is attached to the user message alongside your text. Falls back to item.fileId if empty. Supports expressions. |
| Attachment Type | `options` | No | `document` | How Claude should interpret the attached file. Ignored when Attachment File ID is empty. |
| | | | | Options: `document` (PDF, plaintext, or other document file), `image` (JPG, PNG, GIF, or WebP image) |
| Options | `collection` | No | `{}` | Advanced sampling and output settings. |
| — Max Tokens | `number` | No | `4096` | Maximum number of tokens to generate in the response. |
| — Temperature | `number` | No | `1` | Sampling temperature (0-1). Lower values are more deterministic, higher values more creative. |
| — Top P | `number` | No | — | Nucleus sampling: only consider tokens with cumulative probability up to this value. |
| — Top K | `number` | No | — | Only sample from the top K most likely tokens at each step. |
| — Response Field Name | `string` | No | `response` | The output field name where the Claude response text will be stored. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the response. |
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

One API call per input item, and one output item per input item. The response text lands on the field named by Response Field Name (`response` by default), and binary data on the input item is forwarded unchanged. With Include Input on, the original item fields are merged in alongside the result.

```json
{
  "response": "The model's reply text",
  "model": "claude-...",
  "usage": { "input_tokens": 412, "output_tokens": 268 },
  "stopReason": "end_turn"
}
```

- `model` is the model that actually answered, as reported by Anthropic.
- `usage` is the token accounting Anthropic returned for the call.
- `stopReason` says why generation stopped — for example `end_turn` (finished naturally) or `max_tokens` (hit the Max Tokens cap).

Reference the result downstream by expression, e.g. `{{ $json.response }}`.

## Usage Examples

- Ask Claude a question and get a text response
- Summarize text using Claude Sonnet
- Generate creative content with a system prompt
- Classify input items using Claude Haiku for speed
- Extract structured information from unstructured text

## Example Configuration

Minimal — send one message per item:

```json
{
  "type": "claude_chat",
  "parameters": {
    "userMessage": "Summarize the following article: {{ $json.articleText }}"
  }
}
```

Add a system prompt to control tone and format:

```json
{
  "type": "claude_chat",
  "parameters": {
    "systemPrompt": "You are a concise technical writer. Respond only with well-structured bullet points.",
    "userMessage": "Explain the concept of backpressure in stream processing.",
    "includeInput": false,
    "maxConcurrency": 10
  }
}
```

Deterministic classification into a named output field:

```json
{
  "type": "claude_chat",
  "parameters": {
    "systemPrompt": "Classify the sentiment of the input text. Respond with exactly one word: POSITIVE, NEGATIVE, or NEUTRAL.",
    "userMessage": "{{ $json.reviewText }}",
    "includeInput": true,
    "maxConcurrency": 20,
    "options": {
      "maxTokens": 10,
      "temperature": 0,
      "responseFieldName": "sentiment"
    }
  }
}
```

Ask a question about a file uploaded by a Claude File Upload node:

```json
{
  "type": "claude_chat",
  "parameters": {
    "userMessage": "What are the payment terms in this contract?",
    "attachmentFileId": "{{ $json.fileId }}",
    "attachmentType": "document",
    "options": {
      "maxTokens": 1024,
      "temperature": 0.2,
      "responseFieldName": "contractAnswer"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Claude Chat sends user messages to the Anthropic Messages API and returns conversational responses from Claude Opus, Sonnet, or Haiku models. Use it when a workflow step requires natural language generation, reasoning, or instruction-following with configurable temperature, top_p, top_k, and max_tokens parameters. Each input item produces one API call, and the output fields include response text, model name, token usage counts, and stop reason.