Skip to main content
Use the OpenAI Agents SDK against the Modellix LLM gateway. The SDK accepts a custom OpenAI client (base_url + API key), so you can run agents on Chat Completions at POST /v1/chat/completions β€” the same gateway shape as the OpenAI SDK.
This page covers LLM text only (https://llm.modellix.ai).Modellix model IDs are provider/name (for example openai/gpt-5.5). Pass that full string to the model layer. Prefer OpenAIChatCompletionsModel (or MultiProvider with openai_prefix_mode="model_id") so the SDK does not strip the openai/ prefix before calling Modellix. See Models & Pricing.

Set Up the Agents SDK

1

Install the SDK

Python:
TypeScript:
2

Set Credentials

Create a Modellix API key in the console:
OpenAI Tracing exports to OpenAI’s platform. A Modellix key cannot upload traces. Disable tracing, or keep model traffic on Modellix and set a separate OpenAI tracing key.
3

Create a Client and Agent (Recommended)

Build an AsyncOpenAI / OpenAI client pointed at Modellix, wrap it in OpenAIChatCompletionsModel with a literal Modellix Model ID, and disable tracing unless you have a separate OpenAI tracing key.
Change the model string to any catalog ID (anthropic/claude-sonnet-5, google/gemini-3.6-flash, and so on). Traffic still uses Chat Completions on https://llm.modellix.ai/v1.
4

Optional: Global Default Client

To make Modellix the process-wide default without wrapping every agent:
Then assign models carefully. String IDs like openai/gpt-5.5 can be rewritten by the default OpenAI provider (it may drop the openai/ prefix). Prefer OpenAIChatCompletionsModel with the full Modellix ID, or a MultiProvider with openai_prefix_mode="model_id" (Python) so the gateway receives openai/gpt-5.5 unchanged. See Agents SDK models.
5

Optional: Responses API

Modellix also exposes POST /v1/responses. The SDK defaults to Responses for OpenAI-hosted traffic. On a compatible gateway, start with Chat Completions (set_default_openai_api("chat_completions") / setOpenAIAPI("chat_completions")) unless you have verified Responses + tools for your agent loop.Keep base_url as https://llm.modellix.ai/v1 for both shapes. Do not use the Anthropic host without /v1 here β€” that path is for the Anthropic SDK and Claude Code.

Troubleshooting