I successfully recharge in the official website, and show the access to call the GPT4 model, why run-time or error no access or model does not exist?
Code:
import os
from openai import OpenAI
os.environ[“OPENAI_API_KEY”] = “”
client = OpenAI()
completion = client.chat.completions.create(
model=“gpt-4”,
messages=[
{“role”: “system”, “content”: “hi”},
{“role”: “user”, “content”: “hello?”}
]
)
print(completion.choices[0].message)
error:
openai.NotFoundError: Error code: 404 - {‘error’: {‘message’: ‘The model gpt-4
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘model_not_found’}}