Skip to content

Google Models ​

Basic Chat ​

http
POST /v1beta/models/<Model ID>:generateContent
bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "text": "How does AI work?"
                     }
                 ]
             }
         ]
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "x-goog-api-key": "<API Key>",
    "Content-Type": "application/json",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "text": "How does AI work?"
                }
            ]
        }
    ]
}

resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
print(data)

Authentication Note: Google model requests use Authorization: Bearer <API Key> in the header by default. If the Authorization parameter cannot be recognized, replace "Authorization": "Bearer <API Key>" with "x-goog-api-key": "<API Key>".

Request Body Fields ​

ParameterTypeRequiredDescription
modelstringYesThe model ID, e.g., gemini-2.5-flash. Specified via the URL path /v1beta/models/<Model ID>:generateContent
contentsarrayYesThe content of the current conversation. See Content in Data Models. For single-turn requests, this is a single instance; for multi-turn requests (see Multi-turn Conversation), it contains the conversation history and the latest request
systemInstructionobjectNoDeveloper-set system instructions (Content structure) to define the model's behavior and role. Currently text only
generationConfigobjectNoConfiguration options for generation, controlling sampling, output format, thinking, etc. See Optional Parameters below
safetySettingsarrayNoList of safety settings, at most one per safety category. Each includes category (e.g., HARM_CATEGORY_HATE_SPEECH) and threshold (e.g., BLOCK_MEDIUM_AND_ABOVE). Categories not set use the default filtering level
toolsarrayNoList of tools the model may call, e.g., googleSearch, urlContext, codeExecution, functionDeclarations. See Tool in Data Models
toolConfigobjectNoTool configuration. functionCallingConfig.mode controls the function calling mode: AUTO (model decides), ANY (must call a function), NONE (no function calls), VALIDATED (model decides with validated calls); allowedFunctionNames limits the callable functions (only effective in ANY/VALIDATED mode)
cachedContentstringNoThe name of the cached content to use as context. Format: cachedContents/{cachedContent}
serviceTierstringNoThe service tier of the request. Values: unspecified (default, same as standard), standard, flex, priority
labelsobjectNoLabels with user-defined metadata for the request. Keys must start with a letter, be no longer than 63 characters, and contain only lowercase letters, digits, underscores, and dashes
continuationTokenstringNoAn opaque token to resume generation from a previous response that stopped with CONTINUATION. When provided, contents must identically replicate the initial request, and maxOutputTokens must be monotonically increased or omitted

Optional Parameters ​

Google model parameters are centralized in the generationConfig object.

