Use CoralBricks with Pi
Run the Pi coding agent on CoralBricks open models — GLM and Kimi with up to 1M context — with one install command.
Pi is a minimal, extensible terminal coding harness. Its
provider system is pluggable, so you can run its agent loop on GLM 5.3,
GLM 5.3 Flash, 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
pi install npm:pi-coralbricks-provider
That's it. pi-coralbricks-provider
is a community package by Tom that we
collaborate on: it registers coralbricks/<model> in Pi's /model picker,
syncs the model list from the gateway, and sets the right thinking-level
controls per model family, so new CoralBricks models and pricing changes
arrive without any update on your side. Source:
github.com/monotykamary/pi-coralbricks-provider.
Manual alternative
Prefer to configure it by hand? 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": 1.12 }
},
{
"id": "glm-5.3-flash-fp4",
"name": "GLM 5.3 Flash",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 32768,
"cost": { "input": 0.15, "output": 0.5, "cacheRead": 0, "cacheWrite": 0.15 }
},
{
"id": "kimi-k3",
"name": "Kimi K3",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 32768,
"cost": { "input": 3, "output": 15, "cacheRead": 0, "cacheWrite": 3 }
},
{
"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.12 }
}
]
}
}
}
The file reloads whenever you open /model — no restart needed. A
coralbricks block here takes precedence over the package, so keep one or
the other.
4. Run
pi --model coralbricks/glm-5.3-flash-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 |
| GLM 5.3 Flash |
glm-5.3-flash-fp4 |
1M |
$0.15 |
$0.50 |
| 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; the package maps Pi's thinking levels per model family
(the block above sets
"reasoning": true).
- Images work on the vision models — GLM 5.3 Flash and Kimi K3 take image
input; the text-only models return a clear 400 if you attach one.
- 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.