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.1-flash-lite-preview
messages array required
Array of message objects representing the conversation history
role
stringrequiredMessage role
Options:
user,assistant,system,developer
content
string | arrayrequiredText string or multimodal array
max_tokens integer
Maximum tokens to generate in the completion
Range: 1 - 16384
temperature number
Sampling temperature to use
Default: 1.0
Range: 0.0 - 2.0
top_p number
Nucleus sampling parameter
Default: 1.0
Range: 0.0 - 1.0
stream boolean
Whether to stream response incrementally
Default: false
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
jobId
stringRemote task ID
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information