Fix an OpenAI Agents SDK 404 at /responses.

Select the API family the endpoint actually implements, then check Responses-only features and tracing separately.

The OpenAI Agents SDK uses the Responses API by default. Setting OPENAI_BASE_URL changes the client endpoint, but does not select Chat Completions. If a compatible gateway implements only POST /v1/chat/completions, an agent run can send POST /v1/responses and get a 404.

Check the actual request path

Read the method and final URL from the error or a local HTTP capture before changing a key:

Observed URLNext check
…/v1/responsesIf the base URL is correct and the provider documents only Chat Completions, select that API in the Agents SDK.
…/v1/chat/completionsThe API family matches a Chat Completions route. Check the exact base prefix, model ID and account access.
Duplicated /v1 or endpoint segmentsSet the base URL to the documented API prefix; do not append an endpoint path that the SDK already adds.

A 404 alone does not prove an API-family mismatch. A wrong host, region, deployment path or API version can also return 404.

Select Chat Completions for a compatible endpoint

First set the provider’s documented base URL, key and exact model ID in the environment of the process that runs the agent:

Local environment variables
export OPENAI_BASE_URL="https://api.example.com/v1"
export OPENAI_API_KEY="YOUR_PROVIDER_KEY"
export MODEL_ID="MODEL_ID_FROM_PROVIDER"

For one global client configured from OPENAI_API_KEY and OPENAI_BASE_URL, set the API family explicitly:

OpenAI Agents SDK global Chat Completions setting
import os
from agents import Agent, Runner, set_default_openai_api

set_default_openai_api("chat_completions")
agent = Agent(name="Assistant", model=os.environ["MODEL_ID"])
result = await Runner.run(agent, "Reply with one short sentence.")
print(result.final_output)

Choose Chat Completions for one agent

Use an explicit client and OpenAIChatCompletionsModel when different agents need different endpoints. The SDK docs recommend disabling tracing when the configured provider does not supply an OpenAI tracing key.

OpenAI Agents SDK per-agent compatible endpoint
import asyncio
import os
from openai import AsyncOpenAI
from agents import Agent, OpenAIChatCompletionsModel, Runner, set_tracing_disabled

set_tracing_disabled(True)
client = AsyncOpenAI(
    base_url=os.environ["OPENAI_BASE_URL"],
    api_key=os.environ["OPENAI_API_KEY"],
)
model = OpenAIChatCompletionsModel(
    model=os.environ["MODEL_ID"], openai_client=client
)
agent = Agent(name="Assistant", model=model)

async def main():
    result = await Runner.run(agent, "Reply with one short sentence.")
    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

Fail fast on Responses-only features

When using the built-in OpenAI provider, OpenAIProvider(use_responses=False, strict_feature_validation=True) makes the API choice explicit and catches several Responses-only inputs instead of silently dropping them. With MultiProvider, the corresponding option is openai_strict_feature_validation=True.

Strict validation for the Chat Completions route
from agents import Agent, OpenAIProvider, RunConfig, Runner

provider = OpenAIProvider(
    use_responses=False,
    strict_feature_validation=True,
)
agent = Agent(name="Assistant", model="MODEL_ID_FROM_PROVIDER")
result = await Runner.run(agent, "Reply with one short sentence.",
    run_config=RunConfig(model_provider=provider))

Responses-only fields include previous_response_id, conversation_id, the Responses prompt field and non-text-only tool outputs. Built-in Responses tools such as hosted web or file search do not become available through Chat Completions. Standard function tools are a separate feature and still depend on the gateway and model.

Separate tracing errors from model API errors

If the model provider is non-OpenAI and the SDK reports a 401 while exporting traces, that request goes to the tracing service; it is separate from the model call. Disable tracing or configure an appropriate tracing processor. Do not put a third-party provider key into OpenAI tracing settings.

ChinaGenAI endpoint

ChinaGenAI documents POST /v1/chat/completions, not /v1/responses. Use the Chat Completions setting above and check the documented endpoint limits and feature compatibility before connecting an app.

Check the SDK documentation for your installed version

Official SDK documentation checked 1 November 2026. The examples are configuration guidance; no API key, provider account 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.