The benefit group will stop on September 30, 2026. Existing users should migrate before then. Read the migration notice

Agent integrations

Step-by-step setup for supported apps. Sign in to use your API key and available models, then verify a real request.

ChatGPT

ChatGPT desktop · Codex · Responses

Official docs · Codex configuration reference
Client

Supported

  • Streamed responses
  • Function calls
  • Local Codex tools including apply_patch
  • Usage and cost accounting

Limits and notes

  • The Responses endpoint is stateless: stored conversations, previous_response_id, and background mode are unsupported
  • Provider-hosted web search and file search are not supported
  • This affects new local tasks only; Codex cloud chats are unchanged
Base URL
https://router-api.xiu.ai/v1
Request path
/v1/responses
Models
Sign in to choose from models available to the selected key.

Before you start

  1. Update the desktop app first

    Open the ChatGPT desktop app and install the latest update. Older builds may not expose the custom provider configuration.

Replace YOUR_XIUROUTER_API_KEY with your API key and YOUR_MODEL_ID with an exact model ID. Sign in to fill these values automatically; copied steps include the selected key.

  1. 1. Save the key for ChatGPT

    Replace YOUR_XIUROUTER_API_KEY with your key. In the console, copying injects the selected key for you.

    Terminal (writes the user environment)
    launchctl setenv XIUROUTER_API_KEY "YOUR_XIUROUTER_API_KEY"

    An app launched from the Dock cannot read a plain terminal export, so this writes a user-level variable. Quit ChatGPT completely and reopen it afterwards.

  2. 2. Add the XiuRouter provider

    In the desktop app, open Settings → Configuration → Open config.toml. Append the block below to the end of the file and keep every existing provider.

    ~/.codex/config.toml
    model = "YOUR_MODEL_ID"
    model_provider = "xiurouter"
    
    [model_providers.xiurouter]
    name = "XiuRouter"
    base_url = "https://router-api.xiu.ai/v1"
    env_key = "XIUROUTER_API_KEY"
    wire_api = "responses"

    This only adds; it removes nothing that is already there.

  3. 3. Reopen and create a new task

    Quit ChatGPT completely (not just the window), reopen it, and create a new local task in Codex. Tasks already open keep their original provider.

  4. 4. Create a new task and test

    Send a read-only instruction in the new task, such as “Tell me which framework this project uses without changing files.”

Confirm the connection

Codex answers normally and the console’s verification panel shows a succeeded record on /v1/responses with the model you selected.

Troubleshooting

5

Continue in the console

The console fills in your API key and available models, then checks for a matching request.