OpenAI Agents SDK on Mingles Router

Run OpenAI Agents SDK on Mingles Router

The SDK defaults to the Responses API and to sending traces to OpenAI. Neither is what you want against a third-party endpoint, and both are one line.

Pick your model and paste your key — every command and value on this page updates live.

Endpoint: https://router.mingles.ai/v1 · key stays in your browser · no key entered? commands show <your-key>.

Wire it up

1. Point a client at the endpoint

Build the model explicitly so the SDK uses chat completions rather than its default:

python
from agents import (
    Agent, AsyncOpenAI, OpenAIChatCompletionsModel,
    Runner, set_tracing_disabled,
)

set_tracing_disabled(disabled=True)

client = AsyncOpenAI(
    base_url="https://router.mingles.ai/v1",
    api_key="<your-key>",
)
model = OpenAIChatCompletionsModel(model="deepseek-ai/DeepSeek-V4-Flash-0731", openai_client=client)

agent = Agent(name="Assistant", instructions="Be concise.", model=model)
print(Runner.run_sync(agent, "Hello").final_output)

set_tracing_disabled is not optional unless you also hold a platform.openai.com key — tracing uploads to OpenAI and will fail without one.

2. Or switch the default API globally

If you would rather not build the model object on every agent:

python
from agents import set_default_openai_client, set_default_openai_api

set_default_openai_client(client)
set_default_openai_api("chat_completions")

The SDK defaults to the Responses API, which most providers — including us — do not implement. Without this line you get errors that look like auth failures but are not.

Exact values

base_url https://router.mingles.ai/v1
api_key <your-key>
model deepseek-ai/DeepSeek-V4-Flash-0731

Switch model

Handoffs, guardrails and function tools all ride on chat completions once the default API is switched.

Before you file a bug: read the limits

Reasoning models spend the output budget on internal thinking, output is capped at 8192 tokens, there is no KV cache, and there are no built-in web tools. Most “it broke on Mingles Router” reports are one of these. See Model limits & behavior →

Frequently asked

I get an error that looks like a 404 or an unsupported endpoint. +

Almost always the Responses API default. Either construct OpenAIChatCompletionsModel explicitly or call set_default_openai_api("chat_completions").

Do I need an OpenAI account at all? +

Not for inference. You do for tracing — which is why the snippet disables it.