I’m trying to get new model response which has the the web search tool
method POST https://api.openai.com/v1/responses
I’ve set up the header auth with: Name
Authorization Value
Bearer my-API
but it keep on giving me error of authentication:
Error code 401
Full message
{
"error": {
"message": "Missing bearer or basic authentication in header",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Looking at your error, I think the issue is with your authentication setup in n8n. Even though you mentioned setting up the header auth with “Authentication” as the name and “Bearer my-API” as the value, the error suggests the authentication header isn’t being properly sent.
Here’s how to fix it:
The header name should be Authorization (not Authentication)
Make sure there’s a space between “Bearer” and your API key
If you’re using the HTTP Request node in n8n, you can also configure the authentication directly in the “Authentication” tab of the node:
Select “Bearer Token” as the authentication type
Enter your OpenAI API key (without the “Bearer” prefix) in the token field
This approach is generally more secure than putting your API key directly in the headers, as n8n will handle the proper formatting of the Authorization header for you.
Or Simply just In your HTTP Request node, under Authentication, you should select Header Auth and manually add a header: Authorization: Bearer YOUR_API_KEY.
Currently, you only have “Authentication” as the header name, which OpenAI doesn’t recognize.
yeah I’ve mistakenly written here but I used Authorization correctly.
And I made sure about the space between Bearer and the api key. But it still not working. I tried to use either fixed or expression in the atuthentication just to see if there was a bug in one of them but still didnt work.
I tried with this configuration too but it doenst’t work
the only thing I didn’t try is this one
but I can’t find it in the node Authentication drop menu