Does the Assistants API work?

kengster13 50 Reputation points

I did a cut and paste copying the example from the quickstart guide for the REST version of the API. I created the resource instance of US East 2, and updated the curl command below with my resource name and the API key. However, the curl command returns the following error:


Anyone else given this a try? curl \ -H "api-key: $AZURE_OPENAI_KEY" \ -H "Content-Type: application/json" \ -d '{ "instructions": "You are an AI assistant that can write code to help answer math questions.", "name": "Math Assist", "tools": [{"type": "code_interpreter"}], "model": "gpt-4-1106-preview" }'

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

Accepted answer
  1. Saurabh Sharma 23,251 Reputation points Microsoft Employee

    Hi @kengster13
    Welcome to Microsoft Q&A! Thanks for posting the question.

    You are getting this error as you are not passing the correct model name to the api request.

    As mentioned in the document you need to pass the deployed model name as "model" in the request body.

    User's image

    You can get the deployed models under "deployments" section on open ai portal. (see the screenshot below) User's image

    I have tested this with a resource in East US 2 region with a deployed model and it works as expected. (see below) User's image

    Please let me know if you still see any issues.



    Please 'Accept as answer' and Upvote if it helped so that it can help others in the community looking for help on similar topics.

0 additional answers

Sort by: Most helpful