The Tool Signal
Hands-on reviews of AI tools that actually help small businesses

How to Call the Claude API From n8n: HTTP Request Node

Updated 25 October 2026 · n8n, Claude API, automation, HTTP Request

How to Call the Claude API From n8n: HTTP Request Node

Here is how to call the Claude API from n8n with the HTTP Request node. Treat the node as a generic client, because you supply Claude's authentication, the JSON body and the error handling yourself. Import Anthropic's cURL example, move the key into a Header Auth credential, map your data into the body with an expression, and then add timeouts, retries and an error workflow.

The pain usually shows up on day two. A client's email contains a quotation mark, the JSON body breaks, and the workflow dies with a 400 error at three in the morning. Most pages on this topic confirm that the connection works and stop there. This guide covers the parts that break once real data starts flowing.

What the HTTP Request node does for Claude, and what you supply

The HTTP Request node sends a request and hands back the response, and it knows nothing about Claude. According to n8n's own documentation, the node sends REST requests built from a method, a URL, query parameters, headers and a body, and it can import a cURL command to fill those fields in. n8n's Claude integration page describes calling Claude through this node with generic authentication. Neither page says the node checks Claude-specific JSON, picks a model or understands Claude's error responses. Each of those jobs is yours.

Job What n8n's HTTP Request node provides What you supply
Sending the request Method, URL, headers, query parameters, body, cURL import The Claude endpoint and request shape from Anthropic's docs
Authentication Generic types such as Header Auth, OAuth and query auth Your Claude API key, stored in a credential
Request body A JSON body field that accepts expressions A body that matches Claude's schema, with your data safely escaped
Model choice Nothing Claude specific The model ID, copied from Anthropic's docs
Errors Retry settings, a timeout option, an error output Rules for what to retry and where failures get reported
Rate limits A batching option to space out requests Pacing that fits your Anthropic usage tier

Read the right-hand column as your job list. Every row in it is something a client will blame you for if it goes wrong.

How to call the Claude API from n8n, step by step

The build has five steps, and none of them needs code beyond one expression. The order matters, because each step removes a specific way the workflow can fail later.

Step 1: Copy the request shape from Anthropic's docs

Start from Anthropic's API reference. Don't type headers from memory. The reference shows a cURL example for a Messages request, and that example holds the exact endpoint, the header names, the version header and the body fields that are current today. Copy the whole example into a text file. Headers and model IDs change over time, so this habit keeps you correct when an older blog post is out of date.

Step 2: Import the cURL command into the node

Add an HTTP Request node, find the Import cURL option, and paste the example. n8n's documentation says the import fills in the method, URL, headers and body for you. Run the node once with the example's own sample prompt before you change anything. If that first run fails, the problem is your key or your network, and your mapping has not entered the picture yet.

n8n's troubleshooting page, read on 25 October 2026, lists invalid or deprecated URLs, authentication or permission problems, and a Docker container that cannot route to the host as documented causes of errors. If you self-host n8n in Docker and the request never leaves the box, check that last one first.

Step 3: Move the API key into a Header Auth credential

The imported cURL leaves your key sitting in plain text inside the node's headers. Delete that header row. Then set Authentication to Generic Credential Type, choose Header Auth, and create a credential. Its name is the key header name from Anthropic's example and its value is your API key. The key now lives in n8n's credential store. It stays out of the workflow JSON, so it stays out of every workflow export you send to a client or paste into a forum. Keep the version and content type headers from the import as they are.

Step 4: Map your data into the JSON body safely

This is the step most guides skip, and it causes most 400 errors. Set the body to JSON and keep the structure from the import. Then find the sample prompt text inside it and replace that string, including its surrounding quotes, with an expression like this one:

{{ JSON.stringify($json.email_text) }}

JSON.stringify wraps your text in quotes and escapes everything inside it: quotation marks, line breaks and backslashes. Without it, the first email that contains a quote or a newline produces invalid JSON. n8n's troubleshooting page names malformed JSON as a cause of HTTP 400 errors. If your prompt mixes fixed instructions with input data, build the full prompt string in an Edit Fields node first. Then pass that single field through JSON.stringify.

Replace the model ID from the example with the one your client's budget allows, and copy it exactly from Anthropic's model list.

Step 5: Pull the reply out of the response

The node returns Claude's full JSON response, and the reply text sits a few levels deep inside it. Run the node and open the output panel. From there, drag the text field into an Edit Fields node so the next step gets one clean field. While the panel is open, look for any usage or token information in the response and save it to a sheet or database. A client will ask what the workflow costs, and logged usage gives you an answer that doesn't depend on guessing.

What can break when you call the Claude API from n8n, and how to catch it

