GET

/v1/schemas/gemini/chat/v1beta/models/{modelsId}:countTokens

kind inputactivity chathash 54eb656d…extracted Nov 12, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
8b1d653d4bb7e4c0a1c32aee9dabc01ecd267ae5ff628c9a2a508a6f72c01cc6
{
  "fetchedAt": 1794461403,
  "extractorVersion": "2",
  "verifiedAt": null
}

Request body

2 properties · 0 required · 57 $defs
propertytypedescriptionconstraints
generateContentRequestGenerateContentRequestRequest to generate a completion from the model.
contentsContent[]Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.

Types

57 $defs

AudioResponseFormatobject

Configuration for audio output format.

sampleRateintegerOptional. Sample rate in Hz.format: int32
deliveryenumOptional. The delivery mode for the audio output.DELIVERY_UNSPECIFIED | INLINE | URI
bitRateintegerOptional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).format: int32
mimeTypeenumOptional. The MIME type of the audio output.MIME_TYPE_UNSPECIFIED | AUDIO_MP3 | AUDIO_OGG_OPUS | AUDIO_L16 | AUDIO_WAV | AUDIO_ALAW · +1 more

AudioTranscriptionobject

The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate Part with its own AudioTranscription carrying the speaker_label.

speakerLabelstringOptional. A label identifying the speaker of this audio segment (e.g. "spk_1", "spk_2"). Present when diarization is set.
textstringRequired. The transcription text of this audio segment.
wordsWordInfo[]Optional. Detailed word-level transcriptions and timing details. Present when word_timestamp is set.

AudioTranscriptionConfigobject

The audio transcription configuration.

languageCodesstring[]Optional. BCP-47 language codes providing hints about the languages present in the audio. If omitted or empty, defaults to automatic language detection.
sourceTextstringOptional. The source text to be edited or rewritten via voice instructions. When provided in `SMART` mode, the model evaluates the audio input against this text and emits the complete replacement text in the candidate response rather than appending to it.
diarizationbooleanOptional. Configures speaker diarization.
languageAutoLanguageAutoIndicates the language of the audio should be automatically detected.
modeenumOptional. Configures transcription mode. Supported values: `VERBATIM`, `SMART`. If unspecified, defaults to `VERBATIM` transcription. In `SMART` mode, the model performs disfluency removal (eliminating filler words, repetitions, and false starts), light gramma…MODE_UNSPECIFIED | VERBATIM | SMART
wordTimestampbooleanOptional. Configures word-level timestamp generation.
adaptationPhrasesstring[]Optional. A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms.
languageHintsLanguageHintsProvides hints to the model about possible languages present in the audio.
customVocabularystring[]Optional. A list of custom vocabulary phrases to bias the speech recognition model toward recognizing specific terms (product names, proper nouns, jargon).

Blobobject

Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.

mimeTypestringThe IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: tex…
datastringRaw bytes for media formats.format: byte
displayNamestringOptional. Specifies the name used to refer to this blob to the model (e.g. "my_blob.png"). Used as the blob reference identifier when `verbalization_mode` is set to `REFERENCE_ONLY`.

CodeExecutionobject

Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.

CodeExecutionResultobject

Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.

outcomeenumRequired. Outcome of the code execution.OUTCOME_UNSPECIFIED | OUTCOME_OK | OUTCOME_FAILED | OUTCOME_DEADLINE_EXCEEDED
outputstringOptional. Contains stdout when code execution is successful, stderr or other description otherwise.
idstringOptional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.

ComputerUseobject

Computer Use tool type.

environmentenumRequired. The environment being operated.ENVIRONMENT_UNSPECIFIED | ENVIRONMENT_BROWSER | ENVIRONMENT_MOBILE | ENVIRONMENT_DESKTOP
excludedPredefinedFunctionsstring[]Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the defin…
enablePromptInjectionDetectionbooleanOptional. Whether enable the prompt injection detection check on computer-use request.
disabledSafetyPoliciesenum[]Optional. Disabled safety policies for computer use.

Contentobject

The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.

partsPart[]Ordered `Parts` that constitute a single message. Parts may have different MIME types.
rolestringOptional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.

DynamicRetrievalConfigobject

Describes the options to customize dynamic retrieval.

modeenumThe mode of the predictor to be used in dynamic retrieval.MODE_UNSPECIFIED | MODE_DYNAMIC
dynamicThresholdnumberThe threshold to be used in dynamic retrieval. If not set, a system default value is used.format: float

