When I try the "gpt-4" model chat completion in API request, I get an error: That model does not exist

Is GPT-4 supposed to be visible in the playground if you have been approved? I thought it was the api only.

1 Like

I received the email this morning and am getting the 404 error. Which API library are you using? I’m getting the error with the NodeJS api.

Check “chat” mode not “completion” mode, https://i.imgur.com/csiX3l8.png

1 Like

Quick update, after running npm install openai --save again, the GPT-4 model seems to be working

Yup I see it, I had to call the chatCompletions in the code as well. Thanks!

1 Like

I have it in playground and also API

I got an invite but was getting the above error. It then worked after I generated a new API key.

@benlamm I had the same issue. You must update your version of the openai library. Run pip install openai and try it again, it worked for me.

Related to this, I would suggest a more descriptive error message, since it’s public info that the model exists. I think a better error message would reduce the confusion.

For me, the problem was that I didn’t set the default organization in this page OpenAI API

Once I set the organization to be the organization that got access to GPT4, I can call GPT-4 sucessfully

1 Like

I got the same error after I got an invitation.

In my case, it worked right after I tried GPT4 once on the OpenAI Playground. I’m not 100% sure if it was the actual trigger, though.

After getting notified of limited beta access, swapped GPT-3 “text-davinci-003” with “gpt-4”. Gives 404 error. Not sure what else needs to be done. Maybe not turned on for account yet? Need a new token maybe?

		CompletionRequest request = CompletionRequest.builder()
				.model(full_engine)
				.prompt(mood.get(feeling) + prompt)
				.maxTokens(248)
				.temperature(0.8)
				.topP(1.0)
				.frequencyPenalty(0.55)
				.presencePenalty(0.19)
				.user(sndr)
				.echo(false)
				.build();
		List<String> responses = new ArrayList<String>();

Flagged to the team, in general, if you want to try GPT-4 in the playground and you have access, you need to use the Chat setup: OpenAI API, same with the API: OpenAI API.

Will talk to the team and see if we can look into this more.

1 Like

I had to create a new api key after gaining access to gpt-4 to be able to use it. works now.

I’d try the code below which worked for me (JavaScript):

const { Configuration, OpenAIApi } = require("openai");


  const configuration = new Configuration({
    apiKey: "<INSERT-API-KEY-HERE>",
  });

  const openai = new OpenAIApi(configuration);

  const response = await openai.createChatCompletion({
    model: "gpt-4",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Who won the world series in 2020?" },
      { role: "assistant", content: "The Los Angeles Dodgers." },
      { role: "user", content: "Where was it played?" },
    ],
    max_tokens: 50,
    n: 1,
    stop: null,
    temperature: 1,
  });

  console.log(response.data.choices[0].message.content);

Also wrote a quick guide here with some Do’s & Don’ts to get it working - might be of use :+1:

For anyone still having issues… I think the invite came out in sets, some did not get the 32k model. Even if you have the invite, but did got the 32k model access, you will get a 404 in node.

I got this 404 too (“message”: “The model: gpt-4 does not exist”). When I went into the .py file and changed it to model=gpt-3.5-turbo it ran. I tried creating a new API key like @Barni_77 but it didn’t seem to help. I checked for my organization like @shuo too, but to no avail. I updated openai like benlamm suggested.

Update
I ran across a link to get on the ChatGPT 4 API waitlist. I had foolishly assumed everyone now had access to API calls for gpt-4. If you want the link I found it on GitHub

I think part of this problem is that the error message claims a false statement, which makes the situation more confusing.

Related: When I try the "gpt-4" model chat completion in API request, I get an error: That model does not exist - #19 by felixbade

@felixbade I agree this could be better. Part of the reasoning to keep it generic is just around the error message logic. There are models that are internal only for example that if people could query and get “you don’t have access to gpt-xyz” it could cause confusion.

With that said, I totally agree for models like GPT-4 we should improve this. The team is going to look into it, thanks for the feedback and hopefully we will see an improvement soon.

@checkoff everyone with a $1 or more successful payment on their account now has access. If you don’t have access yet, stay tuned until the end of the month when we grant wider access to all developers.

1 Like