# Why does my OpenAI agent deny access to models?

**URL:** <https://community.openai.com/t/why-does-my-openai-agent-deny-access-to-models/1276887>\
**Category:** Bugs\
**Tags:** gpt-4, gpt-35-turbo, chatgpt, api, assistants-api\
**Created:** [June 3, 2025, 12:27pm UTC](https://community.openai.com/t/why-does-my-openai-agent-deny-access-to-models/1276887 "2025-06-03T12:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicobarbosa21](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nicobarbosa21](https://community.openai.com/u/nicobarbosa21)\
**Post date:** [June 3, 2025, 12:27pm UTC](https://community.openai.com/t/why-does-my-openai-agent-deny-access-to-models/1276887/1 "2025-06-03T12:27:18Z")

</div>

Hello everyone, I have a little problem trying to create an agent with my API key.  
I’m doing this agent “github/openai/openai-voice-agent-sdk-sample” and when I run the backend and try to sent a message to the agent I receive this output in the console:  
“openai.APIError: Project `proj_sG7R3Zp075RBUtPkhThHg7RJ` does not have access to model `gpt-4o-mini-2024-07-18`  
INFO: connection closed”

This happens when I use model=“gpt-4o-mini”, if I change the model to gpt-3.5-turbo for example, I receive a similar output:  
openai.APIError: Project `proj_sG7R3Zp075RBUtPkhThHg7RJ` does not have access to model `gpt-3.5-turbo-0125`  
INFO: connection closed

Now I’ve created a simple script that shows me my available models, when I run it I get:  
SyncPage[Model](data=[Model(id=‘gpt-3.5-turbo’, created=1677610602, object=‘model’, owned\_by=‘openai’), Model(id=‘gpt-4.1-mini’, created=1744318173, object=‘model’, owned\_by=‘system’), Model(id=‘gpt-4.1-nano-2025-04-14’, created=1744321025, object=‘model’, owned\_by=‘system’), Model(id=‘gpt-4.1-nano’, created=1744321707, object=‘model’, owned\_by=‘system’), Model(id=‘gpt-4.1-2025-04-14’, created=1744315746, object=‘model’, owned\_by=‘system’), Model(id=‘gpt-4.1’, created=1744316542, object=‘model’, owned\_by=‘system’), Model(id=‘gpt-4.1-mini-2025-04-14’, created=1744317547, object=‘model’, owned\_by=‘system’)], object=‘list’)

So, I have access to a lot of models, but I don’t why I can’t use them in the agent, and I also try this:  
try:  
response = client.chat.completions.create(  
model=“gpt-4o-mini”,  
messages=[{“role”: “user”, “content”: “Hello”}]  
)  
print(“Access granted!”)  
except Exception as e:  
print(e)

I and receive as output: Access granted!  
So I definitely have access to those models but I don’t know how to use it in the agent.

Does anyone how to fix it or what’s happening?
