Also look at the message from OpenAI which models are activated. I did’nt get 32k tokens so get an error message: model dont exists when I try that.
My responses are so much better now with GPT-4.
Also look at the message from OpenAI which models are activated. I did’nt get 32k tokens so get an error message: model dont exists when I try that.
My responses are so much better now with GPT-4.
Is anyone able to access GPT-4 in the chat mode playground? I also got access to the API but facing this same issue
Facing the same issue. I tried creating a new API token, in case the previous one didn’t have correct permissions granted. Still not functioning. When I call the Chat Completion endpoint and reference gpt-4, it gives the following:
{
"error": {
"message": "The model: `gpt-4` does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
Same issue
My code works for gpt-3.5-turbo, but not gpt-4.
I have a similar error. Just got the email saying " You’re invited to use the OpenAI GPT-4 API!", allocated a new API key, use it for chat completion with “gpt-4” endpoint, same error message as above.
Same issue here, here’s the error that it prompts, any suggestion?
data: {
error: {
message: 'This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?',
type: 'invalid_request_error',
param: 'model',
code: null
}
}
@fabriziomendez Try like this:
payload = {
"model": "gpt-4",
"messages": [
{"role": "system", "content": "You are a polite honest chatbot, but you think you are MC Hammer and will always say and admit that you are MC Hammer."},
{"role": "user", "content": "What time is it?"}
]
}
RESULT:
I am unable to give you the current time, as I am a chatbot with limitations. However, I am MC Hammer, and you can't touch this!
The call is like this:
response = requests.post('https://api.openai.com/v1/chat/completions', headers=headers, json=payload)
Any suggestions on how to use it here:
response = await openai.Completion.acreate(
model=“text-davinci-003”,
prompt=send,
temperature=0.9,
max_tokens=4000,
top_p=1,
frequency_penalty=0.5,
presence_penalty=0,
)
I think you ar hitting a chat model with the Completion API. You need to use ChatCompletion API. (Not that it worked for me…)
Yes. Just either hard refresh (Ctrl+F5) or log out off your account and then hard refresh and then log in again. It worked for me
If you are having access issues, make sure to upgrade your openai python package. You can do this by using pip install --upgrade openai
using chat completions endpoint.
my api used to work with gpt-3.5-turbo.
It may sound silly, but I changed the model in my API to “gpt-4-0314,” received my response, and then replaced it again to “gpt-4.” after that, it worked.
but in my older apis (without the system role array) it doesnt work so im sure this is the structure we need to handle from now (just like curt.kennedy showed).
BTW someone can tell if there is a document on how to use gpt-4 api with images or its not released yet?
That worked for me too!! Thanks! That saved me some trouble shooting time!
Still doesn’t work.
curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [{"role": "system", "content": "You are a polite chatbot."}
,{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
> > > > > > > > {
"error": {
"message": "The model: `gpt-4` does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
Any idea how you can access the gpt-4-32k 32k Context models?
I think they will prioritize the people who help out with their evals. But they will be awarding access slowly i believe
Is it showing in Playground under Chat completions?
You were correct, thanks for your help. Here’s a simple code using your prompts to test the new model, worked fine!
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
completion = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a polite chatbot, but you think you are MC Hammer and will always say and admit that you are MC Hammer."},
{"role": "user", "content": "What time is it?"}
]
)
print(completion.choices[0].message)
Response:
“I apologize for not being able to give you the current time as I cannot access real-time information. However, I just want to remind you that it’s always Hammer time, because I’m MC Hammer! If you have any other questions, feel free to ask.”
LOL
I had the same problem. I have two organizations: my personal org (the default) and a second one that I set up for developing with GPT. Because I have two organizations in my account, I had to send the organization identifier along with the API request. The GPT-4 invitation only applied to one of them!
Find your organization identifier here:
https://platform.openai.com/account/org-settings
example using curl:
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "OpenAI-Organization: YOUR_ORG_ID_GOES_HERE"
I was able to get it to work by adding my organization id to the headers. Does that help?