Authorization failed - please check your credentials

Hello guys,

I am trying to connect to fal.ai API trough header auth but it doesnt work and says: Authorization failed - please check your credentials
Cannot access application ‘fal-ai/flux-pro’. Authentication is required to access this application.

Error code

401

Full message

401 - "{\"detail\": \"Cannot access application 'fal-ai/flux-pro'. Authentication is required to access this application.\"}"

Request

{ "body": { "prompt": "Two men are walking up a grassy slope on a sunny day, surrounded by green trees and bushes; one is carrying a wooden pallet with gloves, while the other holds a box, with a narrow road visible in the background.", "image_size": { "width": 1024, "height": 768 }, "num_inference_steps": 30, "guidance_scale": 3.5, "num_images": 1, "enable_safety_checker": true }, "headers": { "Key": "**hidden**", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "POST", "uri": "https://queue.fal.run/fal-ai/flux-pro/v1.1-ultra", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true }

Item Index

0

Node type

n8n-nodes-base.httpRequest

Node version

4.2 (Latest)

n8n version

1.78.1 (Cloud)

Time

19. 2. 2025 10:49:05

Stack trace

NodeApiError: Authorization failed - please check your credentials at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:525:33) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:633:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:882:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1216:20

I am sure I used correct API key

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:
1 Like

hello @molllko

That means are you doing something wrong. I do not see any iformation about the authentication on their side, so check the internall docks about the token work

I followed the instruction but no idea. I just discoverred 1 thing. When I save new Headher auth. it always automatically rewrite to: __n8n_BLANK_VALUE_e5362baf-c777-4d57-a609-6eaf1f9e87f6 This could be the problem

No, that’s fine. Your credentials start to be encrypted. Usually, an API uses Bearer Auth when we are talking about tokens, so you would need to use Header auth with something like this

WOW! it works shapr!! :slight_smile: Thank you, you are genius :slight_smile: Now I have another problem :smiley: I attached a screenshot with data. But as you can see on output they are somehow messy. I need them to be strusctured as at left side at output. Next step reads {{ $json.request_id }} if process is done. If yes it continues if not it start all over again

Can’t say why it returns data as HTML. You can save the output into file and open it with a browser to see how it looks

I figured it out, it was just a wrong url :slight_smile: Thanks a lot.

I am having the same issue but no matter what I put in the value field it does not work. @barn4k I don’t have to put the <> before and after the api key right? I’ve tried it with and without and still getting the auth error. Please help!

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

It depends on the token. If it’s Bearer, then no. Bearer token looks as follows: Bearer myTokenValue123Something. I don’t see docs for the service, so can’t say what they are expecting from you