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 URL | Next check |
|---|---|
…/v1/responses | If the base URL is correct and the provider documents only Chat Completions, select that API in the Agents SDK. |
…/v1/chat/completions | The API family matches a Chat Completions route. Check the exact base prefix, model ID and account access. |
Duplicated /v1 or endpoint segments | Set 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:
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:
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.
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.
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
- OpenAI Agents SDK models: Responses default, Chat Completions options and limitations
- OpenAI Agents SDK configuration: custom client and API selection
- OpenAIProvider reference: use_responses and strict_feature_validation
- OpenAI API: compare Responses and Chat Completions paths and payloads
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.
Reported text:
OpenAI Agents SDK 404 POST /v1/responses with an OpenAI-compatible endpoint that supports only Chat CompletionsThe official SDK documentation identifies the Responses default and documents set_default_openai_api("chat_completions") or OpenAIChatCompletionsModel as alternatives. A 404 can still come from a wrong host, deployment path or API version; inspect the actual request before changing credentials.
Jump to: Select Chat Completions for the API your endpoint supports
The SDK uses the Responses API by default, but many other LLM providers still do not support it. You may see 404s or similar issues as a result.
OpenAI Agents SDK models and configuration documentation, checked 1 November 2026