Gemini 3.8 Flash API
google/gemini-3.8-flashGemini 3.8 Flash turns text, images, audio, video, and documents into code, analysis, and answers for long-horizon coding and multi-step reasoning. Its million-token context carries project details and source material across agent workflows.
Gemini 3.8 Flash
Google · chat-completions
Quick start
Send a POST request to /v1/chat/completions with google/gemini-3.8-flash. Choose JSON or SSE with stream, and receive generated content and usage.
- Endpoint
- POST /v1/chat/completions
- Model ID
- google/gemini-3.8-flash
- Protocol
- Chat Completions
Request fields
| Field | Requirement | Description |
|---|---|---|
| model | Required | google/gemini-3.8-flash |
| messages | Required | A non-empty ordered array with system, user, or assistant roles and text content. |
| temperature | Optional | Sampling temperature from 0 to 2; the playground defaults to 1. |
| max_tokens | Optional | An integer from 1 to 65,536 setting the output token budget; the playground defaults to 4,096. |
| top_p | Optional | Nucleus sampling probability from 0 to 1; the playground defaults to 1. |
| stream | Optional | Defaults to false for complete JSON; true returns SSE events. The playground streams replies. |
Response and usage
Successful responses include generated content and usage. Billing settles from actual input, output, and cache tokens.
Streaming
Set stream: true to read SSE. Finalize usage accounting from the terminal usage event.
curl --request POST \
--url "https://api.vidgo.ai/v1/chat/completions" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "google/gemini-3.8-flash",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Review this retry loop, identify failure modes, and propose tests for the fix."
}
],
"max_tokens": 4096,
"temperature": 1,
"top_p": 1,
"stream": false
}'Keep API keys on the server. Never expose them in browser code or public repositories.
Continue with
Related Models
Gemini 3.8 Flash API — Frequently asked questions
What is the Gemini 3.8 Flash API?
Gemini 3.8 Flash is Google’s model for turning text, images, audio, video, and documents into code, analysis, and answers, with a focus on long-horizon coding and multi-step agent work. Its million-token context carries source material, while system instructions and generation controls guide the response. Call it through Chat Completions or Gemini Native, or try a text conversation in the Playground above.
How does Gemini 3.8 Flash handle long-horizon coding?
Provide requirements, related source files, and acceptance criteria. The model can break down implementation steps, examine dependencies across files, and propose changes. Return test and execution results in later turns to investigate failures and refine the fix.
How does Gemini 3.8 Flash compare with Gemini 3.7 Flash?
Google identifies Gemini 3.8 Flash as the successor to Gemini 3.7 Flash, with a focus on long-horizon software engineering and agent workflows. Their published limits are 1,048,576 input and 65,536 output tokens. Keep the messages or contents structure and verify your coding and document tasks with the Gemini 3.8 Flash model ID.
How much document context can Gemini 3.8 Flash handle?
The input limit is 1,048,576 tokens, allowing long documents, project files, and instructions in one task. Document length depends on tokenization. Label files and sections so findings can be checked against their sources.
How can Gemini 3.8 Flash analyze a PDF?
Use Gemini Native with the PDF’s base64 bytes in inlineData.data and application/pdf as mimeType. Add a text part describing the summary, extraction, or comparison task. Ask for page or section references to check findings against the document.
How does Gemini 3.8 Flash understand audio and video?
Send media bytes in Gemini Native inlineData with the appropriate mimeType and a text instruction for transcription, summarization, or content analysis. The model returns text findings. Identify the segments or events that matter to focus the analysis.
How should I set the Gemini 3.8 Flash output budget?
Maximum output is 65,536 tokens. The Playground starts at 4,096 and accepts integers from 1 to 65,536. Use max_tokens in Chat Completions or generationConfig.maxOutputTokens in Gemini Native. Leave room for thinking and the final answer; thinking tokens are billed as output.
How is cached input priced for Gemini 3.8 Flash?
Per 1M tokens, standard input costs $0.600 or 120 credits, cached input $0.060 or 12 credits, and output including thinking $3.00 or 600 credits. Reported cache reads are metered separately and subtracted from standard input usage.





























