⌘K

Gemini 3.8 Flash

gemini-3.8-flash

Google's production-ready agentic model for high-throughput, multi-step multimodal tasks. It accepts text, image, audio, and video inputs with a 1,048,576-token context window and up to 65,536 output tokens.

API Notes

gemini-3.8-flash is generally available and returns text from text, image, audio, and video inputs

The model supports an input context of up to 1,048,576 tokens and up to 65,536 output tokens

Supported thinking levels are LOW, MEDIUM, and HIGH; the default is MEDIUM, and MINIMAL is not supported

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key.

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request

Value: gemini-3.8-flash


messages array required

Array of message objects representing the conversation history

role string required

Message role

Options: user, assistant, system, developer

content string | array required

Text string or OpenAI-compatible multimodal content array


max_tokens integer

Maximum tokens to generate in the completion

Range: 1 - 65536


temperature number

Sampling temperature to use


top_p number

Nucleus sampling parameter


stream boolean

Whether to stream response incrementally


Response Format

error object

Error information, only present when status is failed

code string

Error code

message string

Detailed error message


output array

Generation results, only present when status is completed

content array

List of generated resource content

type string

Resource type

Value: image|video

url string

Processed resource URL

jobId string

Remote task ID


usage object

Usage statistics, only present when status is completed

prompt_tokens integer

Number of tokens in the request prompt

completion_tokens integer

Number of tokens in the model-generated completion

total_tokens integer

Total tokens used by the request, equal to prompt_tokens plus completion_tokens


metadata object

Metadata information