I can't connect my anthropic api to n8n

I can’t connect my anthropic api to n8n


ERROR: Forbidden
I tried it on the hosting server and tried it on the local server, the result is always the same.
API is working and up-to-date. I checked API through make.com and it works. How to connect to n8n?

n8n version: 1.58.1
Database default
n8n EXECUTIONS_PROCESS setting default
Running n8n via hosting server and tried it on the local server
Operating system: Ubuntu, Win

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hello @Yuriy_Lvov ,

Welcome to our n8n Community!

Thanks for sharing the issue you are facing with us here.

I tried to connect with a trial account I have with anthropic and I did get a different error from you. While you are getting Forbidden, I got a Bad request without much detail of it.

Checking the logs in docker did not provided much as well:

To test in a different way, I used the n8n HTTP Request and I got a Bad Request with further details:

For testing purpose, I added a random character to the token and I do get a authentication issue as expected:
Screenshot 2024-09-13 at 10.01.43

So, I believe my issue is due to the fact my trial account does not have credits to perform the Request.

However, your issue is 403 Forbidden, this could be related to some permissions issues in the anthropic environment. I am wondering if the test done with Make is going on the same setup as the ones in n8n?

Some ideas here:

1- Can you run docker with DEBUG level to see if it shows more details? For this you need to start docker with flag -e N8N_LOG_LEVEL=debug then you can tail the logs with command docker logs -f <container_name_or_id>

2- Can you test using n8n HTTP Request node for validation? I based on documentation Create a Message - Anthropic

Let’s see if any other community member has come across with similar matter and can chime in as well.

1 Like

I have exactly the same problem

I had the Bad Request issue which was resolved after I purchased credits on Anthropic for the API.