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.7-flash
messages array required
Array of message objects representing the conversation history
role
stringrequiredMessage role
Options:
user,assistant,system,developer
content
string | arrayrequiredText string or OpenAI-compatible content array
max_tokens integer
Maximum tokens to generate in the completion
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
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
prompt_tokens
integerNumber of tokens in the request prompt
completion_tokens
integerNumber of tokens in the model-generated completion
total_tokens
integerTotal tokens used by the request, equal to
prompt_tokenspluscompletion_tokens
metadata object
Metadata information