OpenAI assistant data fetching failer ( API Call)

I am reaching out for assistance regarding an issue I’ve encountered while attempting to call my custom assistant via the OpenAI API. I have created an assistant with its unique ID, but I am unable to successfully interact with it through my application using the API.

I am using Dart with the http package to send a POST request to https://api.openai.com/v1/assistants/{assistant_id}/completions, but I am encountering errors or no response. I have ensured that my API key is correct and included in the authorization header, and that the request structure follows the API documentation. However, the issue persists, and I am unable to get the assistant to respond as expected.

Here are the key details:

API Key: Correct and valid (included in headers)
HTTP Method: POST
Endpoint: [https://api.openai.com/v1/assistants/{assistant_id}/completions](https://api.openai.com/v1/assistants/assistant_idPreformatted text/completions)
Request Body: Contains the necessary model, messages, and other required parameters
I would appreciate any guidance or clarification on whether there are any specific steps, permissions, or configurations required to access a custom assistant via the API. Additionally, if there are any known limitations or issues related to calling assistants from the API, I would be grateful for your insights.

what is the correct end point i should use , can u please write a sample API call for an assistant , I appreciate your help

Thank you for your support, and I look forward to your response.

There are completions and assistants. but assistant/completions do not exist. There are lot of cookbooks to get going - and a lot of repo’s to play with too. https://platform.openai.com/docs/assistants/quickstart is a good start

2 Likes

The Endpoints are wrong. In order to use Assistant, you have to create thread, add messages to it, then Run it and stream the output. Check this video on OpenAI Assistant

1 Like

Did you make with html? When you try to interact did you see some errors on the traffic ( inspection)

I do one already as a chatbot and prompt you can write if you need assistancr