API Connector plugin setup for a Customized ChatGPT

Hi,

I’m stuck with the OpenAI API call configuration for a Customized ChatGPT that I want to access through the OpenAI Call, within the workflow of my Bubble App.
Something doesn’t set properly, I’m using API Connector plugin.
I configured all the needed fields, authorization, keys etc. I think so…
When I initialize my API Call I get failure points on the POST URL .
This is the error:
Raw response for the API Status code 404
{ “error”: { “message”: “Invalid URL (POST /v1/assistants/asst_ssEeCeqnUR5Urp6Fwy2vSyhr/threads/thread_p7KOaz04bM0rIZiB32LRZXS2/runs)”, “type”: “invalid_request_error”, “param”: null, “code”: null } }
asst_ssEeCeqnUR5Urp6Fwy2vSyhr - this is the assistant-id of the customized ChatGPT.
thread_p7KOaz04bM0rIZiB32LRZXS2 - this is the thread-id that I created just before initializing the API call.
I set my OpenAI API Key in the Authorization field.

As I said, I’m stuck, I don’t have any idea what’s missing :frowning:

  • I can work with non-customized ChatGPT, my problem is to switch to the dedicated ChatGPT that I created.

Thanks in advance,
Yoni.

1 Like

Can you share link to API doc for the endpoint you are trying to reach? Pretty sure you don’t have the correct uRL. Also, there’s an endpoint to create threads and run it in a single call…

https://platform.openai.com/docs/api-reference/runs/createThreadAndRun

this error means is not found, confirmed if you usinng correct api_token of Open AI

Thanks for your support.

I’ve managed to connect my App to the customized Chatgpt agent, using assistant and OpenAI API key.

Now I’m facing a timing problem.
In the App workflow I set these actions:
Create Thread, Create Message, Run Message, Get Message, Get Messages List.
I can’t control the timing of the workflow steps.
I added Psuse (30 second) between actions and I’m running step by step using the debugger, however I see that the last action ocuurs immediately, right after Message is sent.
So I can’t capture agent response, it’s too fast.

Please advice.
Thanks.

Instead, Schedule a backend WF to get the response later. You may need to create a DB thing to store some informations and reuse it in frontend

But how can I set the delay which’s needed after Create Message? Message status is “queued” and I can’t hold the Get Messages API call till status will be changed to “completed”. So I see only the first message on the Thread w/o any respone…

You schedule backend API workflow at the time you want. If you know that it take one minute. schedule it with current date:plus minutes 1 . In this workflow, fetch the response. You can also validate if the response is completed. If not,reschedule the same workflow (schedule itself 1 min later)

Sounds like a great solution.
I’m not familiar with a backend workflow, how to create and trigger… I’m using only WFs which are triggered by buttons, frontend WFs… :frowning:

Manual:

But you can find many video tutorial about how to use backend WF

I read documentation about api WFs, I’ll try it.
Many thanks!

Thanks, it works for me now :+1:

This topic was automatically closed after 70 days. New replies are no longer allowed.