Connect Pi Coding Agent to the gateway
Start a DeepSeek Flash session, read a project file, then switch to another gateway model. Follow the numbered steps below with your delivered Multi-Model Gateway key and address.
Configure once · switch models inside the Agent
Includes models.json for model capabilities and settings.json for per-model defaults. Save both in the same Pi configuration directory.
Individual files remain available in the numbered steps below.
Before you begin
- Have your activated gateway key and its confirmed endpoint ready.
- Choose a local project with a README.md for the first conversation.
- Run shell commands in Terminal on macOS / Linux, or inside WSL on Windows. Paste prompts and slash commands inside the Agent.
Use the gateway credentials and model IDs in this guide. A direct DeepSeek Platform key, endpoint or setup script configures a different service.
1. Install and check your version
Install the Agent using its official guide below. Terminal examples use macOS / Linux or Windows WSL. If already installed, check your version and continue.
Run in Terminal ·Terminal
npm install -g @earendil-works/pi-coding-agent
pi --version2. Save your key
Add this export to your shell startup file: ~/.zshrc for Zsh, or ~/.bashrc for Bash. Replace the placeholder locally, save, then open a new terminal.
Use that terminal to launch the Agent. On Windows, follow these terminal steps inside WSL.
Save in your shell startup file ·Shell startup file · Bash / Zsh
export MULTI_MODEL_API_KEY="REPLACE_WITH_YOUR_DELIVERED_GATEWAY_KEY"3. Configure the gateway and models
If the file already exists, merge these fields and keep your other settings. Add to existing JSON objects or YAML sections; do not paste a second top-level object.
This configuration includes the complete model list. DeepSeek Flash is the starting model; choose a different one inside the Agent later.
Keep PI_CODING_AGENT_DIR in the launch command: it tells Pi which models.json to read.
Save both models.json and settings.json in that same directory. models.json declares all eight models and their supported controls; settings.json sets their starting thinking levels. Merge the modelThinkingLevels entries if settings.json already exists, preserving your other preferences.
Null entries in thinkingLevelMap disable unsupported choices; they are not null request values. Keep these mappings. A saved session can override the starting level, so inspect /thinking after switching or resuming.
Terminal · open the gateway model file
mkdir -p "$HOME/.config/multi-model-gateway/pi"
nano "$HOME/.config/multi-model-gateway/pi/models.json"Configuration ·~/.config/multi-model-gateway/pi/models.json
Save as ~/.config/multi-model-gateway/pi/models.json and also save settings.json below. If it exists, merge the provider. Keep the environment-variable key reference and use the PI_CODING_AGENT_DIR launch command below.
{
"providers": {
"multi-model-gateway": {
"baseUrl": "https://multi-api.deepseekv4pro.com/v1",
"api": "openai-completions",
"apiKey": "$MULTI_MODEL_API_KEY",
"models": [
{
"id": "deepseek-flash",
"name": "DeepSeek Flash",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": "none",
"minimal": null,
"low": "low",
"medium": null,
"high": "high",
"xhigh": null,
"max": "max"
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "glm-5.3-flash",
"name": "GLM-5.3-Flash",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": null,
"minimal": null,
"low": "low",
"medium": null,
"high": "high",
"xhigh": null,
"max": "max"
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "mimo-flash",
"name": "MiMo V2.6 Flash",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": "none",
"minimal": null,
"low": null,
"medium": null,
"high": "high",
"xhigh": null,
"max": null
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "mimo-pro",
"name": "MiMo V2.6 Pro",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": "none",
"minimal": null,
"low": null,
"medium": null,
"high": "high",
"xhigh": null,
"max": null
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "glm-5.3",
"name": "GLM-5.3",
"input": [
"text"
],
"reasoning": true,
"thinkingLevelMap": {
"off": null,
"minimal": null,
"low": "low",
"medium": null,
"high": "high",
"xhigh": null,
"max": "max"
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "kimi-k3",
"name": "Kimi-K3",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": null,
"minimal": null,
"low": "low",
"medium": null,
"high": "high",
"xhigh": null,
"max": "max"
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "qwen3.8-max",
"name": "Qwen3.8 Max",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": "none",
"minimal": null,
"low": "low",
"medium": "medium",
"high": null,
"xhigh": "xhigh",
"max": null
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
},
{
"id": "minimax-m3",
"name": "MiniMax M3",
"input": [
"text",
"image"
],
"reasoning": true,
"thinkingLevelMap": {
"off": "none",
"minimal": null,
"low": null,
"medium": null,
"high": "high",
"xhigh": null,
"max": null
},
"compat": {
"supportsReasoningEffort": true,
"supportsDeveloperRole": false
}
}
]
}
}
}Configuration ·~/.config/multi-model-gateway/pi/settings.json · per-model defaults
Save beside models.json in ~/.config/multi-model-gateway/pi. Merge the modelThinkingLevels map into existing settings, preserving other preferences. Use the same PI_CODING_AGENT_DIR for both files.
{
"defaultProvider": "multi-model-gateway",
"defaultModel": "deepseek-flash",
"modelThinkingLevels": {
"multi-model-gateway/deepseek-flash": "high",
"multi-model-gateway/glm-5.3-flash": "max",
"multi-model-gateway/mimo-flash": "high",
"multi-model-gateway/mimo-pro": "high",
"multi-model-gateway/glm-5.3": "max",
"multi-model-gateway/kimi-k3": "max",
"multi-model-gateway/qwen3.8-max": "xhigh",
"multi-model-gateway/minimax-m3": "high"
}
}
4. Start the Agent
Open a terminal in a project you trust. Start a new session with the command below.
Run in Terminal ·Terminal
PI_CODING_AGENT_DIR="$HOME/.config/multi-model-gateway/pi" pi --provider multi-model-gateway --model deepseek-flash5. Choose reasoning effort
Start on DeepSeek Flash. Choose Low, send a short file-reading task, then choose High and repeat. Check the current setting after each change. A longer answer by itself does not prove the effort changed.
Effort means how much reasoning to request. Kimi K3, GLM 5.3 and GLM 5.3 Flash offer Low / High / Max with thinking always enabled. Choose Low for shorter reasoning; there is no Off option. Their model default is Max, but a client setting can override it. DeepSeek and Qwen have their own intensity levels listed below.
MiMo has an On / Off switch; High is the client's label for On. MiniMax M3 supports Off / Auto / On through thinking.type (disabled / adaptive / enabled). Its effort-only menus expose Off and High (On); Auto needs a native thinking control. These modes are not separate Low / High / Max intensities. Follow this Agent's default and switching instructions below; a supported control does not set a session's starting value.
Save both supplied files. settings.json uses modelThinkingLevels to set High for DeepSeek, Max for Kimi and GLM, XHigh for Qwen, and High (On) for MiMo and MiniMax. models.json declares which choices are available; it does not set these defaults.
Open /thinking and choose Low or High, or use Shift+Tab to cycle supported levels. The footer shows the active level. This changes the session; Ctrl+S saves the global fallback. Per-model defaults take precedence over that fallback: edit modelThinkingLevels or use /settings → Default thinking level per model to change them. Ctrl+T only shows or hides reasoning text.
- DeepSeek Flash
- Off / Low / High / Max
- Starting setting: high
- Start with Low; choose High or Max for more reasoning, or Off to disable thinking. Medium and XHigh requests map to High; Ultra maps to Max.
- GLM-5.3-Flash
- Low / High / Max
- Starting setting: max
- Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort.
- MiMo V2.6 Flash
- Off / On
- Starting setting: On (High)
- Choose On to enable thinking or Off to disable it. In clients that label On as High, choose High. There are no separate Low, Medium or High intensities.
- MiMo V2.6 Pro
- Off / On
- Starting setting: On (High)
- Choose On to enable thinking or Off to disable it. In clients that label On as High, choose High. There are no separate Low, Medium or High intensities.
- GLM-5.3
- Low / High / Max
- Starting setting: max
- Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort.
- Kimi-K3
- Low / High / Max
- Starting setting: max
- Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort.
- Qwen3.8 Max
- Off / Low / Medium / XHigh
- Starting setting: xhigh
- Start with Low; choose Medium or XHigh for more reasoning, or Off to disable thinking. High, Max and Ultra requests all map to XHigh.
- MiniMax M3
- Off / On
- Starting setting: On (High)
- High means On. Auto needs the native thinking.type=adaptive control; this setup's effort selector does not expose Auto. Check the current selection before sending.
| Model | What can I change? | Starting setting | What should I do? |
|---|---|---|---|
| DeepSeek Flash | Off / Low / High / Max | high | Start with Low; choose High or Max for more reasoning, or Off to disable thinking. Medium and XHigh requests map to High; Ultra maps to Max. |
| GLM-5.3-Flash | Low / High / Max | max | Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort. |
| MiMo V2.6 Flash | Off / On | On (High) | Choose On to enable thinking or Off to disable it. In clients that label On as High, choose High. There are no separate Low, Medium or High intensities. |
| MiMo V2.6 Pro | Off / On | On (High) | Choose On to enable thinking or Off to disable it. In clients that label On as High, choose High. There are no separate Low, Medium or High intensities. |
| GLM-5.3 | Low / High / Max | max | Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort. |
| Kimi-K3 | Low / High / Max | max | Choose Low for shorter reasoning, High for more reasoning, or Max for the largest budget. Thinking is always enabled; there is no Off option. The model default is Max unless the client sends a different effort. |
| Qwen3.8 Max | Off / Low / Medium / XHigh | xhigh | Start with Low; choose Medium or XHigh for more reasoning, or Off to disable thinking. High, Max and Ultra requests all map to XHigh. |
| MiniMax M3 | Off / On | On (High) | High means On. Auto needs the native thinking.type=adaptive control; this setup's effort selector does not expose Auto. Check the current selection before sending. |
Enter in the Agent ·Inside the Agent · send each command separately
/model
/thinkingIf the selector is missing, confirm that Pi loaded the supplied models.json from the same PI_CODING_AGENT_DIR. Supported models need reasoning: true and the complete thinkingLevelMap. Null entries remove unsupported levels; do not delete them. Open /model to reload the file, then inspect /thinking again.
6. Choose a model and start working
Type /model inside Pi. Search for Multi-Model Gateway or a model ID, then select it. The picker reloads models.json when opened.
Open a project with a README.md and send the file-reading prompt below. Approve access to the file if prompted. You can switch models later without changing the key or gateway address.
Enter in the Agent ·Read a project file
Use the file-reading tool to read README.md in the selected project and summarize its purpose in one sentence. Do not modify any files.Switch models in Pi Coding Agent
Use one command or picker entry at a time. An arrow means choose the entry in the picker; it is not part of a command. Your key must have access to the model you choose.
- DeepSeek Flash
/model → deepseek-flash - GLM-5.3-Flash
/model → glm-5.3-flash - MiMo V2.6 Flash
/model → mimo-flash - MiMo V2.6 Pro
/model → mimo-pro - GLM-5.3
/model → glm-5.3 - Kimi-K3
/model → kimi-k3 - Qwen3.8 Max
/model → qwen3.8-max - MiniMax M3
/model → minimax-m3
Connection reference
Keep these values consistent with the configuration above.
| Parameter | Value and purpose |
|---|---|
| Base URL | https://multi-api.deepseekv4pro.com/v1Keep the /v1 suffix in the provider base URL. |
| API protocol | OpenAI Chat Completions |
| API key | Use your delivered gateway key in the location shown in the setup steps. Replace credential placeholders locally. |
| Starting model | deepseek-flash |
Optional: check the API connection
Agent protocol: OpenAI Chat Completions. This Bash command uses the same API protocol with DeepSeek Flash. First export MULTI_MODEL_API_KEY in your terminal even if you saved the key in a settings file. The response should contain a short reply from DeepSeek Flash.
curl --fail-with-body "https://multi-api.deepseekv4pro.com/v1/chat/completions" \
-H "Authorization: Bearer $MULTI_MODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-flash","messages":[{"role":"user","content":"Reply with a short hello."}],"max_tokens":256}'Troubleshooting
- Models are missing
- Check the active config path, restart the Agent and look for project overrides. In Codex, check model_catalog_json; in OpenClaw, check model allowlists. Older Claude Code versions can use /model with an exact ID.
- 401 / 404
- 401: confirm the key is available to the running process. 404: check the model ID and base URL. Claude Code uses the root host; the other Agents here use /v1.
- 429 / unavailable endpoint
- Read the error for quota or provider capacity. Changing models does not refill points. Before activation, use only the confirmed endpoint supplied with your key.