What is the LlamaIndex argument for an OpenAI model id?
model, on llama_index.llms.openai.OpenAI. The using LLMs page shows OpenAI(model="gpt-4o-mini"). The global default is Settings.llm.
LlamaIndex puts the OpenAI model id in OpenAI(model=...). Settings.llm is the global default when a call does not pass its own LLM. The OpenAI integration page does not document a Responses API switch. If you swap in a GPT-6 id that needs Responses for function tools, read the error pages before you send tools.
Last reviewed . Publisher: SunsetDiff.
The using-LLMs page says you specify a model by passing model to the LLM constructor. Its example is OpenAI(model="gpt-4o-mini").
The OpenAI integration page repeats that call, including OpenAI(model="gpt-4o") and OpenAI(model="gpt-4o-mini"). It says the constructor uses the OPENAI_API_KEY environment variable by default. This page does not show a key.
The API reference says the model parameter is the name of the OpenAI model to use, and that its default is DEFAULT_OPENAI_MODEL. The customizing-LLMs page says the default LLM is OpenAI's gpt-3.5-turbo. This page does not claim those two defaults are the same string.
The Settings page says Settings.llm is the global LLM when a component does not receive one. The customizing page shows Settings.llm = OpenAI(...) and a local override, query_engine = index.as_query_engine(llm=llm).
from llama_index.llms.openai import OpenAI
llm = OpenAI(model="gpt-4o-mini")
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
Settings.llm = OpenAI(model="gpt-4o-mini")
Sources: LlamaIndex using LLMs , LlamaIndex OpenAI integration , LlamaIndex OpenAI API reference , LlamaIndex customizing LLMs , LlamaIndex Settings , checked October 25, 2026.
Change the model string to the official replacement on the shutdown row. If Settings.llm is set, change that assignment too, or a path that omits llm= will keep the old global id.
The OpenAI integration page does not document a router alias or a fallback list. A second model is a second OpenAI(model=...) call in your code.
Sources: LlamaIndex OpenAI integration , LlamaIndex Settings , checked October 25, 2026.
The LlamaIndex OpenAI integration page does not document a Responses API switch. Do not add a flag this page did not find there.
OpenAI's Using GPT-6 guide says GPT-6 Astra and GPT-6.1 Sol tool calling requires the Responses API, and that GPT-6 Sol and GPT-6 Luna accept function tools on Chat Completions only with reasoning effort none. If the replacement id is one of those models, read the error pages and the Responses API guide before you send tools.
Sources: LlamaIndex OpenAI integration , Using GPT-6 , checked October 25, 2026.
gpt-4.1-2025-04-14, gpt-4.1-mini-2025-04-14, gpt-4o-2024-08-06, gpt-4o-2024-11-20, and gpt-4o-mini-2024-07-18 shut down on 2027-01-14. The official replacement on these rows is gpt-6-luna.
gpt-4.1, gpt-4.1-mini, gpt-4o, and gpt-4o-mini have no shutdown date on their own records. A request that sends the short id is not the dated snapshot row. Open the model page before you treat the short id as shut down.
Rows are upcoming OpenAI chat models in the gpt-4o, gpt-4.1, gpt-4-turbo, gpt-4, and gpt-3.5-turbo families. Audio, realtime, transcribe, and search ids are not in this table. The same id on another platform is in the other-platforms column. The full calendar is upcoming shutdowns. Provider wording for the shutdown day is on what happens on shutdown day.
| Shutdown | Provider | Model | Replacement | Other platforms |
|---|---|---|---|---|
| 2027-01-14 source, checked 2026-10-26 | OpenAI | GPT-4.1 (gpt-4.1-2025-04-14) gpt-4.1-2025-04-14 | gpt-6-luna Switch guide: gpt-6-luna | Azure OpenAI: shuts down on 2027-10-14 |
| 2027-01-14 source, checked 2026-10-26 | OpenAI | GPT-4.1 mini (gpt-4.1-mini-2025-04-14) gpt-4.1-mini-2025-04-14 | gpt-6-luna Switch guide: gpt-6-luna | Azure OpenAI: shuts down on 2027-10-14 |
| 2027-01-14 source, checked 2026-10-26 | OpenAI | GPT-4o (gpt-4o-2024-08-06) gpt-4o-2024-08-06 | gpt-6-luna Switch guide: gpt-6-luna | Azure OpenAI: shuts down on 2027-10-01 |
| 2027-01-14 source, checked 2026-10-26 | OpenAI | GPT-4o (gpt-4o-2024-11-20) gpt-4o-2024-11-20 | gpt-6-luna Switch guide: gpt-6-luna | Azure OpenAI: shuts down on 2027-04-14 |
| 2027-01-14 source, checked 2026-10-26 | OpenAI | GPT-4o mini (gpt-4o-mini-2024-07-18) gpt-4o-mini-2024-07-18 | gpt-6-luna Switch guide: gpt-6-luna | Azure OpenAI: shuts down on 2027-10-01 |
These checks read SunsetDiff. They do not call the model provider.
model, on llama_index.llms.openai.OpenAI. The using LLMs page shows OpenAI(model="gpt-4o-mini"). The global default is Settings.llm.
Not on the OpenAI integration page checked for this article. The OpenAI rule for GPT-6 tool calls is on the function tools error page and the Responses API guide.
From SunsetDiff model records for upcoming OpenAI chat ids in the gpt-4o, gpt-4.1, gpt-4-turbo, gpt-4, and gpt-3.5-turbo families. The sentence above the table is built from those records when the site is built. Each row links the provider source stored on that record.
Open lookup JSON and replace gpt-4o with your id. Or call check_model on the MCP server. Or use a status badge. No API key.