gemini-3.8-flash — API, Pricing & Context Window | Vivgrid
gemini-3.8-flash on Vivgrid: Google's newest fast agentic model with a 1M-token context window, 128K max output, and full text, image, video, audio, and PDF input.
gemini-3.8-flash is Google's newest fast Gemini model, built for agentic coding loops and multi-step tool use. It keeps the line's 1M-token context window, doubles the max output to 128K tokens, and accepts text, image, video, audio, and PDF inputs.
On Vivgrid, gemini-3.8-flash runs as a globally centralized model reachable through the same OpenAI-compatible endpoint and unified key as every other model in the catalog.
Specifications
| Provider | |
| Model ID | gemini-3.8-flash |
| Best for | Coding |
| Available on | Chat Completions, Vibe coding |
| Context window | 1,000,000 tokens |
| Max output | 128,000 tokens |
| Modalities | Text, Image, Video, Audio, PDF |
| Tool / function calling | Yes |
| Knowledge cutoff | 2026-08 |
| Acceleration | 🌐 Global (Centralized) |
Pricing
Pricing in USD per 1M tokens, matching the provider's rates.
| Input | Cached input | Output |
|---|---|---|
| $0.75 | $0.15 | $3.75 |
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.0225 |
| Warm prompt, 90% of the input served from cache | $0.0117 |
Input and output are priced identically to gemini-3.7-flash at $0.75 per 1M input tokens and $3.75 per 1M output tokens. Cached input is $0.15 per 1M — twice gemini-3.7-flash's introductory cached rate — so cache-heavy workloads should compare the two before switching.
Use gemini-3.8-flash in your coding agent
gemini-3.8-flash 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 gemini-3.8-flash 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 gemini-3.8-flash 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/gemini-3.8-flash",
"provider": {
"vivgrid": {
"npm": "@ai-sdk/openai-compatible",
"name": "Vivgrid",
"options": {
"baseURL": "https://api.vivgrid.com/v1",
"apiKey": "{env:VIVGRID_API_KEY}"
},
"models": {
"gemini-3.8-flash": {
"name": "gemini-3.8-flash",
"tool_call": true,
"attachment": true,
"modalities": { "input": ["text", "image", "video", "audio", "pdf"], "output": ["text"] },
"limit": { "context": 1000000, "output": 128000 }
}
}
}
}
}Export your key and launch OpenCode:
export VIVGRID_API_KEY="viv-xxxxxxxxxxxxx"
opencodeUse /models to switch between gemini-3.8-flash and other Vivgrid models mid-session. See the full OpenCode tutorial.
Pi
Install Pi:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentAdd gemini-3.8-flash 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",
"models": [
{
"id": "gemini-3.8-flash",
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 128000
}
]
}
}
}Make it the model Pi starts with in ~/.pi/agent/settings.json:
{
"defaultProvider": "vivgrid",
"defaultModel": "gemini-3.8-flash"
}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/gemini-3.8-flashSee the full Pi tutorial.
API surfaces
The Vivgrid Console catalogs gemini-3.8-flash on 2 surfaces, all behind the same API key. The endpoint shown is the one the Console previews for that surface.
| Surface | Primary endpoint | Use it for |
|---|---|---|
| Chat Completions | /chat/completions | Agent projects, where Vivgrid injects the model, system prompt and tools server-side, and Model API calls that name the model per request. |
| 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 gemini-3.8-flash directly.
curl https://api.vivgrid.com/v1/chat/completions \
-H "Authorization: Bearer $VIVGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.8-flash",
"messages": [
{ "role": "user", "content": "Say hello in English, Chinese and Spanish." }
],
"stream": true
}'Choosing within the Gemini 3 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 |
|---|---|---|---|---|
gemini-3.1-pro-preview | 1,048,576 | 65,536 | $3.00 | $12.00 |
gemini-3.8-flash — this page | 1,000,000 | 128,000 | $0.75 | $3.75 |
Ideal use cases
- Rapid agentic loops with heavy tool calling
- Long-form generation that needs more than a 64K output ceiling
- Long-context understanding up to 1M tokens
- High-volume multimodal reasoning and summarization
Related models
- gemini-3.7-flash — prior flash generation, cheaper cached input
- gemini-3.1-pro-preview — higher-end Gemini for coding
- claude-fable-5-1 — Anthropic's most capable model
deepseek-v4-pro
deepseek-v4-pro on Vivgrid: DeepSeek's flagship coding model with a 1M-token context window, up to 384K output tokens, and competitive pricing.
gemini-3.7-flash
gemini-3.7-flash on Vivgrid: Google's latest fast agentic model with a 1M-token context window, at introductory pricing through 2026.