I’m chatgpt Plus subscriber, but also Tier 3 API user
I’ve tried to use codex in multiple ways:
using --free option
providing my own api key
log in witch chatgpt account
Every attempt ends up with same error message
The model “codex-mini-latest” does not appear in the list of models available to your account. Double-check the spelling (use
openai models list
to see the full list) or choose another model with the --model flag.
How to enable model for my account ? Are they Country restricted (I’m in EU)
This model is currently only available to Pro/Enterprise/Team subscribers I believe. You need to use the new --login feature which will allow you to use your OpenAI sign-in. Then you grant access to your project, and if the model is available, you can use it in Codex.
Observe that you have organization access to the API model, using your existing Python OpenAI environment, in this example code I produced to check the models endpoint for you:
import asyncio
from openai import AsyncOpenAI
async def fetch_filtered_models(keywords):
def contains_keyword(model_name, keyword_items):
return any(kw in model_name for kw in keyword_items)
try:
client = AsyncOpenAI()
model_obj = await client.models.list()
except Exception as err:
print(f"\n[Error] Model listing API call failed: {err}")
return None
model_dict = model_obj.model_dump().get("data", [])
model_list = sorted([model["id"] for model in model_dict])
filtered_models = {
model for model in model_list if contains_keyword(model, keywords)
}
return list(filtered_models)
async def nab_models():
match_keywords = ["computer", "code"]
print("Getting organization models only matching keywords")
filtered_models = await fetch_filtered_models(match_keywords)
if filtered_models:
for model in filtered_models:
print(model)
else:
print("error: no matching models returned")
if __name__ == "__main__":
asyncio.run(nab_models())
output:
Getting organization models only matching keywords
computer-use-preview
codex-mini-latest
computer-use-preview-2025-03-11
Then make a test call to the model, requiring the Responses endpoint, no sampling parameters, and parsing past the reasoning summaries also returned:
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="codex-mini-latest",
input=[
{
"role": "system",
"content": [
{
"type": "input_text",
"text": "You are a computer programmer's assistant code-writer."
}
]
},
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Produce a one-paragragh introduction to assistant"
}
]
}
],
max_output_tokens=3456, # needs reasoning budget
store=False
)
for item in response.output:
if not hasattr(item, 'content') or item.content is None:
continue
for entry in item.content:
print(entry.text)
>>OpenAI Assistant is an AI-powered coding partner designed to help developers write,
Then you can proceed to the Agent Codex SDK if that is your target, updating all libraries, as it was updated as recently as two days ago. Follow the model configuration file instructions.
sorry for lack of response,
I solved the problem by removing project (which was created long time ago when gpt-3.5 was top model) and creating new one, I guess some old projects are not upgraded correctly and do not have new models available
In my particular case, I had added my open api key to key as a environemt on my bash profile, which didnt work. I was getting the error after running just: “codex” on my terminal. The following was my solution
Did the login using opan ai on browser → Still same error
Erased environment variable → The Interactive environment got open but the model is still unvavailable.
When I tried to make a question to codex, I got a warn from open ai, saying that the model is not found
Do the validation of your user, You need to take pictures of your id and of yourself
Still didnt work, but the model appeared. I think it’s just a matter of time now. I will update this comment, as soon it starts working
Yep, It’s working now. Around 20minutes after validating my id
To sumup:
If using API KEY as env var, check if your OPEN_API_KEY, It should be added using double quotes
If you had used browser authentication, Be sure that your KEY is not setup cause that can cause conflicts
Verify your Id, and wait around 20-30min.
In my case I was playing with other models while waiting, So I can’t know what is the minimum time, that would depend of several of other aspects though