Request
Response
Parameters
An optional header used for spend logging metadata, containing JSON properties like user_id, project_id, and env.
The conversation history or input prompts as an array of content objects.
The role of the creator of the content (e.g. "user" or "model").
An ordered list of parts that constitute a single message turn.
The text prompt or response content.
System instructions that provide context, rules, or guidelines to the model.
An ordered list of parts that constitute the system instruction.
The text content of the system instruction.
Configuration options for model generation and outputs.
Controls the randomness of the output.
The maximum cumulative probability of tokens to consider when sampling.
The maximum number of tokens to consider when sampling.
Number of generated responses to return.
The maximum number of tokens to include in a candidate.
A list of strings that tell the model to stop generating text.
A list of Tools the model may use to generate the next response. Supported tools are function declarations and code execution.
A list of function declarations the model can call.Show function_declarations[]
The name of the function to call.
A description of what the function does.
Describes the parameters for the function in JSON Schema format.
The type of the parameters object. Usually "object".
A map of parameter names to their schema definitions.
List of required parameter names.
Enables the model to execute code as part of generation. Pass an empty object {} to enable.
Tool configuration for any Tool specified in the request.
Configuration for function calling behavior.Show function_calling_config
Controls how the model uses the provided functions. One of:
"AUTO" — model decides whether to call a function or respond in text
"ANY" — model must call one of the provided functions
"NONE" — model must not call any functions
Optional. When mode is "ANY", limits the model to only call functions from this list.
A list of unique safety settings for blocking unsafe content.
The category for this setting (e.g. HARM_CATEGORY_HATE_SPEECH).
Block threshold for this category (e.g. BLOCK_MEDIUM_AND_ABOVE).
Params to Avoid