ParameterTypeRequiredDefaultDescription
generationConfig.temperaturefloatNo1.0Sampling temperature, range 0.0~2.0. Higher values (e.g., 1.5) make output more random and creative, lower values (e.g., 0.3) make output more deterministic and focused. 0 means almost deterministic output. Note: deprecated on Gemini 3.6 Flash and newer models; values are silently ignored
generationConfig.topPfloatNo-Nucleus sampling threshold, range 0.0~1.0. The model considers tokens with cumulative probability up to topP. For example, 0.95 means only consider the most likely tokens that cumulatively reach 95% probability. Note: deprecated on Gemini 3.6 Flash and newer models; values are silently ignored
generationConfig.topKintNo-Only sample from the top K most likely tokens. For example, setting it to 40 means the model only chooses from the 40 highest probability tokens each time. Note: deprecated on Gemini 3.6 Flash and newer models; values are silently ignored
generationConfig.maxOutputTokensintNo-Maximum tokens for response generation. Setting this parameter controls response length and cost. Different models have different maximum limits; values exceeding the limit are automatically adjusted
generationConfig.candidateCountintNo1Number of response candidates to generate. Setting it greater than 1 returns multiple different response candidates, each billed separately. Useful for scenarios requiring multiple different answers (not supported on the Gemini 1.0 family)
generationConfig.stopSequencesarrayNo-List of stop sequences, up to 5 strings. Generation stops immediately when any stop sequence appears in the generated text. The stop sequence itself is not included in the output. Useful for controlling output format
generationConfig.seedintNo-Seed used in decoding. If not set, the request uses a randomly generated seed. Fixing the seed provides more reproducible output
generationConfig.presencePenaltyfloatNo0.0Presence penalty coefficient, range -2.0~2.0. Positive values penalize tokens that have already appeared, encouraging the model to talk about new topics; negative values encourage repeating existing topics
generationConfig.frequencyPenaltyfloatNo0.0Frequency penalty coefficient, range -2.0~2.0. Positive values penalize tokens based on their frequency in the text, decreasing likelihood of repeating the same words; negative values increase repetition likelihood
generationConfig.responseLogprobsboolNofalseWhether to return log probability information for output tokens. When enabled, the response includes log probabilities for each token, useful for analyzing model certainty and confidence
generationConfig.logprobsintNo-Number of top candidate tokens to return at each position, range 0~20, only valid when responseLogprobs: true. When set, each output token position returns the specified number of alternative tokens and their probabilities
generationConfig.responseMimeTypestringNotext/plainMIME type of the response. Values: text/plain (default text), application/json (JSON output), text/x.enum (ENUM string output). When using JSON mode, it's recommended to use responseJsonSchema to define the JSON structure
generationConfig.responseJsonSchemaobjectNo-JSON schema for the response, used for structured output; must be used with responseMimeType: "application/json". When defined, the model strictly generates JSON responses according to the schema. See Schema in Data Models. Officially recommended over the legacy responseSchema field
generationConfig.responseModalitiesarrayNo["TEXT"]The requested modalities of the response. Combination of TEXT, IMAGE, AUDIO. An empty list is equivalent to requesting only text; image generation requires ["IMAGE"] or ["TEXT", "IMAGE"] (image models only)
generationConfig.speechConfigobjectNo-Speech generation config (audio-output models only). voiceConfig.prebuiltVoiceConfig.voiceName specifies the prebuilt voice; languageCode sets the BCP-47 language code (e.g., en-US, cmn-CN); use multiSpeakerVoiceConfig.speakerVoiceConfigs for multi-speaker scenarios
generationConfig.mediaResolutionstringNo-Resolution tier for input media, affecting token cost of media understanding. Values: MEDIA_RESOLUTION_LOW (64 tokens), MEDIA_RESOLUTION_MEDIUM (256 tokens), MEDIA_RESOLUTION_HIGH (256 tokens with zoomed reframing)
generationConfig.enableEnhancedCivicAnswersboolNofalseWhether to enable enhanced civic answers. May not be available for all models
generationConfig.enableAffectiveDialogboolNofalseWhether to enable affective dialog. When enabled, the model detects user emotions and adapts its responses accordingly
generationConfig.thinkingConfigobjectNo-Config for thinking features (an error is returned if set for models that don't support thinking). When configured, the model performs internal reasoning before answering
generationConfig.thinkingConfig.thinkingBudgetintNo-Token budget available for the thinking process. Setting it to 0 completely disables the thinking feature. Higher values allow deeper reasoning but increase latency and cost
generationConfig.thinkingConfig.thinkingLevelstringNo-Controls the maximum depth of the model's internal reasoning. Values: MINIMAL (little to no thinking), LOW, MEDIUM, HIGH. Recommended for Gemini 3 and later models; using it with earlier models returns an error
generationConfig.thinkingConfig.includeThoughtsboolNofalseWhether to include the model's thought process in the response (thought parts). Thoughts are returned only when available
generationConfig.imageConfigobjectNo-Config for image generation (image models only). aspectRatio sets the aspect ratio (e.g., 1:1, 16:9), imageSize sets the resolution (512, 1K, 2K, 4K). See Image Generation docs
safetySettingsarrayNo-Safety settings array for controlling harmful content filtering levels. Each setting includes category (e.g., HARM_CATEGORY_HATE_SPEECH) and threshold (e.g., BLOCK_MEDIUM_AND_ABOVE). Can adjust filtering strength based on application scenarios
toolsarrayNo-List of tools the model may call. Google models support specific tools like googleSearch (web search), urlContext (URL content extraction), codeExecution (code execution), etc. See Tool in Data Models
toolConfigobjectNo-Tool configuration for controlling tool calling behavior. Can set functionCallingConfig.mode to AUTO (model decides), ANY (must call tools), NONE (no tool calling), or VALIDATED (model decides with validation)

Notes:

  • Google model reasoning and generation control parameters must be placed within the generationConfig object, which differs from the flat parameter structure of OpenAI and Anthropic.
  • temperature, topP, and topK are deprecated on Gemini 3.6 Flash and newer models — values are silently ignored (no error, but no effect). For older models they still work, and it's recommended to adjust only one of the three; adjusting multiple may lead to unpredictable sampling behavior.
  • thinkingConfig only works with models that support thinking. For Gemini 3 and later models, thinkingLevel is recommended; older models use thinkingBudget.
  • presencePenalty and frequencyPenalty can be used together; combining them provides more fine-grained control over output repetition and diversity.

Full Parameters Example ​

bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "text": "How does AI work?"
                     }
                 ]
             }
         ],
         "generationConfig": {
             "temperature": 1.0,
             "topP": 0.95,
             "maxOutputTokens": 2048,
             "thinkingConfig": {
                 "thinkingBudget": 1024
             }
         }
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "x-goog-api-key": "<API Key>",
    "Content-Type": "application/json",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "text": "How does AI work?"
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 1.0,
        "topP": 0.95,
        "maxOutputTokens": 2048,
        "thinkingConfig": {
            "thinkingBudget": 1024
        }
    }
}

resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
print(data)

Multi-turn Conversation ​

Multi-turn conversations pass the full conversation history through the contents array, with each message using role to distinguish the speaker (user for the user, model for the model).

bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "role": "user",
                 "parts": [
                     {
                         "text": "Hi, I would like to learn about the main attractions in Beijing."
                     }
                 ]
             },
             {
                 "role": "model",
                 "parts": [
                     {
                         "text": "Beijing has many famous attractions, such as the Forbidden City, Tiananmen Square, the Summer Palace, and the Great Wall. How many days do you have?"
                     }
                 ]
             },
             {
                 "role": "user",
                 "parts": [
                     {
                         "text": "Only one day. Please help me plan the visiting order."
                     }
                 ]
             }
         ]
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "Authorization": "Bearer <API Key>",
    "Content-Type": "application/json",
}

payload = {
    "contents": [
        {
            "role": "user",
            "parts": [
                {"text": "Hi, I would like to learn about the main attractions in Beijing."}
            ],
        },
        {
            "role": "model",
            "parts": [
                {
                    "text": "Beijing has many famous attractions, such as the Forbidden City, Tiananmen Square, the Summer Palace, and the Great Wall. How many days do you have?"
                }
            ],
        },
        {
            "role": "user",
            "parts": [{"text": "Only one day. Please help me plan the visiting order."}],
        },
    ]
}

resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
print(data["candidates"][0]["content"]["parts"][0]["text"])

Note: role only supports user and model. For single-turn requests it can be omitted (defaults to user). A multi-turn conversation must end with a user message.

Structured Output ​

Use responseMimeType: "application/json" together with responseJsonSchema to define the output structure, and the model will generate JSON responses strictly following the schema. For supported schema fields, see Schema in Data Models.

bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "text": "List three famous science fiction authors and their representative works."
                     }
                 ]
             }
         ],
         "generationConfig": {
             "responseMimeType": "application/json",
             "responseJsonSchema": {
                 "type": "object",
                 "properties": {
                     "authors": {
                         "type": "array",
                         "items": {
                             "type": "object",
                             "properties": {
                                 "name": {
                                     "type": "string",
                                     "description": "Author name"
                                 },
                                 "representativeWork": {
                                     "type": "string",
                                     "description": "Representative work title"
                                 }
                             },
                             "required": ["name", "representativeWork"]
                         }
                     }
                 },
                 "required": ["authors"]
             }
         }
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "Authorization": "Bearer <API Key>",
    "Content-Type": "application/json",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "text": "List three famous science fiction authors and their representative works."
                }
            ]
        }
    ],
    "generationConfig": {
        "responseMimeType": "application/json",
        "responseJsonSchema": {
            "type": "object",
            "properties": {
                "authors": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {"type": "string", "description": "Author name"},
                            "representativeWork": {
                                "type": "string",
                                "description": "Representative work title",
                            },
                        },
                        "required": ["name", "representativeWork"],
                    },
                }
            },
            "required": ["authors"],
        },
    },
}

resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
# The returned text is a JSON string conforming to the schema
print(data["candidates"][0]["content"]["parts"][0]["text"])

Search Request ​

Native Model Search Request ​

http
POST /v1beta/models/<Model ID>:generateContent
bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "text": "How is the weather in Beijing today?"
                     }
                 ]
             }
         ],
         "tools": [
             {
                 "googleSearch": {}
             },
             {
                 "urlContext": {}
             }
         ]
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Key>",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "text": "How is the weather in Beijing today?"
                }
            ]
        }
    ],
    "tools": [
        {
            "googleSearch": {}
        },
        {
            "urlContext": {}
        }
    ]
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
result = response.json()
print(result)

Default Search Request ​

http
POST /v1beta/models/<Model ID>:generateContent
bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "text": "How is the weather in Beijing today?"
                     }
                 ]
             }
         ]
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Key>",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "text": "How is the weather in Beijing today?"
                }
            ]
        }
    ]
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
result = response.json()
print(result)

Supported Model IDs:

  • gemini-3-pro-preview-search

Video Understanding ​

http
POST /v1beta/models/<Model ID>:generateContent
bash
curl --location --request POST 'https://neolink.com/api/v1beta/models/<Model ID>:generateContent' \
     --header 'Authorization: Bearer <API Key>' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "contents": [
             {
                 "parts": [
                     {
                         "inline_data": {
                             "mime_type": "video/mp4",
                             "data": "<Base64 Code>"
                         }
                     },
                     {
                         "text": "Please summarize the main content of this video and list three key moments."
                     }
                 ]
             }
         ]
     }'
python
import requests

url = "https://neolink.com/api/v1beta/models/<Model ID>:generateContent"

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Key>",
}

payload = {
    "contents": [
        {
            "parts": [
                {
                    "inline_data": {
                        "mime_type": "video/mp4",
                        "data": "<Base64 Code>"
                    }
                },
                {
                    "text": "Please summarize the main content of this video and list three key moments."
                }
            ]
        }
    ]
}

resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
print(data)

Base64 Encoding Note: The <Base64 Code> parameter is the Base64-encoded string of the video file. Reference script:

bash
#!/usr/bin/env bash
set -euo pipefail
VIDEO_PATH="./demo.mp4"

if [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then
    B64FLAGS="--input"
else
    B64FLAGS="-w0"
fi
base64 $B64FLAGS "$VIDEO_PATH" > base64.txt

Response Body ​

Response Example ​

json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "AI (Artificial Intelligence) works by simulating human intelligence..."
          }
        ]
      },
      "finishReason": "STOP",
      "index": 0
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 8,
    "candidatesTokenCount": 328,
    "totalTokenCount": 336
  },
  "modelVersion": "gemini-2.5-flash",
  "responseId": "aBcDeFgHiJkLmNoP"
}

Response Field Description ​