Four failures account for most broken Claude calls in n8n, and each has a setting that catches it. For each one below you get the symptom, a way to trigger it on purpose and the n8n setting that handles it. Run all four tests on a copy of the workflow before the client sees it. This article describes the tests and doesn't report results from running them.

API timeout

The symptom is a node that spins for a long time and then fails with a timeout error, often on long prompts or long replies. To reproduce it, point the HTTP Request node at a slow test endpoint, or temporarily set a very short timeout on the real call. To catch it, open the node's Options and set Timeout to a value that fits the longest reply you expect. Then, in the node's Settings, turn on Retry On Fail with Max Tries and Wait Between Tries. One caution applies. n8n's documentation doesn't say that a retry is safe for a billable API, and a request that timed out on your side may still have finished on Anthropic's side. Every retry can cost you a second paid call, so keep Max Tries low.

Empty field in the input

The symptom is a successful call that returns a confused or generic reply, because Claude got your instructions with nothing to work on. You may also get a 400 error if the empty value breaks the body. To reproduce it, send one test item with the key field blank. To catch it, put an IF node before the HTTP Request node that checks whether the field is empty. Send empty items to a Stop and Error node, or to a branch that logs them, so they never reach Claude and never cost a call.

The same item processed twice

The symptom is duplicate output: two replies to one email, or two tasks created from one transcript. You also pay for both calls. To reproduce it, execute the workflow twice on the same input. To catch it, add a Remove Duplicates node before the Claude call and set it to remove items processed in previous executions, keyed on a stable ID such as the message ID. The alternative is to store processed IDs in a sheet or database and check them at the start of every run.

HTTP 429 rate limit

The symptom is an error with status 429, which means too many requests, usually when a batch of items hits Claude at once. Anthropic's API overview, read on 25 October 2026, says the Claude API enforces rate limits by usage tier, with request and token per minute limits shown in the Claude Console. To reproduce it, call a test endpoint that always answers 429. To catch it, you have three options. Retry On Fail with Wait Between Tries handles short spikes. The Batching option in the HTTP Request node's Options sends items in small groups with a pause between them. Loop Over Items followed by a Wait node gives you the most control over pacing.

When all four checks are in place, set up a separate Error Workflow that starts with an Error Trigger node and sends you an email or a chat message with the workflow name and error text. Select it under the main workflow's settings. A failed run then reaches you the same day, before the client notices that a whole morning of emails went unanswered.

Limits and cost to check before you ship to a client

The Claude API has hard ceilings that matter for client work. Look them up on the day you quote, since they change. Anthropic's rate-limits page, as read on 25 October 2026, lists 300 requests per minute for create endpoints and 1,200 per minute for read endpoints. The same page lists monthly spend caps of $500 on the Start tier, $1,000 on Build and $200,000 on Scale. Re-check both figures before you promise a client any volume.

Anthropic's API overview, read on 25 October 2026, puts the maximum Messages request size at 32 MB. A plain email will never come close. A workflow that pastes a whole spreadsheet export into one prompt can hit it.

Anthropic's API release notes, checked on 25 October 2026, say usage tiers were consolidated into Start, Build and Scale and that Sonnet and Haiku rate limits now match Opus at every tier. The notes as cited don't give a date for that change. If an older tutorial names different tiers, trust the current page.

Per-token prices belong on Anthropic's API pricing page, and you should copy them from there into your quote on the day you send it. The consumer Claude plans are a separate product, and their prices tell you nothing about API costs. If you are still deciding between n8n Cloud and a self-hosted server for the client, the comparison of n8n Cloud pricing against self-hosting covers that side of the bill.

Pros and cons of using the HTTP Request node for Claude

The HTTP Request route gives you full control over the request, and in exchange you own every detail of it. Here is the honest balance.

Pros:

  1. You see the exact request that goes to Claude, which makes 400 errors far quicker to debug.
  2. New API features are usable on day one, because you only change the JSON body and don't wait for a node update.
  3. The cURL import saves typing and lowers the chance of a typo in a header name.
  4. The same pattern works for any REST API, so the skill carries over to the next client's stack.

Cons:

  1. Nothing checks your JSON against Claude's schema, so a wrong field name only shows up as an error at runtime.
  2. Retries can double your bill, because n8n can't tell whether a timed-out request was completed and charged.
  3. You maintain the request yourself, and a model ID that Anthropic retires will break the workflow until you update it.
  4. Error handling is fully manual, and a workflow without the four checks above will fail silently on real data.

Who should not build it this way

Skip the raw HTTP Request approach if the client will maintain the workflow without you and has never opened a JSON body. A hand-built request asks the maintainer to read API errors. A non-technical owner will call you every time one appears.

