Use CoralBricks with Pi
Run the Pi coding agent on CoralBricks open models — GLM and Kimi with up to 1M context — with one provider block in models.json.
Pi is a minimal, extensible terminal coding harness. It
takes custom OpenAI-compatible providers via a single JSON file, so you can
run its agent loop on GLM 5.3, Kimi K3, or GPT-OSS 120B through CoralBricks.
1. Install Pi
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
2. Get an API key
Create a key from your API keys page (format cb_...), then
export it:
export CORALBRICKS_API_KEY="cb_your_key_here"
Add the line to your shell profile so it persists. (Alternatively, store the
key with Pi's /login command instead of using an env var.)
3. Add CoralBricks as a provider
Create (or extend) ~/.pi/agent/models.json:
{
"providers": {
"coralbricks": {
"name": "CoralBricks",
"baseUrl": "https://inference.coralbricks.ai/v1",
"api": "openai-completions",
"apiKey": "$CORALBRICKS_API_KEY",
"models": [
{
"id": "glm-5.3-fp4",
"name": "GLM 5.3",
"reasoning": true,
"input": ["text"],
"contextWindow": 1048576,
"maxTokens": 32768,
"cost": { "input": 1.12, "output": 4.4, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "kimi-k3",
"name": "Kimi K3",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 32768,
"cost": { "input": 3, "output": 15, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-oss-120b",
"name": "GPT-OSS 120B",
"reasoning": true,
"input": ["text"],
"contextWindow": 131072,
"maxTokens": 32768,
"cost": { "input": 0.12, "output": 0.6, "cacheRead": 0, "cacheWrite": 0 }
}
]
}
}
}
The file reloads whenever you open /model — no restart needed.
4. Run
pi --model coralbricks/glm-5.3-fp4
Or pick the model interactively with /model. One-shot mode works too:
pi -p --model coralbricks/glm-5.3-fp4 "explain this repo"
Available models
| Model |
Model ID |
Context |
Input $/M |
Output $/M |
| GLM 5.3 |
glm-5.3-fp4 |
1M |
$1.12 |
$4.40 |
| Kimi K3 |
kimi-k3 |
1M |
$3.00 |
$15.00 |
| GPT-OSS 120B |
gpt-oss-120b |
128K |
$0.12 |
$0.60 |
Cached input tokens are always free.
Notes
- No compatibility flags needed — the CoralBricks gateway accepts the
developer role and honors reasoning_effort, so Pi's defaults for
reasoning-capable models work as-is (no compat overrides).
- Reasoning renders in Pi — GLM 5.3 and Kimi K3 emit reasoning that Pi
displays inline; set
"reasoning": true as shown.
- Long context is the point: GLM 5.3 and Kimi K3 accept up to 1M tokens,
so large-repo Pi sessions fit without truncation.
- The same key works in OpenCode, Cline,
Codex CLI, Cursor, and anything else that
speaks OpenAI-compatible providers. See the API reference for the
full surface.