pi-opencode-go-provider
v1.0.7
Published
Opencode Go provider extension for pi - Fast, efficient GLM, Kimi, and MiniMax models through the opencode.ai API
Maintainers
Readme
🟢 pi-opencode-go-provider
Fast GLM, Kimi & MiniMax via opencode-go
Go-optimized endpoints for lower latency — 14+ models for pi.
Features
- 14+ Optimized AI Models - DeepSeek, GLM, Kimi, MiMo, MiniMax, and Qwen
- Multi-API Support — uses the correct API protocol per model (Anthropic, OpenAI Completions)
- Fast & Efficient - Go-optimized endpoints for lower latency
- Cost Tracking with per-model pricing for budget management
- Reasoning Models with thinking level maps for proper effort control
Installation
Option 1: Using pi install (Recommended)
Install directly from GitHub:
pi install https://github.com/monotykamary/pi-opencode-go-providerThen set your API key and run pi:
# Recommended: add to auth.json
# See Authentication section below
# Or set as environment variable
export OPENCODE_API_KEY=your-api-key-here
piOption 2: Manual Clone
Clone this repository:
git clone https://github.com/monotykamary/pi-opencode-go-provider.git cd pi-opencode-go-providerSet your opencode API key:
# Recommended: add to auth.json # See Authentication section below # Or set as environment variable export OPENCODE_API_KEY=your-api-key-hereRun pi with the extension:
pi -e /path/to/pi-opencode-go-provider
Available Models
| Model | API | Type | Context | Max Tokens | Input Cost | Output Cost | |-------|-----|------|---------|------------|------------|-------------| | DeepSeek V4 Flash | Completions | Text | 1.0M | 384K | $0.14 | $0.28 | | DeepSeek V4 Pro | Completions | Text | 1.0M | 384K | $0.43 | $0.87 | | GLM-5.1 | Completions | Text | 203K | 33K | $1.40 | $4.40 | | GLM-5.2 | Completions | Text | 1.0M | 131K | $1.40 | $4.40 | | GPT-5.6 Luna (2x usage) | Completions | Text + Image | 1.1M | 128K | $0.10 | $0.60 | | Grok 4.5 | Responses | Text + Image | 500K | 500K | $2.00 | $6.00 | | Hy3 | Completions | Text | 256K | 64K | $0.14 | $0.58 | | Kimi K2.6 | Completions | Text + Image | 262K | 66K | $0.95 | $4.00 | | Kimi K2.7 Code | Completions | Text + Image | 262K | 262K | $0.95 | $4.00 | | Kimi K3 (2x usage) | Completions | Text + Image | 1.0M | 131K | $3.00 | $15.00 | | MiMo V2.5 | Completions | Text + Image | 1.0M | 128K | $0.14 | $0.28 | | MiMo V2.5 Pro | Completions | Text | 1.0M | 128K | $0.43 | $0.87 | | MiniMax-M2.7 | Completions | Text | 205K | 131K | $0.30 | $1.20 | | MiniMax-M3 | Anthropic | Text + Image | 1.0M | 131K | $0.30 | $1.20 | | Qwen3.6 Plus | Completions | Text + Image | 1.0M | 66K | $0.50 | $3.00 | | Qwen3.7 Max | Anthropic | Text | 1.0M | 66K | $2.50 | $7.50 | | Qwen3.7 Plus | Anthropic | Text + Image | 1.0M | 66K | $0.40 | $1.60 | Costs are per million tokens. Prices subject to change - check opencode.ai for current pricing.
Usage
After loading the extension, use the /model command in pi to select your preferred model:
/modelThen select "opencode-go" as the provider and choose from the available models.
The default model for this provider is kimi-k2.6 (matching pi core's built-in default); use /model to pick another.
Authentication
The opencode-go API key can be configured in multiple ways. Credentials are resolved in this order:
- CLI flag —
--api-key(highest priority, runtime override) auth.json(recommended) — Add to~/.pi/agent/auth.json:
The{ "opencode-go": { "type": "api_key", "key": "your-api-key" } }keyfield supports literals,$ENV_VAR/${ENV_VAR}interpolation, and!commandexecution. See pi's providers docs for details.- Environment variable —
OPENCODE_API_KEY
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| OPENCODE_API_KEY | No | Your opencode.ai API key (fallback if not in auth.json) |
Configuration
Add to your pi configuration for automatic loading:
{
"extensions": [
"/path/to/pi-opencode-go-provider"
]
}License
MIT
