error using REST Assistants API for creating thread

kengster13 50 Reputation points
2024-02-09T16:36:27.08+00:00

I have a named resource anewgo-assistants created in US East 2. When I tried

curl https://anewgo-assistants.openai.azure.com/openai/threads \
  -H "Content-Type: application/json" \
  -H "api-key: MY_API_KEY" \
  -d ''

I am seeing this error:

`{"error":{"code":"404","message": "Resource not found"}}

The curl command follows what is in the Quick Start guide and also looks consistent with the API share I observed from the Playground logs.

Any idea why I am seeing this error?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,080 questions
{count} votes

Accepted answer
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2024-02-13T00:08:24.3733333+00:00

    Hello @kengster13 , I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: `{"error":{"code":"404","message": "Resource not found"}} error using REST Assistants API for creating thread

    Solution:

    The command worked for the user is:

    curl -X POST "https://YOUR_AZURE_OPENAI_RESOURCE_NAME.openai.azure.com/openai/threads?api-version=2024-02-15-preview" 
    -H "Content-Type: application/json" 
    -H "api-key: YOUR_AZURE_OPENAI_API_KEY"
    -d ''
    

    Thank you again for your time and patience throughout this issue.

    Regards,

    Vasavi

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. kengster13 50 Reputation points
    2024-02-12T13:43:31.86+00:00

    Looks like the documentation for creating thread with the REST API is inaccurate. I did finally get it to work with the following command. For posterity...

    curl -X POST "https://YOUR_AZURE_OPENAI_RESOURCE_NAME.openai.azure.com/openai/threads?api-version=2024-02-15-preview" -H "Content-Type: application/json" -H "api-key: YOUR_AZURE_OPENAI_API_KEY" -d ''
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.