ExecutableCodeobject

Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generat…

codestringRequired. The code to be executed.
idstringOptional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
languageenumRequired. Programming language of the `code`.LANGUAGE_UNSPECIFIED | PYTHON

FileDataobject

URI based data.

mimeTypestringOptional. The IANA standard MIME type of the source data.
fileUristringRequired. URI.
displayNamestringOptional. Specifies the name used to refer to this file to the model (e.g. "my_file.pdf"). Used as the file reference identifier when `verbalization_mode` is set to `REFERENCE_ONLY`.

FileSearchobject

The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.

fileSearchStoreNamesstring[]Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`
metadataFilterstringOptional. Metadata filter to apply to the semantic retrieval documents and chunks.
topKintegerOptional. The number of semantic retrieval chunks to retrieve.format: int32

FunctionCallobject

A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.

namestringRequired. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.
argsobjectOptional. The function parameters and values in JSON object format.
idstringOptional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.

FunctionCallingConfigobject

Configuration for specifying function calling behavior.

allowedFunctionNamesstring[]Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call fro…
modeenumOptional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.MODE_UNSPECIFIED | AUTO | ANY | NONE | VALIDATED

FunctionDeclarationobject

Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block…

namestringRequired. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.
behaviorenumOptional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.UNSPECIFIED | BLOCKING | NON_BLOCKING
responseJsonSchemaanyOptional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
descriptionstringRequired. A brief description of the function.
responseSchemaThe `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).
parametersJsonSchemaanyOptional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "t…
parametersSchemaThe `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).

FunctionResponseobject

The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` m…

willContinuebooleanOptional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. …
responseobjectRequired. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can …
schedulingenumOptional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.SCHEDULING_UNSPECIFIED | SILENT | WHEN_IDLE | INTERRUPT
partsFunctionResponsePart[]Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
idstringOptional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.
namestringRequired. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.

FunctionResponseBlobobject

Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.

mimeTypestringThe IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://aistudio.google.com/docs/file-in…
displayNamestringOptional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": "DISPLAY_NAME"}`).
datastringRaw bytes for media formats.format: byte

FunctionResponseFileDataobject

URI based data for function response.