FieldTypeDescription
candidatesarrayList of candidate responses generated by the model. See Candidate in Data Models
candidates[].contentobjectThe generated content. role is always model; parts contains text or tool call segments
candidates[].finishReasonstringThe reason the model stopped generating tokens. Common values: STOP (natural stop), MAX_TOKENS (token limit reached), SAFETY (safety filtering), RECITATION (recitation). Full enum in Candidate
candidates[].indexintIndex of the candidate in the response candidate list
promptFeedbackobjectFeedback related to content filters for the prompt. When the prompt is blocked, blockReason is returned: SAFETY (safety reasons), BLOCKLIST (terminology blocklist), PROHIBITED_CONTENT (prohibited content), IMAGE_SAFETY (image safety), OTHER (unknown); no candidates are returned in this case
usageMetadataobjectToken usage metadata for the generation request
usageMetadata.promptTokenCountintNumber of tokens in the prompt (including tokens in cached content)
usageMetadata.cachedContentTokenCountintNumber of tokens in the cached part of the prompt
usageMetadata.candidatesTokenCountintTotal number of tokens across all generated response candidates
usageMetadata.thoughtsTokenCountintNumber of thought tokens for thinking models
usageMetadata.toolUsePromptTokenCountintNumber of tokens present in tool-use prompts
usageMetadata.totalTokenCountintTotal token count (prompt + tool-use prompt + thoughts + response candidates)
usageMetadata.promptTokensDetailsarrayToken breakdown by modality for request input. Each entry includes modality (e.g., TEXT, IMAGE, VIDEO, AUDIO) and tokenCount
usageMetadata.candidatesTokensDetailsarrayToken breakdown by modality for response output, same structure as above
modelVersionstringThe model version used to generate the response
responseIdstringUnique identifier of the response, used to locate the request when troubleshooting

Data Models ​

The following are the core data structures involved in requests and responses (condensed version). For complete definitions, refer to the Google official API documentation.

Content ​

The base structured datatype of a message, containing the role and content parts.

FieldTypeRequiredDescription
rolestringNoThe producer of the content. Values: user or model. Required for multi-turn conversations; can be omitted for single-turn requests
partsarrayYesOrdered parts that constitute a single message. Parts may have different MIME types. See Part below

Part ​

A content part within Content. The data field is a union type (only one can be set).

FieldTypeDescription
textstringInline text
inlineDataobjectInline media bytes. mimeType is an IANA standard MIME type (e.g., image/png, video/mp4, application/pdf); data is the Base64-encoded bytes
fileDataobjectURI-based file data. fileUri (required) is the file URI; mimeType is the MIME type
functionCallobjectA function call predicted by the model. name (required) is the function name; args is a JSON object of parameters; id is the call identifier
functionResponseobjectThe result of a function call, sent back as context to the model. name (required) is the function name; response (required) is the JSON output; id matches the corresponding functionCall id
executableCodeobjectCode generated by the model that is meant to be executed. language (required, currently only PYTHON); code (required) is the code content
codeExecutionResultobjectResult of executing the executableCode. outcome (required) values: OUTCOME_OK (success, output contains stdout), OUTCOME_FAILED (failure, output contains stderr), OUTCOME_DEADLINE_EXCEEDED (timeout)
thoughtboolIndicates whether this part is a thought from the model (used with thinkingConfig.includeThoughts)
thoughtSignaturestringAn opaque signature for the thought; must be echoed back in subsequent requests to maintain multi-turn thinking context

Candidate ​

A response candidate generated by the model.

FieldTypeDescription
indexintIndex of the candidate
contentobjectThe generated content. See Content
finishReasonstringThe reason the model stopped generating tokens. Main values listed below
finishMessagestringDetails of the stop reason, only populated when finishReason is set
safetyRatingsarraySafety ratings for this candidate, at most one per category. Includes category, probability, blocked, etc.
citationMetadataobjectCitation information for passages recited from training data, via citationSources
groundingMetadataobjectGrounding metadata for search-augmented answers, including groundingChunks (retrieved sources, e.g., web.uri/web.title), groundingSupports (mapping between sources and text), webSearchQueries (executed search queries)
tokenCountintToken count for this candidate

Main finishReason values:

ValueDescription
STOPNatural stop point of the model or provided stop sequence
MAX_TOKENSThe maximum number of tokens specified in the request was reached
SAFETYThe candidate content was flagged for safety reasons
RECITATIONThe candidate content was flagged for recitation reasons
LANGUAGEThe candidate content was flagged for using an unsupported language
BLOCKLISTGeneration stopped because the content contains forbidden terms
PROHIBITED_CONTENTGeneration stopped for potentially containing prohibited content
SPIIGeneration stopped because the content potentially contains Sensitive Personally Identifiable Information
MALFORMED_FUNCTION_CALLThe function call generated by the model is invalid
IMAGE_SAFETY / IMAGE_PROHIBITED_CONTENT / IMAGE_OTHERImage generation stopped due to safety / prohibited content / other issues
NO_IMAGEThe model was expected to generate an image, but none was generated
UNEXPECTED_TOOL_CALLThe model generated a tool call but no tools were enabled in the request
TOO_MANY_TOOL_CALLSThe model called too many tools consecutively
CONTINUATIONThe response reached the per-request token limit but is not complete; generation can be continued via continuationToken
OTHERUnknown reason

Tool ​

Tools that the model may use. Each element in the tools array can only specify one tool type.

FieldTypeDescription
functionDeclarationsarrayList of function declarations for Function Calling. Each includes name (required, up to 128 chars), description (required), and parameters (a Schema) or parametersJsonSchema (JSON Schema format, mutually exclusive with parameters). The model does not execute functions; it returns a functionCall for the client to execute
googleSearchobjectGoogle Search tool, giving the model web retrieval capability. Optional timeRangeFilter (startTime/endTime to limit the time range) and searchTypes (webSearch for web search, enabled by default; imageSearch for image search)
urlContextobjectURL context tool, automatically extracts content from user-provided URLs as context
codeExecutionobjectCode execution tool, allowing the model to execute Python code during generation and use the results
fileSearchobjectFile Search tool, retrieving knowledge from Semantic Retrieval corpora. fileSearchStoreNames (required) specifies the stores, e.g., fileSearchStores/my-store-123; optional topK, metadataFilter
googleMapsobjectGoogle Maps tool, grounding the model's response with geospatial context. Optional enableWidget returns a widget context token
computerUseobjectComputer use tool, automatically injecting predefined functions to operate browser/mobile/desktop environments. environment (required) values: ENVIRONMENT_BROWSER, ENVIRONMENT_MOBILE, ENVIRONMENT_DESKTOP
mcpServersarrayList of MCP Servers to connect to. Each includes name and streamableHttpTransport (url, headers, timeout settings, etc.)

Schema ​

Schema defines the data types for structured output and function parameters/responses. It is a subset of the OpenAPI 3.0 Schema.

FieldTypeRequiredDescription
typestringYesData type. Values: STRING, NUMBER, INTEGER, BOOLEAN, ARRAY, OBJECT, NULL
formatstringNoThe format of the data, e.g., enum, date-time
descriptionstringNoA brief description of the parameter. May be formatted as Markdown and include examples
nullableboolNoIndicates if the value may be null
enumarrayNoPossible values for STRING type elements
itemsobjectNoSchema of the elements of ARRAY type
minItems / maxItemsstringNoMinimum/maximum number of elements for ARRAY type
propertiesobjectNoProperties of OBJECT type; keys are property names, values are Schema
requiredarrayNoRequired property names of OBJECT type
minProperties / maxPropertiesstringNoMinimum/maximum number of properties for OBJECT type
minimum / maximumnumberNoMinimum/maximum value of INTEGER/NUMBER type
minLength / maxLengthstringNoMinimum/maximum length of STRING type
patternstringNoRegular expression to restrict a STRING type
anyOfarrayNoThe value must validate against any of the subschemas in the list
propertyOrderingarrayNoThe order of the properties (not a standard OpenAPI field), used to determine property order in the response