[Self-Host] The model gpt-4o
does not exist or you do not have access to it.
#1052
Labels
gpt-4o
does not exist or you do not have access to it.
#1052
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
def generate_completion(role, task, content):
"""Generate a completion using OpenAI."""
print(f"Parameters: role={role}, task={task[:50]}..., content={content[:50]}...")
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": f"You are a {role}. {task}"},
{"role": "user", "content": content}
]
)
Why do I still encounter an error related to "4o" even after setting the model to "gpt-4o-mini"??
File "D:\apps\python\Lib\site-packages\openai_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model
gpt-4o
does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}The text was updated successfully, but these errors were encountered: