kimi-k2.8-preview — API, Pricing & Context Window | Vivgrid
kimi-k2.8-preview on Vivgrid: Moonshot AI's efficient coding model with a 1M-token context window and tool calling, at a fraction of kimi-k3's price.
kimi-k2.8-preview is Moonshot AI's efficient coding model, released in September 2026. It brings the Kimi family's 1M-token context window to a mid-tier price point — $1.00 per 1M input tokens, $0.26 cached, and $4.15 output — roughly a third of what kimi-k3 costs, while keeping repository-scale context.
Its defining feature is adjustable thinking effort. Dial reasoning down for routine edits and up for hard problems, so you pay for deep reasoning only when a task needs it.
Vivgrid serves kimi-k2.8-preview through the unified, OpenAI-compatible Chat Completions API (/chat/completions), so you can route Moonshot alongside OpenAI, Anthropic, and Google models with one API key and one bill.
Specifications
| Provider | Moonshot AI |
| Model ID | kimi-k2.8-preview |
| Best for | Coding |
| Available on | Vibe coding |
| Context window | 1,000,000 tokens |
| Modalities | Text, Image |
| Tool / function calling | Yes |
| Knowledge cutoff | — |
| Acceleration | 🌐 Global (Centralized) |
Pricing
Pricing in USD per 1M tokens.
| Input | Cached input | Output |
|---|---|---|
| $1.00 | $0.26 | $4.15 |
What one request costs
The rates above applied to a 20K-token prompt with a 2K-token reply — a typical single agent turn, small enough that every request is billed at the base rate.
| Request | Cost |
|---|---|
| Cold prompt, nothing cached | $0.0283 |
| Warm prompt, 90% of the input served from cache | $0.0150 |
Use kimi-k2.8-preview in your coding agent
kimi-k2.8-preview works with the same Vivgrid key and https://api.vivgrid.com/v1 endpoint as every other model in the catalog. Grab your API key from the Vivgrid Console, then drop one of the configurations below into your agent of choice.
OpenCode
OpenCode has Vivgrid built in, so you can use kimi-k2.8-preview without writing any config: open /models, search for vivgrid, paste your API key and pick the model. The OpenCode tutorial walks through it step by step.
Prefer to configure it by hand? Install OpenCode:
npm i -g opencode-aiDeclare kimi-k2.8-preview under the Vivgrid provider in your global OpenCode config, ~/.config/opencode/opencode.json. The @ai-sdk/openai-compatible provider talks to Vivgrid over Chat Completions (/v1/chat/completions):
{
"$schema": "https://opencode.ai/config.json",
"model": "vivgrid/kimi-k2.8-preview",
"provider": {
"vivgrid": {
"npm": "@ai-sdk/openai-compatible",
"name": "Vivgrid",
"options": {
"baseURL": "https://api.vivgrid.com/v1",
"apiKey": "{env:VIVGRID_API_KEY}"
},
"models": {
"kimi-k2.8-preview": {
"name": "kimi-k2.8-preview",
"tool_call": true,
"attachment": true,
"modalities": { "input": ["text", "image"], "output": ["text"] }
}
}
}
}
}Export your key and launch OpenCode:
export VIVGRID_API_KEY="viv-xxxxxxxxxxxxx"
opencodeUse /models to switch between kimi-k2.8-preview and other Vivgrid models mid-session. See the full OpenCode tutorial.
Pi
Install Pi:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentAdd kimi-k2.8-preview to the Vivgrid provider in ~/.pi/agent/models.json. Pi talks to Vivgrid over Chat Completions (/v1/chat/completions):
{
"providers": {
"vivgrid": {
"baseUrl": "https://api.vivgrid.com/v1",
"apiKey": "viv-xxxxxxxxxxxxx",
"api": "openai-completions",
"compat": {
"sendSessionAffinityHeaders": true
},
"models": [
{
"id": "kimi-k2.8-preview",
"input": ["text", "image"],
"contextWindow": 1000000
}
]
}
}
}Make it the model Pi starts with in ~/.pi/agent/settings.json:
{
"defaultProvider": "vivgrid",
"defaultModel": "kimi-k2.8-preview"
}Then verify and start Pi:
pi --list-models vivgrid
piOr run a one-shot prompt without entering the TUI:
pi -p "explain the auth flow in this repo" --model vivgrid/kimi-k2.8-previewSee the full Pi tutorial.
API surfaces
The Vivgrid Console catalogs kimi-k2.8-preview on one surface, all behind the same API key. The endpoint shown is the one the Console previews for that surface.
| Surface | Primary endpoint | Use it for |
|---|---|---|
| Vibe coding | /chat/completions | Coding CLIs and IDE agents that drive the model themselves — point the tool at Vivgrid and keep your own loop. |
Quick start
Get an API key from the Vivgrid Console, then call kimi-k2.8-preview directly.
curl https://api.vivgrid.com/v1/chat/completions \
-H "Authorization: Bearer $VIVGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.8-preview",
"messages": [
{ "role": "user", "content": "Say hello in English, Chinese and Spanish." }
],
"stream": true
}'Choosing within the Kimi family
Prices are USD per 1M tokens at the base rate. Rows marked this page are the model described here.
| Model | Context | Max output | Input | Output |
|---|---|---|---|---|
kimi-k3 | 1,000,000 | 128,000 | $3.00 | $15.00 |
kimi-k2.8-preview — this page | 1,000,000 | — | $1.00 | $4.15 |
Ideal use cases
- High-volume coding agents where
kimi-k3is more model than the task needs - Long-context refactoring and repository-scale reading on a budget
- Tool-calling workflows that mix quick edits with occasional deep reasoning
- Cost-sensitive fallbacks behind a frontier model
Related models
- kimi-k3 — Moonshot's frontier coding model
- kimi-k2.6 — the prior Kimi generation, with a 256K max output
- minimax-m3 — a lower-cost long-context alternative