Services Plugins FAQs

Open ai & ChatGPT plugin API key error

I’m getting this error when attempting an api call using this plugin. It say I don’t have the correct API key. I double checked and its the correct key. Then I created a new key and entered that one. Still got this error. Am I entering the api key in the correct place?

1 Like

Enter your OpenAI API key in the “Authorization (shared headers)” box and save. Make sure your plugin is updated to version 4.17.0. If errors persist, seek help from Zeroqode support.

1 Like

Hello @cohereandnow, :wave:

Please accept my apologies for the delay over the weekend. :pray:

It looks like you’re on the right track, but the error message you’re encountering suggests that the API key needs to be entered in a specific format. You should prefix your API key with the word ‘Bearer’, followed by a space, and then your API key.

In the plugin settings where you’ve entered your API key, it should look something like this:

Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc(Replace sk_test_4eC39HqLyjWDarjtT1zdp7dc with your actual API key.)

You’ll typically enter this in the Authorization (shared headers) input field in your plugin settings, under the Headers section where it asks for the “Authorization”.

Please try updating this in your plugin settings and see if that resolves the issue. Please refer to the plugin documentation Setup Guide: Notion – The all-in-one workspace for your notes, tasks, wikis, and databases., which provides examples and additional details on setting up the plugin.

I hope this helps, and if you continue to encounter any issues, please let me know.

Best regards,
Daniel.

Got it! Thank you for that. Now I’m getting this error when attempting to use dall-e.

Screenshot 2024-04-16 at 9.38.39 PM

I haven’t changed the default settings for the workflow. I tried changing the number of images to 1 but still got the same error. Any idea what this error is?

I’m also trying to get Generate a response from an assistant. I see the “retrieve assistant” action in workflows but that doesn’t seem to be the action for sending a query to an assistant and getting a response. Is there a second action I need after I retrieve it? I didn’t see any documentation linked to this action in the plugin. Any guidance would be helpful. Thanks!

Hello @cohereandnow, :wave:

I am glad that error with API keys was solved. About the error when trying to generate an image: it seems like you’re encountering an HTTP 429 error, which is typically related to too many requests being sent to a server in a given amount of time. Please include a pause as it is done on our demo page, and ensure you have the same setup, that might solve the issue:

About your second question trying to generate response from an assistant: You would need to use generate completion action:


Than you would need to display the response through the state:

Please review the last part of the docs with the workflow example:

I hope this helps!

Best regards,
Daniel.

Thanks for that. I understand how to generate a completion. I’m wondering how to generate a completion from one of my assistants and receive a message back. I see how to create, modify, edit or delete an assistant with the plugin but I’m confused on how to talk to one. I checked the doc you included and noticed its probably #9-12 in the doc. I’m confused by which of those to use and how it getting a response works.

Thanks for your help!

Hello @cohereandnow, :wave:

To communicate with one of your assistants and receive a message back, you’ll need to follow a series of steps involving creating a thread, then creating messages within that thread, and finally creating a run to execute the interactions.

Here’s a simplified breakdown of the process:

  • Create Thread: This is the initial step where you establish a communication thread with your assistant. Think of it as starting a conversation.
  • Create Messages: Once the thread is created, you can send messages to your assistant within this thread. Each message you send will be handled as an input to the assistant.
  • Create Run: After setting up your messages, you will execute a run. This action processes the interactions (messages) you’ve established and allows the assistant to generate responses based on the inputs provided.

By following these steps, you should be able to send prompts to your assistant and receive the corresponding responses.

Best regards,
Daniel.

Ok that makes sense, thank you. I still have a couple questions.

First the Create thread action doesn’t have any input options. Is this how its supposed to be?

Second, the create message action: I don’t see an option for thread ID. It seems like “body id” is getting the thread id. Is that right?

I think I know the answer to the first two so this is the most important one. Which of the three actions (Thread, Message or Run) do I reference for the response and which value do I choose? I tried a ton but haven’t figured that out.

Also, are these three actions required every time I send a message to the assistant? After a conversation has already been created and i want to send a second message in the same thread, do I just run Create message and create run?

Thank you so much for your help!