LangChain 404 at /responses.

Trace the ChatOpenAI request path, force Chat Completions for a compatible endpoint, and check the LangChain version-specific routing behavior.

If LangChain returns a 404 at POST /v1/responses, inspect the URL before rotating keys. A Chat Completions-only server will not recognize that separate endpoint. A custom base_url sets the host and API prefix; it does not guarantee which API path ChatOpenAI selects.

Read the request URL first

  • POST …/v1/responses

    If the provider only documents Chat Completions, explicitly select that API with use_responses_api=False. Remove Responses-only settings and features.

  • POST …/v1/chat/completions

    The API family matches a Chat Completions endpoint. Check the exact base URL prefix, model ID and key access.

  • A duplicated /v1 or endpoint path

    Set base_url to the documented API prefix. Do not include /chat/completions when the client appends it.

Some 404 responses come from a wrong host, deployment path or API version. Confirm the outgoing method and full URL rather than inferring the cause from “Not Found” alone.

Choose Chat Completions explicitly

For a server that supports Chat Completions but not Responses, use LangChain's ChatOpenAI wrapper and set use_responses_api=False. Put the endpoint prefix, exact model ID and key in environment variables on the machine running your app:

LangChain Chat Completions setup
import os
from langchain_openai import ChatOpenAI

chat = ChatOpenAI(
    model=os.environ["MODEL_ID"],
    base_url=os.environ["MODEL_API_BASE_URL"],
    api_key=os.environ["MODEL_API_KEY"],
    use_responses_api=False,
)
answer = chat.invoke("Reply with one short sentence.")
print(answer.content)

The option is available in langchain-openai 0.3.9 and later. If your installed version rejects it, check the package version and its matching API reference before changing the endpoint.

Why a custom URL may still reach /responses

LangChain documents that ChatOpenAI can route to Responses when Responses-specific features are used. A public reproduction against langchain-openai 1.4.1 also showed a model-name heuristic selecting /v1/responses on a custom Chat Completions-only server; setting use_responses_api=False sent that request to /v1/chat/completions. This is a version-bounded issue report, not evidence that every model name or current package version behaves the same way.

If you explicitly use output_version="responses/v1", built-in Responses tools or other Responses-only inputs, do not force the Chat API and expect those features to work. Choose an endpoint that implements the feature you need, or remove it for a Chat Completions request. Standard Chat Completions function tools are a separate API feature from OpenAI's built-in Responses tools.

Use the chat wrapper for a chat endpoint

ChatOpenAI is the LangChain chat-model wrapper. OpenAI documents the legacy text-completion interface; an OpenAI-compatible Chat Completions route expects chat messages and the /chat/completions path. For provider-specific response fields or features, LangChain advises using that provider's integration.

ChinaGenAI documents POST /v1/chat/completions; it does not document /v1/responses. Check current site-key availability and limits, then use the documented connection settings if they fit your task. This guide does not supply a key or test a live request.

Check current documentation and version

Documentation and issue reports checked 23 October 2026. This guide compares documented configuration and public reproductions; no provider account, API key or model request was used.

Free API access and limits

Check the site free API access and limits before trying to obtain a site key. Read the current status and request limits before using a site key. It is not a source of official provider keys.

ChinaGenAI is not affiliated with the providers named here. This release contains setup guidance and explicitly labeled fictional examples, not claimed live model benchmarks.

Exact symptom wording and source

Use the quoted text to locate the relevant check. Providers and clients can phrase the same failure differently; compare the complete response before applying a fix.

  • Reported text: 404 at /v1/responses with LangChain ChatOpenAI and a custom base_url

    One version-specific reproduction, not evidence of frequency or current behavior across all model IDs.

    ChatOpenAI sends the request to POST /v1/responses, which the server does not implement ... Pass use_responses_api=False explicitly

    LangChain issue #39320 reproduction (langchain-openai 1.4.1)