It is also the wrong choice if the job needs a guaranteed answer within seconds, such as a live chat reply. Claude calls can be slow, and retries make the worst case slower. Finally, if the client might switch AI providers next quarter, plan for that from the start. The guide on why to keep a backup AI provider when Claude or ChatGPT goes down explains why one provider shouldn't be a single point of failure.

FAQ

Should I use the HTTP Request node or a dedicated Claude node in n8n?

n8n lists Claude among its integrations, and its documentation describes the HTTP Request node as one supported way to connect. Pick the HTTP Request node when you want to see and control the exact request or need an API feature a packaged node may not expose yet. Pick a packaged node when the person maintaining the workflow is not comfortable editing JSON.

Does a Claude Pro subscription pay for API calls from n8n?

No. Anthropic prices its consumer plans separately from the API, and its plans page describes usage windows for the chat product. API calls from n8n are billed through your Anthropic API account, so check the API pricing page before you quote a client.

Why does my Claude request return a 400 error in n8n?

n8n's troubleshooting page names malformed JSON, badly formatted arrays and invalid query names or values as causes of 400 errors. In Claude workflows, the usual cause is input text with quotes or line breaks dropped into the body unescaped. Wrap the field in JSON.stringify inside the expression and run the node again.

Is it safe to turn on Retry On Fail for Claude calls?

It is safe for rate limit errors and network failures that happen before Claude receives the request. It is risky for timeouts, because the request may have completed and been billed on Anthropic's side. Keep Max Tries low, set a generous Timeout, and put duplicate protection before the call.

Can I send a long document to Claude through the HTTP Request node?

Yes, within Anthropic's limits. The API overview, read on 25 October 2026, lists 32 MB as the maximum size of a Messages request. Very long inputs also eat into your tokens per minute limit, so space them out with batching or a Wait node.

Verdict

The HTTP Request node is the most transparent way to put Claude into a client workflow, as long as you accept the deal it offers. Use n8n's HTTP Request node as a generic client: you supply Claude's authentication, JSON body and error handling, and n8n just sends the request. Copy the request shape from Anthropic's docs, keep the key in a credential, escape your data with JSON.stringify, and add the four checks plus an Error Workflow before go-live.

Related reading

  1. A full build that uses this pattern: how to sort Gmail automatically with n8n and Claude.
  2. The bigger career question for freelancers: whether n8n is worth learning in 2026 for solo automation work.
  3. Another Claude workflow you can adapt: turning meeting transcripts into action items with n8n.

About the author

This guide comes from The Tool Signal editorial team, which covers AI and automation tools for freelancers and small businesses. It draws only on n8n's and Anthropic's own documentation as read on 25 October 2026, and every vendor figure is listed with its source in the claims block below. The team didn't run the four failure tests for this article, so treat them as tests to run yourself before a client depends on the workflow. The guide on how to call the Claude API from n8n with the HTTP Request node will be updated when either vendor changes the request format or the limits quoted here.

If you want a ready-made solution instead of building this yourself, we put together AI Email Triage Kit for n8n.

What we checked, and what is the vendor's word

  • n8n HTTP Request node: The n8n HTTP Request node sends REST requests with a method, URL, query parameters, headers and body, and can import a cURL command to fill those fields. Vendor's claim, not verified by us (25 October 2026, source).
  • n8n HTTP Request node: n8n describes connecting to Claude through the HTTP Request node with generic authentication such as Header Auth, OAuth or query authentication. Vendor's claim, not verified by us (25 October 2026, source).
  • n8n HTTP Request node: n8n's troubleshooting page lists malformed JSON, badly formatted arrays and invalid query names or values as causes of HTTP 400 errors. Vendor's claim, not verified by us (25 October 2026, source).
  • n8n HTTP Request node: n8n's troubleshooting page says to configure Max Tries to retry a failing node. Vendor's claim, not verified by us (25 October 2026, source).
  • Claude API: The Claude API enforces rate limits and spend limits by usage tier, with request and token per minute limits visible in the Claude Console. Vendor's claim, not verified by us (25 October 2026, source).
  • Claude API: Anthropic's rate-limits page lists 300 requests per minute for create endpoints and 1,200 requests per minute for read endpoints. Vendor's claim, not verified by us (25 October 2026, source).
  • Claude API: Anthropic's rate-limits page lists monthly spend caps of $500 for Start, $1,000 for Build and $200,000 for Scale. Vendor's claim, not verified by us (25 October 2026, source).
  • Claude API: The Claude API overview lists a maximum request size of 32 MB for Messages and Token Counting. Vendor's claim, not verified by us (25 October 2026, source).
  • Claude API: Claude API release notes say usage tiers were consolidated into Start, Build and Scale, and Sonnet and Haiku rate limits now match Opus at every tier. Vendor's claim, not verified by us (25 October 2026, source).

Prices and limits move. Each line above says the date we last saw it on the source page.