chovy
chovy

Reputation: 75686

OpenAI GPT-3 API error: "That model does not exist"

Get "That model does not exist" from api call in node.js

const chatGptUrl = "https://api.openai.com/v1/engines/chat-gpt/jobs";

...

const response = await axios.post(
      chatGptUrl,
      {
        prompt,
        max_tokens: 100,
        n: 1,
        stop: "",
      },
      {
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${chatGptApiKey}`,
        },
      }
    );

    const responseText = response.data.choices[0].text;

Upvotes: 1

Views: 4955

Answers (2)

sk123
sk123

Reputation: 1

use

model='gpt-3.5-turbo'

Or any other from the list, as per your access and requirements.

Ref. https://platform.openai.com/docs/models/overview

Upvotes: 0

Rok Benko
Rok Benko

Reputation: 22920

Problem

You didn't set the model parameter. You have to set the model parameter to any OpenAI model that is compatible with the Completions API endpoint. It's a required parameter. See the official OpenAI documentation.

Screenshot 1

Solution

Set the model parameter. You can choose between the following models:

  • gpt-3.5-turbo-instruct
  • babbage-002
  • davinci-002
  • text-davinci-003
  • text-curie-001
  • text-babbage-001
  • text-ada-001


Also, all Engines endpoints are deprecated.

Screenshot 2

Use the Completions API endpoint.

Change the URL from this...

https://api.openai.com/v1/engines/chat-gpt/jobs

...to this.

https://api.openai.com/v1/completions

Upvotes: 3

Related Questions