Oh My Pi
Oh My Pi is a terminal AI coding agent. Custom model providers are added through a models.yml config file, with full support for reasoning effort, tool calling, and context management.
- GitHub: https://github.com/can1357/oh-my-pi
- Install guide: https://github.com/can1357/oh-my-pi#installation
📦 Prerequisites
What you'll need
- Oh My Pi installed (the
ompcommand is on your PATH) - An AutoRouter endpoint (use
https://api.autorouter.top/v1as usual) - An AutoRouter API key (generated in the console)
- A model ID exactly matching one exposed by your AutoRouter console (e.g.
claude-sonnet-4-6,gemini-2.5-flash)
🔑 Step 1: Set the API key environment variable
export EASYROUTER_API_KEY=your-autorouter-api-key🔧 Step 2: Create the config file
Create ~/.omp/agent/models.yml and add AutoRouter as a provider:
providers:
autorouter:
baseUrl: https://api.autorouter.top/v1
api: openai-completions
apiKey: AUTOROUTER_API_KEY
authHeader: true
models:
- id: claude-sonnet-4-6
name: Claude Sonnet 4.6
reasoning: true
thinking:
minLevel: high
maxLevel: xhigh
mode: effort
input: [text]
contextWindow: 200000
maxTokens: 128000
compat:
supportsDeveloperRole: false
supportsReasoningEffort: true
maxTokensField: max_tokens
reasoningEffortMap:
high: high
xhigh: max
supportsToolChoice: false
requiresReasoningContentForToolCalls: true
requiresAssistantContentForToolCalls: true
extraBody:
thinking:
type: enabled
- id: gemini-2.5-flash
name: Gemini 2.5 Flash
reasoning: false
input: [text]
contextWindow: 1000000
maxTokens: 65536
compat:
supportsDeveloperRole: false
maxTokensField: max_tokensKey configuration fields
| Field | Purpose |
|---|---|
baseUrl | AutoRouter endpoint (keep the /v1 suffix — Oh My Pi handles path joining) |
authHeader: true | Send Authorization: Bearer $AUTOROUTER_API_KEY |
supportsDeveloperRole: false | Send system prompts with the system role |
maxTokensField: max_tokens | Use max_tokens as the output limit field |
supportsToolChoice: false | tool_choice param not accepted in thinking mode |
requiresReasoningContentForToolCalls: true | History messages in tool-call chats must preserve reasoning_content |
requiresAssistantContentForToolCalls: true | Ensure the content field of tool-call messages is not empty |
Important
The compat field in models.yml is a full replacement, not a merge with built-in defaults. You must set every field you care about — anything omitted falls back to implicit defaults.
✅ Step 3: Launch & verify
From your project directory:
cd /path/to/your-project
omp --model autorouter/claude-sonnet-4-6For faster, non-reasoning responses:
omp --model autorouter/gemini-2.5-flashPress Ctrl+L or type /model inside Oh My Pi to switch models at any time.
❓ Troubleshooting
| Issue | Fix |
|---|---|
| "Provider not found" on launch | Confirm ~/.omp/agent/models.yml exists and the YAML is valid |
| 401 Unauthorized | Make sure AUTOROUTER_API_KEY is exported in the current shell |
| Reasoning-model tool calls failing | Ensure requiresReasoningContentForToolCalls: true is set |
| Weird behaviour after switching models | Non-reasoning models: drop reasoning: true and the extraBody.thinking block |
DeepSeek Harness
DeepSeek Harness (dsh) is DeepSeek's open-source Agent runtime for building AI Agents with tool calling, multi-turn conversations, and plugins. The official dsh-llm-autorouter plugin routes Harness model calls through AutoRouter for intelligent routing, channel failover, billing, and observability. This guide explains how to connect DeepSeek Harness to AutoRouter.
OpenClaw
OpenClaw is an open-source, self-hosted personal AI assistant platform that connects messaging apps to AI agents running on your own hardware. Designed for developers and advanced users, it allows you to have an autonomous AI assistant without giving up control of your data.