fileUristringRequired. URI.
displayNamestringOptional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": "DISPLAY_NAME"}`).
mimeTypestringThe IANA standard MIME type of the source data. If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Multimodal function responses](https://aistudio.google.com/docs/function-calling#multimodal) and [S…

FunctionResponsePartobject

A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. Media can …

mediaProcessingenumOptional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.MEDIA_PROCESSING_UNSPECIFIED | STATIC | AGENTIC
inlineDataFunctionResponseBlobRaw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.
fileDataFunctionResponseFileDataURI based data for function response.

GenerateContentRequestobject

Request to generate a completion from the model.

labelsobjectOptional. Labels with user-defined metadata for the request. Optional. Labels must follow standard unified Cloud label requirements: - Label keys must start with a letter. - Label keys and values can be no longer than 63 characters (Unicode codepoints) and can…
toolsTool[]Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Support…
continuationTokenstringOptional. An opaque continuation token used to resume generation from a previous `GenerateContent` or `StreamGenerateContent` response that stopped with `finish_reason` set to `CONTINUATION`. Note that `contents` is mandatory and must identically replicate the…format: byte
toolConfigToolConfigThe Tool configuration containing parameters for specifying `Tool` use in the request.
contentsContent[]Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://aistudio.google.com/docs/text-generation#multi-turn-conversations), this is a repeated field that c…
generationConfigGenerationConfigConfiguration options for model generation and outputs. Not all parameters are configurable for every model.
storebooleanOptional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
cachedContentstringOptional. The name of the content [cached](https://aistudio.google.com/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
modelstringRequired. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
safetySettingsSafetySetting[]Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type.…
systemInstructionContentThe base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
serviceTierenumOptional. The service tier of the request.unspecified | standard | flex | priority

GenerationConfigobject

Configuration options for model generation and outputs. Not all parameters are configurable for every model.

stopSequencesstring[]Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.
audioTranscriptionConfigAudioTranscriptionConfigThe audio transcription configuration.
candidateCountintegerOptional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)format: int32
responseSchemaSchemaThe `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).
maxOutputTokensintegerOptional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.format: int32
imageConfigImageConfigConfig for image generation features.
speechConfigSpeechConfigConfig for speech generation and transcription.
responseLogprobsbooleanOptional. If true, export the logprobs results in response.
translationConfigTranslationConfigConfig for translation features.
topKintegerOptional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling …format: int32
topPnumberOptional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k samp…format: float
enableEnhancedCivicAnswersbooleanOptional. Enables enhanced civic answers. It may not be available for all models.
responseJsonSchemaanyOptional. An internal detail. Use `responseJsonSchema` rather than this field.
frequencyPenaltynumberOptional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number o…format: float
temperaturenumberOptional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]. This field is no longer supported and is sil…format: float
thinkingConfigThinkingConfigConfig for thinking features.
responseMimeTypestringOptional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the …
mediaResolutionenumOptional. If specified, the media resolution specified will be used.MEDIA_RESOLUTION_UNSPECIFIED | MEDIA_RESOLUTION_LOW | MEDIA_RESOLUTION_MEDIUM | MEDIA_RESOLUTION_HIGH
_responseJsonSchemaanyOptional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may…
enableAffectiveDialogbooleanOptional. If enabled, the model will detect emotions and adapt its responses accordingly.
responseModalitiesenum[]Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supporte…
logprobsintegerOptional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].format: int32
seedintegerOptional. Seed used in decoding. If not set, the request uses a randomly generated seed.format: int32
responseFormatResponseFormatConfigConfiguration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.
presencePenaltynumberOptional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty …format: float

GoogleMapsobject

The GoogleMaps Tool that provides geospatial context for the user's query.

enableWidgetbooleanOptional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.

GoogleSearchobject

GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.

timeRangeFilterIntervalRepresents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecifi…
searchTypesSearchTypesDifferent types of search that can be enabled on the GoogleSearch tool.

GoogleSearchRetrievalobject

Tool to retrieve public web data for grounding, powered by Google.

dynamicRetrievalConfigDynamicRetrievalConfigDescribes the options to customize dynamic retrieval.

ImageConfigobject

Config for image generation features.

imageSizestringOptional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`.
aspectRatiostringOptional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any re…

ImageResponseFormatobject

Configuration for image output format.

mimeTypeenumOptional. The MIME type of the image output.MIME_TYPE_UNSPECIFIED | IMAGE_JPEG
deliveryenumOptional. The delivery mode for the image output.DELIVERY_UNSPECIFIED | INLINE | URI
imageSizeenumOptional. The size of the image output.IMAGE_SIZE_UNSPECIFIED | IMAGE_SIZE_FIVE_TWELVE | IMAGE_SIZE_ONE_K | IMAGE_SIZE_TWO_K | IMAGE_SIZE_FOUR_K
aspectRatioenumOptional. The aspect ratio for the image output.ASPECT_RATIO_UNSPECIFIED | ASPECT_RATIO_ONE_BY_ONE | ASPECT_RATIO_TWO_BY_THREE | ASPECT_RATIO_THREE_BY_TWO | ASPECT_RATIO_THREE_BY_FOUR | ASPECT_RATIO_FOUR_BY_THREE · +9 more

ImageSearchobject

Image search for grounding and related configurations.

Intervalobject

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecifi…

endTimestringOptional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.format: google-datetime
startTimestringOptional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.format: google-datetime

LanguageAutoobject

Indicates the language of the audio should be automatically detected.

LanguageHintsobject

Provides hints to the model about possible languages present in the audio.

languageCodesstring[]Required. BCP-47 language codes.

LatLngobject

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges…

latitudenumberThe latitude in degrees. It must be in the range [-90.0, +90.0].format: double
longitudenumberThe longitude in degrees. It must be in the range [-180.0, +180.0].format: double

McpServerobject

A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol.

streamableHttpTransportStreamableHttpTransportA transport that can stream HTTP requests and responses.
namestringThe name of the MCPServer.

MultiSpeakerVoiceConfigobject

The configuration for the multi-speaker setup.

speakerVoiceConfigsSpeakerVoiceConfig[]Required. All the enabled speaker voices.

Partobject

A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying th…

functionResponseFunctionResponseThe result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` m…
videoMetadataVideoMetadataMetadata describes the input video content. Set this in `Part.video_metadata` or `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing (such as time clipping, frame rate, maximum frame co…
thoughtbooleanOptional. Indicates if the part is thought from the model.
inlineDataBlobRaw media bytes. Text should not be sent as raw bytes, use the 'text' field.
functionCallFunctionCallA predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
mediaProcessingenumOptional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.MEDIA_PROCESSING_UNSPECIFIED | STATIC | AGENTIC
executableCodeExecutableCodeCode generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generat…
speechMetadataSpeechMetadataSpeech metadata for `text` parts.
textstringInline text.
mediaResolutionV1mainMediaResolutionMedia resolution for tokenization.
fileDataFileDataURI based data.
codeExecutionResultCodeExecutionResultResult of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.
toolCallToolCallA predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in…
partMetadataobjectCustom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part str…
thoughtSignaturestringOptional. An opaque signature for the thought so it can be reused in subsequent requests.format: byte
toolResponseToolResponseThe output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` mes…
audioTranscriptionAudioTranscriptionThe transcription of an audio part. For multi-speaker audio, each speaker segment is a separate Part with its own AudioTranscription carrying the speaker_label.

PrebuiltVoiceConfigobject

The configuration for the prebuilt speaker to use.

voiceNamestringOptional. The name of the preset voice to use.

ResponseFormatConfigobject

Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.

textTextResponseFormatConfiguration for text output format.
audioAudioResponseFormatConfiguration for audio output format.
imageImageResponseFormatConfiguration for image output format.

RetrievalConfigobject

Retrieval config.

languageCodestringOptional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
latLngLatLngAn object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges…

SafetySettingobject

Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.

thresholdenumRequired. Controls the probability threshold at which harm is blocked.HARM_BLOCK_THRESHOLD_UNSPECIFIE… | BLOCK_LOW_AND_ABOVE | BLOCK_MEDIUM_AND_ABOVE | BLOCK_ONLY_HIGH | BLOCK_NONE | OFF
categoryenumRequired. The category for this setting.HARM_CATEGORY_UNSPECIFIED | HARM_CATEGORY_DEROGATORY | HARM_CATEGORY_TOXICITY | HARM_CATEGORY_VIOLENCE | HARM_CATEGORY_SEXUAL | HARM_CATEGORY_MEDICAL · +7 more

Schemaobject

The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).

maxLengthstringOptional. Maximum length of the Type.STRINGformat: int64
patternstringOptional. Pattern of the Type.STRING to restrict a string to a regular expression.
anyOfSchema[]Optional. The value should be validated against any (one or more) of the subschemas in the list.
typeenumRequired. Data type.TYPE_UNSPECIFIED | STRING | NUMBER | INTEGER | BOOLEAN | ARRAY · +2 more
maxItemsstringOptional. Maximum number of the elements for Type.ARRAY.format: int64
minItemsstringOptional. Minimum number of the elements for Type.ARRAY.format: int64
minLengthstringOptional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRINGformat: int64
titlestringOptional. The title of the schema.
minimumnumberOptional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBERformat: double
itemsSchemaThe `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).
defaultanyOptional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field err…
descriptionstringOptional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.
maxPropertiesstringOptional. Maximum number of the properties for Type.OBJECT.format: int64
exampleanyOptional. Example of the object. Will only populated when the object is the root.
minPropertiesstringOptional. Minimum number of the properties for Type.OBJECT.format: int64
propertyOrderingstring[]Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.
formatstringOptional. The format of the data. Any value is allowed, but most do not trigger any special functionality.
requiredstring[]Optional. Required properties of Type.OBJECT.
maximumnumberOptional. Maximum value of the Type.INTEGER and Type.NUMBERformat: double
propertiesobjectOptional. Properties of Type.OBJECT.
enumstring[]Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
nullablebooleanOptional. Indicates if the value may be null.

SearchTypesobject

Different types of search that can be enabled on the GoogleSearch tool.

webSearchWebSearchStandard web search for grounding and related configurations.
imageSearchImageSearchImage search for grounding and related configurations.

SpeakerVoiceConfigobject

The configuration for a single speaker in a multi speaker setup.

voiceConfigVoiceConfigThe configuration for the voice to use.
speakerstringRequired. The name of the speaker to use. Should be the same as in the prompt.

SpeechConfigobject

Config for speech generation and transcription.

multiSpeakerVoiceConfigMultiSpeakerVoiceConfigThe configuration for the multi-speaker setup.
languageCodestringOptional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`…
voiceConfigVoiceConfigThe configuration for the voice to use.

SpeechMetadataobject

Speech metadata for `text` parts.

speakerstringOptional. Optional speaker name for multi-speaker synthesis.
stylestringOptional. Optional style instruction for the speech synthesis.

StreamableHttpTransportobject

A transport that can stream HTTP requests and responses.

terminateOnClosebooleanWhether to close the client session when the transport closes.
timeoutstringHTTP timeout for regular operations.format: google-duration
sseReadTimeoutstringTimeout for SSE read operations.format: google-duration
urlstringThe full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"
headersobjectOptional: Fields for authentication headers, timeouts, etc., if needed.

TextResponseFormatobject

Configuration for text output format.

mimeTypeenumOptional. The MIME type of the text output.MIME_TYPE_UNSPECIFIED | APPLICATION_JSON | TEXT_PLAIN
schemaanyOptional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON.

ThinkingConfigobject

Config for thinking features.

thinkingBudgetintegerThe number of thoughts tokens that the model should generate.format: int32
includeThoughtsbooleanIndicates whether to include thoughts in the response. If true, thoughts are returned only when available.
thinkingLevelenumOptional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://aistudio.google.com/docs/thinking#thinking-levels) for more details…THINKING_LEVEL_UNSPECIFIED | MINIMAL | LOW | MEDIUM | HIGH | XHIGH

Toolobject

Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

codeExecutionCodeExecutionTool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.
urlContextUrlContextTool to support URL context retrieval.
computerUseComputerUseComputer Use tool type.
googleSearchRetrievalGoogleSearchRetrievalTool to retrieve public web data for grounding, powered by Google.
mcpServersMcpServer[]Optional. MCP Servers to connect to.
googleMapsGoogleMapsThe GoogleMaps Tool that provides geospatial context for the user's query.
googleSearchGoogleSearchGoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
fileSearchFileSearchThe FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.
functionDeclarationsFunctionDeclaration[]Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for exe…

ToolCallobject

A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in…

idstringOptional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
argsobjectOptional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
toolTypeenumRequired. The type of tool that was called.TOOL_TYPE_UNSPECIFIED | GOOGLE_SEARCH_WEB | GOOGLE_SEARCH_IMAGE | URL_CONTEXT | GOOGLE_MAPS | FILE_SEARCH · +1 more
toolNamestringOptional. The name of the tool that was called.

ToolConfigobject

The Tool configuration containing parameters for specifying `Tool` use in the request.

functionCallingConfigFunctionCallingConfigConfiguration for specifying function calling behavior.
retrievalConfigRetrievalConfigRetrieval config.
includeServerSideToolInvocationsbooleanOptional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions.

ToolResponseobject

The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` mes…

idstringOptional. The identifier of the tool call this response is for.
responseobjectOptional. The tool response.
toolTypeenumRequired. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.TOOL_TYPE_UNSPECIFIED | GOOGLE_SEARCH_WEB | GOOGLE_SEARCH_IMAGE | URL_CONTEXT | GOOGLE_MAPS | FILE_SEARCH · +1 more

TranslationConfigobject

Config for translation features.

echoTargetLanguagebooleanOptional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language.
targetLanguageCodestringRequired. The target language for translation. Supported values are BCP-47 language codes (e.g. "en", "es", "fr").

UrlContextobject

Tool to support URL context retrieval.

V1mainMediaResolutionobject

Media resolution for tokenization.

levelenumThe tokenization quality used for given media. for Gemini API support .MEDIA_RESOLUTION_UNSPECIFIED | MEDIA_RESOLUTION_LOW | MEDIA_RESOLUTION_MEDIUM | MEDIA_RESOLUTION_HIGH | MEDIA_RESOLUTION_ULTRA_HIGH

VideoMetadataobject

Metadata describes the input video content. Set this in `Part.video_metadata` or `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing (such as time clipping, frame rate, maximum frame co…

startOffsetstringOptional. The start offset of the video.format: google-duration
endOffsetstringOptional. The end offset of the video.format: google-duration
fpsnumberOptional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].format: double

VoiceConfigobject

The configuration for the voice to use.

prebuiltVoiceConfigPrebuiltVoiceConfigThe configuration for the prebuilt speaker to use.
voicestringOptional. The speaker identifier for synthesis. Supported formats: * Speaker name for prebuilt voices (for example, `Orus` or `Kore`). * Voice ID for stored voices (for example, `voice_xxx`). * Voice replication key (for example, `voicekey_xxx`).

WebSearchobject

Standard web search for grounding and related configurations.

WordInfoobject

Information about a single recognized word.

wordstringRequired. Transcript of the word.
endOffsetstringOptional. End offset in time of the word relative to the start of the audio.format: google-duration
startOffsetstringOptional. Start offset in time of the word relative to the start of the audio.format: google-duration

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"gemini","endpointId":"v1beta/models/{modelsId}:countTokens","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}