Where does LangChain store a gpt-4o model id?
In the model argument of ChatOpenAI. The ChatOpenAI page documents that argument. On Azure, the same page says the string is the deployment name.
A LangChain gpt-4o deprecated failure usually means the model argument on ChatOpenAI is still an old id. Change that string to the official replacement in the table on this page. For GPT-6 function tools, the ChatOpenAI page says to set use_responses_api to True, or to use a feature that routes to the Responses API.
Last reviewed . Publisher: SunsetDiff.
The LangChain OpenAI integration page constructs the client as ChatOpenAI(model=...). Documented examples on that page include model="gpt-5.5", model="gpt-5.4-mini", and model="gpt-6-astra" together with use_responses_api=True.
The same page says to set the OPENAI_API_KEY environment variable. This page does not show a credential.
For Azure OpenAI, the page's v1 example passes model="gpt-5-mini" and the comment says that string is your Azure deployment name. The base URL is the Azure endpoint with /openai/v1/ appended. The OpenAI model version behind a deployment is set on Microsoft's working-with-models page, not in the LangChain constructor.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-5.5")
Sources: LangChain ChatOpenAI , Working with Azure OpenAI models , checked October 25, 2026.
Pinning means the model string is a specific id, not a name you hope the library will update. Replace the string with the id on the shutdown row. Do not invent a short name that the provider page does not list.
On Azure, changing the OpenAI model id in prose is not enough when the constructor holds a deployment name. Create or select a deployment for the replacement, then put that deployment name in model. The upgrade policy for the current deployment is on Microsoft's working-with-models page.
Fallback lists for LiteLLM and OpenRouter are on the swap guide. The ChatOpenAI page does not document a fallback list on this class.
Sources: LangChain ChatOpenAI , Working with Azure OpenAI models , checked October 25, 2026.
The ChatOpenAI page says ChatOpenAI routes to the Responses API when you use a feature that requires it, such as the built-in web search tool. You can also set use_responses_api to True. The gpt-6-astra examples on that page set that flag. The page also says async tools are only supported via the Responses API.
OpenAI's Using GPT-6 guide says GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires the Responses API. GPT-6 Sol and GPT-6 Luna can keep function tools on Chat Completions only when reasoning effort is none. If the replacement in the table is one of those ids, read the error pages before you send tools.
The request shape, the flat tool object, and the call_id result are on the Responses API guide. This page does not repeat that migration.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-6-astra", use_responses_api=True)
Sources: LangChain ChatOpenAI , 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.
In the model argument of ChatOpenAI. The ChatOpenAI page documents that argument. On Azure, the same page says the string is the deployment name.
The ChatOpenAI page does not document one. LiteLLM and OpenRouter fallbacks are on the swap 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.