Problem in node ‘Create an assistant

Describe the problem/error/question

I am building an n8n workflow that uses an openai node with operation create and assistant. I added the description, instructions, and credentials. But when I am executing the step I am getting this error “ Bad request - please check your parameters. You must provide the ‘OpenAI-Beta’ header to access the Assistants API. Please try again by setting the header ‘OpenAI-Beta: assistants=v2’“

Bad request - please check your parameters. You must provide the ‘OpenAI-Beta’ header to access the Assistants API. Please try again by setting the header 'OpenAI-Beta: assistants=v2

  • n8n version: 1.113.2
  • Running n8n via : cloud
1 Like

Hello Ai_Department, i’ll try to help yaa!

I think that error comes from OpenAI, not n8n. The assistant API (/v2/assistants) is still in beta, and OpenAI requires a special header on every request:

OpenAI-Beta: assistants=v2

Maybe you can try this:

  • Use HTTP Request node::
    • Method: POST
    • URL: https://api.openai.com/v1/assistants (or endpoint you need)
    • Headers:
      • Authorization: Bearer {{$credentials.openAiApi.apiKey}}
      • OpenAI-Beta: assistants=v2
    • Body: your assistant config (model, instructions, etc)
    • This is the only way to talk to the beta Assistants API from n8n today

I think n8n’s OpenAI node doesnt yet send OpenAI-Beta: assistants=v2. For now, switch to HTTP Request and set that header yourself.

Thats all i can share to you, hope this will be works! :blush::raising_hands:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.