OhMyProxy · OpenCode Setup
Add OhMyProxy as a provider in your ~/.config/opencode/opencode.jsonc.
Provider Configuration
{
"provider": {
"OhMyProxyV2": {
"options": {
"baseURL": "http://127.0.0.1:5555/v1",
"apiKey": "none"
},
"models": {
"kilo-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"zen-noapi-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"zen-api-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"pekpik-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"mistral-api-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"zai-api-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
},
"auto-free": {
"reasoning": true, "tool_call": true,
"interleaved": { "field": "reasoning_content" },
"cost": { "input": 10, "output": 10 },
"limit": { "context": 200000, "output": 100000 }
}
}
}
}
}
Proxy Names (model key)
| Model Key | Routes To |
kilo-free | Kilo Gateway models |
zen-noapi-free | OpenCode Zen (no auth, free models) |
zen-api-free | OpenCode Zen (API keys, all models) |
pekpik-free | Pekpik community keys |
mistral-api-free | Mistral AI (codestral, devstral) |
zai-api-free | Z.ai (GLM-4.5/4.7 Flash) |
auto-free | Round-robin across all enabled proxies |
All proxy names are pre-configured above — pick any model key and use it directly.
Cost Configuration
OpenCode's cost.input / cost.output are $ per 1M tokens. Our proxy rate is $1/100k tokens, so use 10.
| Desired Rate | cost value |
| $1 / 100k tokens (ours) | 10 |
| $1 / 1M tokens | 1 |
| $0.50 / 1M tokens | 0.5 |
API Authentication
If proxy keys are enabled, add apiKey to your provider config:
"options": {
"baseURL": "http://127.0.0.1:5555/v1",
"apiKey": "omp_<your-key>"
}
Generate keys from Settings → Proxy API Keys in the WebUI. When no keys exist, endpoints are open.
Load Balancing
For zen-api-free, set strategy in Settings → Server Configuration:
- Random — picks a key at random
- Round-Robin — cycles through keys
- Least-Used — fewest logged requests
Agent Variants (oh-my-opencode-slim)
{
"presets": {
"omniroute": {
"orchestrator": { "model": "OhMyProxyV2/auto-free", "variant": "high" },
"librarian": { "model": "OhMyProxyV2/auto-free", "variant": "low" }
}
}
}
Prerequisites
- OhMyProxy running:
python app.py
- Server at
http://localhost:5555
- OpenCode v1.2+ with custom provider support
- If using
zen-api-free, add API keys via WebUI → Settings