{"openapi":"3.0.0","info":{"description":"The Firebase AI Logic API provides programmatic access for creating, testing, and managing server prompt templates.","version":[{"name":"v1beta","value":"v1beta"}]},"servers":[{"description":"The Firebase AI Logic API provides programmatic access for creating, testing, and managing server prompt templates.","url":"https://api.apirails.com/googlefirebasevertexai"}],"paths":{"/v1beta/projects/{projectsId}/locations/{locationsId}/config":{"get":{"tags":["Config"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The resource name of the config. Format: projects/{project}/locations/{location}/config Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.getConfig","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/config"},"summary":"Fetches the current configuration for the given project. Currently the only supported location is \"global\".","description":"Fetches the current configuration for the given project. Currently the only supported location is \"global\".","security":[{"bearerAuth":[]}]},"patch":{"tags":["Config"],"parameters":[{"name":"projectsId","in":"path","description":"Identifier. The resource name of the config. Format: projects/{project}/locations/{location}/config Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"updateMask","in":"query","description":"Optional. A comma-separated list of names of fields in the DebugToken to update. Example: `telemetry_config.mode`.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.updateConfig","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/config"},"summary":"Updates the current configuration for the specified project. Currently the only supported location is \"global\".","description":"Updates the current configuration for the specified project. Currently the only supported location is \"global\".","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"generativeLanguageConfig":{"type":"object","description":"Configuration for using the Gemini Developer API via Firebase AI Logic. When using the Gemini Developer API via Firebase AI Logic, a separate Gemini API key is stored in this configuration *on the server* so that you do **not** add your Gemini API key directly into your app's codebase.","properties":{"apiKey":{"type":"string","description":"Input only. Deprecated: AI Logic no longer requires ApiKey material. The value of the API key. The API key must have `generativelanguage.googleapis.com` in its \"API restrictions\" allowlist. Note that this API is sometimes called the *Generative Language API* in the Google Cloud console. Do **not** add this Gemini API key into your app's codebase"},"obfuscatedApiKey":{"type":"string","description":"Output only. Deprecated: AI Logic no longer required ApiKey material. The obfuscated value of the API key, showing only the last few characters of the API key to unique identify it within the project."}}},"name":{"type":"string","description":"Identifier. The resource name of the config. Format: projects/{project}/locations/{location}/config"},"telemetryConfig":{"type":"object","description":"Configuration for telemetry. Telemetry is the collection of metrics, logs, and traces recorded by the Firebase AI Logic backend.","properties":{"mode":{"type":"string","description":"Optional. The current monitoring mode used for this project.","enum":["MODE_UNSPECIFIED","NONE","ALL"]},"samplingRate":{"type":"number","description":"Optional. The percentage of requests to be sampled, expressed as a fraction in the range (0,1]. Note that the actual sampling rate may be lower than the specified value if the system is overloaded. Default is 1.0."}}},"trafficFilter":{"type":"object","description":"Configuration for traffic filter.","properties":{"firebaseAuthRequired":{"type":"boolean","description":"Optional. Only allow requests that include a valid Firebase Auth credential. Use this setting to limit access to AI Logic to only requests from logged in users. For more details on how to integrate with Firebase Auth see https://firebase.google.com/docs/auth"},"templateOnly":{"type":"boolean","description":"Optional. Only allows users to use AI Logic via prompt templates for this project."}}}}},"example":{"generativeLanguageConfig":{},"name":"","telemetryConfig":{},"trafficFilter":{}}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}/countTokens":{"post":{"tags":["Publisher Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the Endpoint requested to perform token counting. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` Segment `projects` of the `endpoint` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"publishersId","in":"path","description":"Model publisher, e.g. `google` — the `publishers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.publishers.models.countTokens","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:countTokens"},"summary":"Perform a token counting.","description":"Perform a token counting.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"contents":{"type":"array","description":"Optional. Input content.","items":{"type":"object","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}}},"generationConfig":{"type":"object","description":"Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output.","properties":{"audioTimestamp":{"type":"boolean","description":"Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response."},"audioTranscriptionConfig":{"type":"object","description":"Configuration for speech recognition (transcription)."},"candidateCount":{"type":"number","description":"Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one."},"enableAffectiveDialog":{"type":"boolean","description":"Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response."},"frequencyPenalty":{"type":"number","description":"Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0]."},"imageConfig":{"type":"object","description":"Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people."},"logprobs":{"type":"number","description":"Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response."},"maxOutputTokens":{"type":"number","description":"Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses."},"mediaResolution":{"type":"string","description":"Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.","enum":["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]},"modelConfig":{"type":"object","description":"Config for model selection."},"presencePenalty":{"type":"number","description":"Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0]."},"responseFormat":{"type":"array","description":"Optional. New response format field for the model to configure output formatting and delivery."},"responseJsonSchema":{"type":"any","description":"Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`. Deprecated: Use `response_format` instead."},"responseLogprobs":{"type":"boolean","description":"Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging."},"responseMimeType":{"type":"string","description":"Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. Deprecated: Use `response_format` instead."},"responseModalities":{"type":"array","description":"Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image."},"responseSchema":{"type":"object","description":"Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object)."},"routingConfig":{"type":"object","description":"The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name."},"seed":{"type":"number","description":"Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the \"random\" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results."},"speechConfig":{"type":"object","description":"Configuration for speech generation."},"stopSequences":{"type":"array","description":"Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [\"\\n\", \"###\"] to stop generation at a new line or a specific marker."},"temperature":{"type":"number","description":"Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0]."},"thinkingConfig":{"type":"object","description":"Configuration for the model's thinking features. \"Thinking\" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response."},"topK":{"type":"number","description":"Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words."},"topP":{"type":"number","description":"Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both."},"translationConfig":{"type":"object","description":"Config for translation features."}}},"instances":{"type":"array","description":"Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.","items":{"type":"any"}},"model":{"type":"string","description":"Optional. The name of the publisher model requested to serve the prediction. Format: `projects/{project}/locations/{location}/publishers/*/models/*`"},"systemInstruction":{"type":"object","description":"The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}},"tools":{"type":"array","description":"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.","items":{"type":"object","properties":{"codeExecution":{"type":"object","description":"Tool that executes code generated by the model, and automatically returns the result to the model. See also ExecutableCode and CodeExecutionResult, which are input and output to this tool."},"computerUse":{"type":"object","description":"Tool to support computer use."},"enterpriseWebSearch":{"type":"object","description":"Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."},"exaAiSearch":{"type":"object","description":"ExaAiSearch tool type. A tool that uses the Exa.ai search engine for grounding."},"functionDeclarations":{"type":"array","description":"Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided."},"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"googleSearch":{"type":"object","description":"GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."},"googleSearchRetrieval":{"type":"object","description":"Tool to retrieve public web data for grounding, powered by Google."},"parallelAiSearch":{"type":"object","description":"ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding."},"retrieval":{"type":"object","description":"Defines a retrieval tool that model can call to access external knowledge."},"urlContext":{"type":"object","description":"Tool to support URL context."}}}}}},"example":{"contents":[],"generationConfig":{},"instances":[],"model":"","systemInstruction":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}/generateContent":{"post":{"tags":["Publisher Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` Segment `projects` of the `model` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"publishersId","in":"path","description":"Model publisher, e.g. `google` — the `publishers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.publishers.models.generateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:generateContent"},"summary":"Generate content with multimodal inputs.","description":"Generate content with multimodal inputs.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cachedContent":{"type":"string","description":"Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`"},"contents":{"type":"array","description":"Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.","required":true,"items":{"type":"object","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}}},"generationConfig":{"type":"object","description":"Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output.","properties":{"audioTimestamp":{"type":"boolean","description":"Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response."},"audioTranscriptionConfig":{"type":"object","description":"Configuration for speech recognition (transcription)."},"candidateCount":{"type":"number","description":"Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one."},"enableAffectiveDialog":{"type":"boolean","description":"Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response."},"frequencyPenalty":{"type":"number","description":"Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0]."},"imageConfig":{"type":"object","description":"Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people."},"logprobs":{"type":"number","description":"Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response."},"maxOutputTokens":{"type":"number","description":"Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses."},"mediaResolution":{"type":"string","description":"Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.","enum":["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]},"modelConfig":{"type":"object","description":"Config for model selection."},"presencePenalty":{"type":"number","description":"Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0]."},"responseFormat":{"type":"array","description":"Optional. New response format field for the model to configure output formatting and delivery."},"responseJsonSchema":{"type":"any","description":"Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`. Deprecated: Use `response_format` instead."},"responseLogprobs":{"type":"boolean","description":"Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging."},"responseMimeType":{"type":"string","description":"Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. Deprecated: Use `response_format` instead."},"responseModalities":{"type":"array","description":"Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image."},"responseSchema":{"type":"object","description":"Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object)."},"routingConfig":{"type":"object","description":"The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name."},"seed":{"type":"number","description":"Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the \"random\" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results."},"speechConfig":{"type":"object","description":"Configuration for speech generation."},"stopSequences":{"type":"array","description":"Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [\"\\n\", \"###\"] to stop generation at a new line or a specific marker."},"temperature":{"type":"number","description":"Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0]."},"thinkingConfig":{"type":"object","description":"Configuration for the model's thinking features. \"Thinking\" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response."},"topK":{"type":"number","description":"Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words."},"topP":{"type":"number","description":"Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both."},"translationConfig":{"type":"object","description":"Config for translation features."}}},"labels":{"type":"object","description":"Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","properties":{}},"modelArmorConfig":{"type":"object","description":"Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks.","properties":{"promptTemplateName":{"type":"string","description":"Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`."},"responseTemplateName":{"type":"string","description":"Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`."}}},"safetySettings":{"type":"array","description":"Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.","items":{"type":"object","properties":{"category":{"type":"string","description":"Required. The harm category to be blocked.","required":true,"enum":["HARM_CATEGORY_UNSPECIFIED","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_CIVIC_INTEGRITY","HARM_CATEGORY_IMAGE_HATE","HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT","HARM_CATEGORY_IMAGE_HARASSMENT","HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT","HARM_CATEGORY_JAILBREAK"]},"method":{"type":"string","description":"Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.","enum":["HARM_BLOCK_METHOD_UNSPECIFIED","SEVERITY","PROBABILITY"]},"threshold":{"type":"string","description":"Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.","required":true,"enum":["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"]}}}},"systemInstruction":{"type":"object","description":"The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"functionCallingConfig":{"type":"object","description":"Function calling config."},"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"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.","items":{"type":"object","properties":{"codeExecution":{"type":"object","description":"Tool that executes code generated by the model, and automatically returns the result to the model. See also ExecutableCode and CodeExecutionResult, which are input and output to this tool."},"computerUse":{"type":"object","description":"Tool to support computer use."},"enterpriseWebSearch":{"type":"object","description":"Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."},"exaAiSearch":{"type":"object","description":"ExaAiSearch tool type. A tool that uses the Exa.ai search engine for grounding."},"functionDeclarations":{"type":"array","description":"Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided."},"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"googleSearch":{"type":"object","description":"GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."},"googleSearchRetrieval":{"type":"object","description":"Tool to retrieve public web data for grounding, powered by Google."},"parallelAiSearch":{"type":"object","description":"ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding."},"retrieval":{"type":"object","description":"Defines a retrieval tool that model can call to access external knowledge."},"urlContext":{"type":"object","description":"Tool to support URL context."}}}}}},"example":{"cachedContent":"","contents":[],"generationConfig":{},"labels":{},"modelArmorConfig":{},"safetySettings":[],"systemInstruction":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}/predict":{"post":{"tags":["Publisher Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` Segment `projects` of the `endpoint` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"publishersId","in":"path","description":"Model publisher, e.g. `google` — the `publishers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.publishers.models.predict","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:predict"},"summary":"Perform an online prediction.","description":"Perform an online prediction.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"instances":{"type":"array","description":"Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' Model's PredictSchemata's instance_schema_uri.","required":true,"items":{"type":"any"}},"labels":{"type":"object","description":"Optional. The user labels for Imagen billing usage only. Only Imagen supports labels. For other use cases, it will be ignored.","properties":{}},"parameters":{"type":"any","description":"The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint's DeployedModels' Model's PredictSchemata's parameters_schema_uri."}}},"example":{"instances":[],"labels":{},"parameters":""}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}/streamGenerateContent":{"post":{"tags":["Publisher Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` Segment `projects` of the `model` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"publishersId","in":"path","description":"Model publisher, e.g. `google` — the `publishers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.publishers.models.streamGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:streamGenerateContent"},"summary":"Generate content with multimodal inputs with streaming support.","description":"Generate content with multimodal inputs with streaming support.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cachedContent":{"type":"string","description":"Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`"},"contents":{"type":"array","description":"Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.","required":true,"items":{"type":"object","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}}},"generationConfig":{"type":"object","description":"Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output.","properties":{"audioTimestamp":{"type":"boolean","description":"Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response."},"audioTranscriptionConfig":{"type":"object","description":"Configuration for speech recognition (transcription)."},"candidateCount":{"type":"number","description":"Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one."},"enableAffectiveDialog":{"type":"boolean","description":"Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response."},"frequencyPenalty":{"type":"number","description":"Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0]."},"imageConfig":{"type":"object","description":"Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people."},"logprobs":{"type":"number","description":"Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response."},"maxOutputTokens":{"type":"number","description":"Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses."},"mediaResolution":{"type":"string","description":"Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.","enum":["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]},"modelConfig":{"type":"object","description":"Config for model selection."},"presencePenalty":{"type":"number","description":"Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0]."},"responseFormat":{"type":"array","description":"Optional. New response format field for the model to configure output formatting and delivery."},"responseJsonSchema":{"type":"any","description":"Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`. Deprecated: Use `response_format` instead."},"responseLogprobs":{"type":"boolean","description":"Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging."},"responseMimeType":{"type":"string","description":"Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. Deprecated: Use `response_format` instead."},"responseModalities":{"type":"array","description":"Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image."},"responseSchema":{"type":"object","description":"Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object)."},"routingConfig":{"type":"object","description":"The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name."},"seed":{"type":"number","description":"Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the \"random\" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results."},"speechConfig":{"type":"object","description":"Configuration for speech generation."},"stopSequences":{"type":"array","description":"Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [\"\\n\", \"###\"] to stop generation at a new line or a specific marker."},"temperature":{"type":"number","description":"Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0]."},"thinkingConfig":{"type":"object","description":"Configuration for the model's thinking features. \"Thinking\" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response."},"topK":{"type":"number","description":"Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words."},"topP":{"type":"number","description":"Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both."},"translationConfig":{"type":"object","description":"Config for translation features."}}},"labels":{"type":"object","description":"Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","properties":{}},"modelArmorConfig":{"type":"object","description":"Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks.","properties":{"promptTemplateName":{"type":"string","description":"Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`."},"responseTemplateName":{"type":"string","description":"Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`."}}},"safetySettings":{"type":"array","description":"Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.","items":{"type":"object","properties":{"category":{"type":"string","description":"Required. The harm category to be blocked.","required":true,"enum":["HARM_CATEGORY_UNSPECIFIED","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_CIVIC_INTEGRITY","HARM_CATEGORY_IMAGE_HATE","HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT","HARM_CATEGORY_IMAGE_HARASSMENT","HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT","HARM_CATEGORY_JAILBREAK"]},"method":{"type":"string","description":"Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.","enum":["HARM_BLOCK_METHOD_UNSPECIFIED","SEVERITY","PROBABILITY"]},"threshold":{"type":"string","description":"Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.","required":true,"enum":["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"]}}}},"systemInstruction":{"type":"object","description":"The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.","properties":{"parts":{"type":"array","description":"Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.","required":true},"role":{"type":"string","description":"Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'."}}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"functionCallingConfig":{"type":"object","description":"Function calling config."},"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"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.","items":{"type":"object","properties":{"codeExecution":{"type":"object","description":"Tool that executes code generated by the model, and automatically returns the result to the model. See also ExecutableCode and CodeExecutionResult, which are input and output to this tool."},"computerUse":{"type":"object","description":"Tool to support computer use."},"enterpriseWebSearch":{"type":"object","description":"Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."},"exaAiSearch":{"type":"object","description":"ExaAiSearch tool type. A tool that uses the Exa.ai search engine for grounding."},"functionDeclarations":{"type":"array","description":"Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided."},"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"googleSearch":{"type":"object","description":"GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."},"googleSearchRetrieval":{"type":"object","description":"Tool to retrieve public web data for grounding, powered by Google."},"parallelAiSearch":{"type":"object","description":"ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding."},"retrieval":{"type":"object","description":"Defines a retrieval tool that model can call to access external knowledge."},"urlContext":{"type":"object","description":"Tool to support URL context."}}}}}},"example":{"cachedContent":"","contents":[],"generationConfig":{},"labels":{},"modelArmorConfig":{},"safetySettings":[],"systemInstruction":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The parent resource where this PromptTemplate will be created. Format: projects/{project}/locations/{location} Segment `projects` of the `parent` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"promptTemplateId","in":"query","description":"Optional. The unique ID to use for the PromptTemplate, which will become the final component of the PromptTemplate's resource name. It can contain only lowercase letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and a 63-character maximum. If not provided, a system-generated ID will be used.","required":false,"schema":{"type":"string","example":""}},{"name":"regionalPropagationDisabled","in":"query","description":"Optional. For global endpoints only. If true, the PromptTemplate will be created in global only. Otherwise, the PromptTemplate will _also_ be replicated to all regions where applicable.","required":false,"schema":{"type":"boolean","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request will be validated but not executed.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/create","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates"},"summary":"Creates a new PromptTemplate.","description":"Creates a new PromptTemplate.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"createTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate was created."},"displayName":{"type":"string","description":"Optional. The display name of the PromptTemplate."},"etag":{"type":"string","description":"Optional. The etag of the PromptTemplate. If this is provided with an update request, it must match the server's etag for the operation to succeed."},"locked":{"type":"boolean","description":"Output only. Indicates if the PromptTemplate has been locked for mutations. It is strongly recommended that PromptTemplates used in production Apps be locked to avoid accidental distruption to live apps. To modify a PromptTemplate that has been locked, a call to ModifyLock with lock=false is required first."},"model":{"type":"string","description":"Output only. The model name parsed from the template_string."},"name":{"type":"string","description":"Identifier. The resource name of the PromptTemplate. Format: projects/{project}/locations/{location}/templates/{prompt_template}"},"stateChangeTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate state was last changed."},"templateId":{"type":"string","description":"Output only. Immutable. The unique ID of the PromptTemplate, which is the final component of the PromptTemplate's resource name."},"templateString":{"type":"string","description":"Required. The DotPrompt raw template string.","required":true},"updateTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate was last updated."}}},"example":{"createTime":"","displayName":"","etag":"","locked":"","model":"","name":"","stateChangeTime":"","templateId":"","templateString":"","updateTime":""}}}}},"get":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The parent resource where this PromptTemplate will be created. Format: projects/{project}/locations/{location} Segment `projects` of the `parent` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"filter","in":"query","description":"Optional. The filter to apply to the list of PromptTemplates.","required":false,"schema":{"type":"string","example":""}},{"name":"pageSize","in":"query","description":"Optional. The maximum number of PromptTemplates to return. The service may return fewer than this value. If unspecified, at most 50 PromptTemplates will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.","required":false,"schema":{"type":"number","example":""}},{"name":"pageToken","in":"query","description":"Optional. A page token, received from a previous `ListPromptTemplates` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListPromptTemplates` must match the call that provided the page token.","required":false,"schema":{"type":"string","example":""}},{"name":"view","in":"query","description":"Optional. The view to return. If not specified, the default view is FULL.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["PROMPT_TEMPLATE_VIEW_UNSPECIFIED","PROMPT_TEMPLATE_VIEW_BASIC","PROMPT_TEMPLATE_VIEW_FULL"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/list","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates"},"summary":"Lists PromptTemplates.","description":"Lists PromptTemplates.","security":[{"bearerAuth":[]}]}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}":{"delete":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the PromptTemplate resource to be deleted. Format: projects/{project}/locations/{location}/templates/{prompt_template} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"allowMissing","in":"query","description":"Optional. If set to true and the PromptTemplate does not exist, the method will still succeed.","required":false,"schema":{"type":"boolean","example":""}},{"name":"etag","in":"query","description":"Optional. The etag of the PromptTemplate. If this is provided, it must match the server's etag for the operation to succeed.","required":false,"schema":{"type":"string","example":""}},{"name":"regionalPropagationDisabled","in":"query","description":"Optional. For global endpoints only. If true, the PromptTemplate will be deleted in global only. Otherwise, the PromptTemplate will _also_ be deleted in all regions where applicable.","required":false,"schema":{"type":"boolean","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request will be validated but not executed.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/delete","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}"},"summary":"Deletes a PromptTemplate.","description":"Deletes a PromptTemplate.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the PromptTemplate resource. Format: projects/{project}/locations/{location}/templates/{prompt_template} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/get","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}"},"summary":"Gets a PromptTemplate.","description":"Gets a PromptTemplate.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Identifier. The resource name of the PromptTemplate. Format: projects/{project}/locations/{location}/templates/{prompt_template} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"allowMissing","in":"query","description":"Optional. If set to true and the PromptTemplate does not already exist, it will be created.","required":false,"schema":{"type":"boolean","example":""}},{"name":"regionalPropagationDisabled","in":"query","description":"Optional. For global endpoints only. If true, the PromptTemplate will be updated in global only. Otherwise, the PromptTemplate will _also_ be updated in all regions where applicable.","required":false,"schema":{"type":"boolean","example":""}},{"name":"updateMask","in":"query","description":"Optional. The list of fields to update.","required":false,"schema":{"type":"string","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request will be validated but not executed.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/patch","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}"},"summary":"Updates a PromptTemplate.","description":"Updates a PromptTemplate.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"createTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate was created."},"displayName":{"type":"string","description":"Optional. The display name of the PromptTemplate."},"etag":{"type":"string","description":"Optional. The etag of the PromptTemplate. If this is provided with an update request, it must match the server's etag for the operation to succeed."},"locked":{"type":"boolean","description":"Output only. Indicates if the PromptTemplate has been locked for mutations. It is strongly recommended that PromptTemplates used in production Apps be locked to avoid accidental distruption to live apps. To modify a PromptTemplate that has been locked, a call to ModifyLock with lock=false is required first."},"model":{"type":"string","description":"Output only. The model name parsed from the template_string."},"name":{"type":"string","description":"Identifier. The resource name of the PromptTemplate. Format: projects/{project}/locations/{location}/templates/{prompt_template}"},"stateChangeTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate state was last changed."},"templateId":{"type":"string","description":"Output only. Immutable. The unique ID of the PromptTemplate, which is the final component of the PromptTemplate's resource name."},"templateString":{"type":"string","description":"Required. The DotPrompt raw template string.","required":true},"updateTime":{"type":"string","description":"Output only. Timestamp when the PromptTemplate was last updated."}}},"example":{"createTime":"","displayName":"","etag":"","locked":"","model":"","name":"","stateChangeTime":"","templateId":"","templateString":"","updateTime":""}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}/modifyLock":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the PromptTemplate resource to update the lock on. Format: projects/{project}/locations/{location}/templates/{prompt_template} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/modifyLock","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}:modifyLock"},"summary":"Updates the Lock state on a PromptTemplate","description":"Updates the Lock state on a PromptTemplate","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"locked":{"type":"boolean","description":"Required. Updates the lock on a PromptTemplate to match this value. If True, mutations to the PromptTemplate will be blocked.","required":true},"regionalPropagationDisabled":{"type":"boolean","description":"Optional. For global endpoints only. If true, the PromptTemplate's lock state will be modified in global only. Otherwise, the lock state will _also_ be modified in all regions where applicable."}}},"example":{"locked":"","regionalPropagationDisabled":""}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}/templateGenerateContent":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Name of the template to use in the request. projects/project-id/location/location-name/template/template-id Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/templateGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}:templateGenerateContent"},"summary":"Generate content with multimodal inputs using a server-side prompt template.","description":"Generate content with multimodal inputs using a server-side prompt template.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"history":{"type":"array","description":"Optional. Conversation history for multi-turn prompts and function calling.","items":{"type":"object","properties":{"parts":{"type":"array","description":"List of consecutive messages from a given party."},"role":{"type":"string","description":"Optional. Indicates who generated these messages in the history. Generally this will be either 'user' or 'model'."}}}},"inputs":{"type":"object","description":"Optional. Client provided data that can be used when rendering the template. When calling via JSON/http surfaces this should be wire compatible with an arbitrary JSON object.","properties":{}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"Optional. A list of tools that the model may use to generate the response.","items":{"type":"object","properties":{"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"templateFunctions":{"type":"array","description":"Optional. A list of user-provided functions for function calling. For functions whose names are listed in the template frontmatter, the model may decide to call a subset of these functions by populating `FunctionCall` in the response. User should provide a `FunctionResponse` for each function call in the next turn."}}}}}},"example":{"history":[],"inputs":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}/templatePredict":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Name of the template to use in the request. projects/project-id/location/location-name/template/template-id Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/templatePredict","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}:templatePredict"},"summary":"Perform an online prediction using a server-side prompt template.","description":"Perform an online prediction using a server-side prompt template.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"history":{"type":"array","description":"Optional. Conversation history for multi-turn prompts and function calling.","items":{"type":"object","properties":{"parts":{"type":"array","description":"List of consecutive messages from a given party."},"role":{"type":"string","description":"Optional. Indicates who generated these messages in the history. Generally this will be either 'user' or 'model'."}}}},"inputs":{"type":"object","description":"Optional. Client provided data that can be used when rendering the template. When calling via JSON/http surfaces this should be wire compatible with an arbitrary JSON object.","properties":{}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"Optional. A list of tools that the model may use to generate the response.","items":{"type":"object","properties":{"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"templateFunctions":{"type":"array","description":"Optional. A list of user-provided functions for function calling. For functions whose names are listed in the template frontmatter, the model may decide to call a subset of these functions by populating `FunctionCall` in the response. User should provide a `FunctionResponse` for each function call in the next turn."}}}}}},"example":{"history":[],"inputs":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}/templateStreamGenerateContent":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Name of the template to use in the request. projects/project-id/location/location-name/template/template-id Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates/templateStreamGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/templates/{templatesId}:templateStreamGenerateContent"},"summary":"Generate content with multimodal inputs and streaming outputs using a server-side prompt template.","description":"Generate content with multimodal inputs and streaming outputs using a server-side prompt template.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"history":{"type":"array","description":"Optional. Conversation history for multi-turn prompts and function calling.","items":{"type":"object","properties":{"parts":{"type":"array","description":"List of consecutive messages from a given party."},"role":{"type":"string","description":"Optional. Indicates who generated these messages in the history. Generally this will be either 'user' or 'model'."}}}},"inputs":{"type":"object","description":"Optional. Client provided data that can be used when rendering the template. When calling via JSON/http surfaces this should be wire compatible with an arbitrary JSON object.","properties":{}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"Optional. A list of tools that the model may use to generate the response.","items":{"type":"object","properties":{"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"templateFunctions":{"type":"array","description":"Optional. A list of user-provided functions for function calling. For functions whose names are listed in the template frontmatter, the model may decide to call a subset of these functions by populating `FunctionCall` in the response. User should provide a `FunctionResponse` for each function call in the next turn."}}}}}},"example":{"history":[],"inputs":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/locations/{locationsId}/triggers":{"post":{"tags":["Triggers"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Format: projects/{project}/locations/{location} Segment `projects` of the `parent` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"triggerId","in":"query","description":"Required. Id of the trigger. One of \"before-generate-content\" or \"after-generate-content\".","required":true,"schema":{"type":"string","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request is only validated. The trigger will _not_ be created.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.triggers.create","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/triggers"},"summary":"Creates a new Trigger.","description":"Creates a new Trigger.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cloudFunction":{"type":"object","description":"Information about a Cloud Run Function that can be invoked when a given event occurs.","properties":{"id":{"type":"string","description":"Required. Unique ID of a Cloud Run Function that should be invoked.","required":true},"location":{"type":"string","description":"Optional. Optional Cloud region for the trigger target if it is different from the region where the trigger is defined. Firebase AI Logic supports a special `global` region for customers that don't care about regional isolation. Functions can't be deployed in the `global` region. In any other region besides `global` if this value is specified and doesn't match the location in the trigger resource name then an error will be returned. A value must be specified when creating triggers in the `global` region."},"locationId":{"type":"string","description":"Optional. Deprecated: Use `location` instead."}}},"etag":{"type":"string","description":"This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated."},"name":{"type":"string","description":"Identifier. Format: projects/{project}/locations/{location}/triggers/{trigger}"}}},"example":{"cloudFunction":{},"etag":"","name":""}}}}},"get":{"tags":["Triggers"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Format: projects/{project}/locations/{location} Segment `projects` of the `parent` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"filter","in":"query","description":"Optional. AIP-160 (https://google.aip.dev/160) compatible query string used to filter the list of triggers.","required":false,"schema":{"type":"string","example":""}},{"name":"pageSize","in":"query","description":"Optional. The maximum number of Trigger to return in the response.","required":false,"schema":{"type":"number","example":""}},{"name":"pageToken","in":"query","description":"Optional. Token returned from a previous call to `ListTriggers` indicating where in the set of triggers to resume listing.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.triggers.list","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/triggers"},"summary":"Lists existing Triggers on a project.","description":"Lists existing Triggers on a project.","security":[{"bearerAuth":[]}]}},"/v1beta/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}":{"delete":{"tags":["Triggers"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Format: projects/{project}/locations/{location}/triggers/{trigger} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"triggersId","in":"path","description":"Trigger ID — the `triggers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"allowMissing","in":"query","description":"Optional. If set to true, and the Trigger is not found, the request will succeed but no action will be taken on the server.","required":false,"schema":{"type":"boolean","example":""}},{"name":"etag","in":"query","description":"Optional. Checksum provided in the Trigger resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.","required":false,"schema":{"type":"string","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request is only validated. The Trigger will _not_ be removed.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.triggers.delete","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}"},"summary":"Deletes an existing Trigger.","description":"Deletes an existing Trigger.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Triggers"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Format: projects/{project}/locations/{location}/triggers/{trigger} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"triggersId","in":"path","description":"Trigger ID — the `triggers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.triggers.get","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}"},"summary":"Looks up an existing Trigger.","description":"Looks up an existing Trigger.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Triggers"],"parameters":[{"name":"projectsId","in":"path","description":"Identifier. Format: projects/{project}/locations/{location}/triggers/{trigger} Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"locationsId","in":"path","description":"Location ID — currently only `global` is routed; any other value returns a frontend 404 — the `locations` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"triggersId","in":"path","description":"Trigger ID — the `triggers` segment of the resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"allowMissing","in":"query","description":"Optional. If true and the trigger you are trying to update does not currently exist then create one.","required":false,"schema":{"type":"boolean","example":""}},{"name":"updateMask","in":"query","description":"Optional. A comma-separated list of names of fields in the Trigger to update.","required":false,"schema":{"type":"string","example":""}},{"name":"validateOnly","in":"query","description":"Optional. If set to true, the request is only validated. The Trigger will _not_ be updated.","required":false,"schema":{"type":"boolean","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.locations.triggers.patch","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}"},"summary":"Updates a Trigger.","description":"Updates a Trigger.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cloudFunction":{"type":"object","description":"Information about a Cloud Run Function that can be invoked when a given event occurs.","properties":{"id":{"type":"string","description":"Required. Unique ID of a Cloud Run Function that should be invoked.","required":true},"location":{"type":"string","description":"Optional. Optional Cloud region for the trigger target if it is different from the region where the trigger is defined. Firebase AI Logic supports a special `global` region for customers that don't care about regional isolation. Functions can't be deployed in the `global` region. In any other region besides `global` if this value is specified and doesn't match the location in the trigger resource name then an error will be returned. A value must be specified when creating triggers in the `global` region."},"locationId":{"type":"string","description":"Optional. Deprecated: Use `location` instead."}}},"etag":{"type":"string","description":"This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated."},"name":{"type":"string","description":"Identifier. Format: projects/{project}/locations/{location}/triggers/{trigger}"}}},"example":{"cloudFunction":{},"etag":"","name":""}}}}}},"/v1beta/projects/{projectsId}/models/{modelsId}/countTokens":{"post":{"tags":["Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}` Segment `projects` of the `model` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.models.countTokens","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/models/{modelsId}:countTokens"},"summary":"Perform a token counting. (Counttokens 2)","description":"Perform a token counting.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"contents":{"type":"array","description":"Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.","items":{"type":"object","properties":{"parts":{"type":"array","description":"Ordered `Parts` that constitute a single message. Parts may have different MIME types."},"role":{"type":"string","description":"Optional. 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."}}}},"generateContentRequest":{"type":"object","description":"Request to generate a completion from the model.","properties":{"cachedContent":{"type":"string","description":"Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`"},"contents":{"type":"array","description":"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://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.","required":true},"generationConfig":{"type":"object","description":"Configuration options for model generation and outputs. Not all parameters are configurable for every model."},"model":{"type":"string","description":"Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.","required":true},"safetySettings":{"type":"array","description":"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. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY, HARM_CATEGORY_JAILBREAK are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications."},"serviceTier":{"type":"string","description":"Optional. The service tier of the request.","enum":["unspecified","standard","flex","priority"]},"store":{"type":"boolean","description":"Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config."},"systemInstruction":{"type":"object","description":"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."},"toolConfig":{"type":"object","description":"The Tool configuration containing parameters for specifying `Tool` use in the request."},"tools":{"type":"array","description":"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`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more."}}}}},"example":{"contents":[],"generateContentRequest":{}}}}}}},"/v1beta/projects/{projectsId}/models/{modelsId}/generateContent":{"post":{"tags":["Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. Segment `projects` of the `model` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.models.generateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/models/{modelsId}:generateContent"},"summary":"Generate content with multimodal inputs. (Generatecontent 2)","description":"Generate content with multimodal inputs.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cachedContent":{"type":"string","description":"Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`"},"contents":{"type":"array","description":"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://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.","required":true,"items":{"type":"object","properties":{"parts":{"type":"array","description":"Ordered `Parts` that constitute a single message. Parts may have different MIME types."},"role":{"type":"string","description":"Optional. 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."}}}},"generationConfig":{"type":"object","description":"Configuration options for model generation and outputs. Not all parameters are configurable for every model.","properties":{"_responseJsonSchema":{"type":"any","description":"Optional. 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 be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. Deprecated. Use `response_format` instead."},"audioTranscriptionConfig":{"type":"object","description":"The audio transcription configuration."},"candidateCount":{"type":"number","description":"Optional. 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)"},"enableAffectiveDialog":{"type":"boolean","description":"Optional. If enabled, the model will detect emotions and adapt its responses accordingly."},"enableEnhancedCivicAnswers":{"type":"boolean","description":"Optional. Enables enhanced civic answers. It may not be available for all models."},"frequencyPenalty":{"type":"number","description":"Optional. 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 of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit."},"imageConfig":{"type":"object","description":"Config for image generation features."},"logprobs":{"type":"number","description":"Optional. 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]."},"maxOutputTokens":{"type":"number","description":"Optional. 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."},"mediaResolution":{"type":"string","description":"Optional. If specified, the media resolution specified will be used.","enum":["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]},"presencePenalty":{"type":"number","description":"Optional. 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 that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary."},"responseFormat":{"type":"object","description":"Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality."},"responseJsonSchema":{"type":"any","description":"Optional. An internal detail. Use `responseJsonSchema` rather than this field."},"responseLogprobs":{"type":"boolean","description":"Optional. If true, export the logprobs results in response."},"responseMimeType":{"type":"string","description":"Optional. 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 [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types."},"responseModalities":{"type":"array","description":"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 supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text."},"responseSchema":{"type":"object","description":"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)."},"seed":{"type":"number","description":"Optional. Seed used in decoding. If not set, the request uses a randomly generated seed."},"speechConfig":{"type":"object","description":"Config for speech generation and transcription."},"stopSequences":{"type":"array","description":"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."},"temperature":{"type":"number","description":"Optional. 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]."},"thinkingConfig":{"type":"object","description":"Config for thinking features."},"topK":{"type":"number","description":"Optional. 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 don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests."},"topP":{"type":"number","description":"Optional. 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 sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests."},"translationConfig":{"type":"object","description":"Config for translation features."}}},"model":{"type":"string","description":"Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.","required":true},"safetySettings":{"type":"array","description":"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. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY, HARM_CATEGORY_JAILBREAK are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.","items":{"type":"object","properties":{"category":{"type":"string","description":"Required. The category for this setting.","required":true,"enum":["HARM_CATEGORY_UNSPECIFIED","HARM_CATEGORY_DEROGATORY","HARM_CATEGORY_TOXICITY","HARM_CATEGORY_VIOLENCE","HARM_CATEGORY_SEXUAL","HARM_CATEGORY_MEDICAL","HARM_CATEGORY_DANGEROUS","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_CIVIC_INTEGRITY","HARM_CATEGORY_JAILBREAK"]},"threshold":{"type":"string","description":"Required. Controls the probability threshold at which harm is blocked.","required":true,"enum":["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"]}}}},"serviceTier":{"type":"string","description":"Optional. The service tier of the request.","enum":["unspecified","standard","flex","priority"]},"store":{"type":"boolean","description":"Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config."},"systemInstruction":{"type":"object","description":"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.","properties":{"parts":{"type":"array","description":"Ordered `Parts` that constitute a single message. Parts may have different MIME types."},"role":{"type":"string","description":"Optional. 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."}}},"toolConfig":{"type":"object","description":"The Tool configuration containing parameters for specifying `Tool` use in the request.","properties":{"functionCallingConfig":{"type":"object","description":"Configuration for specifying function calling behavior."},"includeServerSideToolInvocations":{"type":"boolean","description":"Optional. 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."},"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"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`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.","items":{"type":"object","properties":{"codeExecution":{"type":"object","description":"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."},"computerUse":{"type":"object","description":"Computer Use tool type."},"fileSearch":{"type":"object","description":"The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API."},"functionDeclarations":{"type":"array","description":"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 execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn."},"googleMaps":{"type":"object","description":"The GoogleMaps Tool that provides geospatial context for the user's query."},"googleSearch":{"type":"object","description":"GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."},"googleSearchRetrieval":{"type":"object","description":"Tool to retrieve public web data for grounding, powered by Google."},"mcpServers":{"type":"array","description":"Optional. MCP Servers to connect to."},"urlContext":{"type":"object","description":"Tool to support URL context retrieval."}}}}}},"example":{"cachedContent":"","contents":[],"generationConfig":{},"model":"","safetySettings":[],"serviceTier":"","store":"","systemInstruction":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/models/{modelsId}/streamGenerateContent":{"post":{"tags":["Models"],"parameters":[{"name":"projectsId","in":"path","description":"Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. Segment `projects` of the `model` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"modelsId","in":"path","description":"Model ID or model resource name, e.g. `gemini-2.0-flash` (equivalently the trailing segment of `models/gemini-2.0-flash`) — the `models` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebasevertexai.googleapis.com/$discovery/rest?version=v1beta#projects.models.streamGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/models/{modelsId}:streamGenerateContent"},"summary":"Generate content with multimodal inputs with streaming support. (Streamgeneratecontent 2)","description":"Generate content with multimodal inputs with streaming support.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cachedContent":{"type":"string","description":"Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`"},"contents":{"type":"array","description":"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://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.","required":true,"items":{"type":"object","properties":{"parts":{"type":"array","description":"Ordered `Parts` that constitute a single message. Parts may have different MIME types."},"role":{"type":"string","description":"Optional. 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."}}}},"generationConfig":{"type":"object","description":"Configuration options for model generation and outputs. Not all parameters are configurable for every model.","properties":{"_responseJsonSchema":{"type":"any","description":"Optional. 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 be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. Deprecated. Use `response_format` instead."},"audioTranscriptionConfig":{"type":"object","description":"The audio transcription configuration."},"candidateCount":{"type":"number","description":"Optional. 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)"},"enableAffectiveDialog":{"type":"boolean","description":"Optional. If enabled, the model will detect emotions and adapt its responses accordingly."},"enableEnhancedCivicAnswers":{"type":"boolean","description":"Optional. Enables enhanced civic answers. It may not be available for all models."},"frequencyPenalty":{"type":"number","description":"Optional. 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 of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit."},"imageConfig":{"type":"object","description":"Config for image generation features."},"logprobs":{"type":"number","description":"Optional. 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]."},"maxOutputTokens":{"type":"number","description":"Optional. 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."},"mediaResolution":{"type":"string","description":"Optional. If specified, the media resolution specified will be used.","enum":["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]},"presencePenalty":{"type":"number","description":"Optional. 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 that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary."},"responseFormat":{"type":"object","description":"Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality."},"responseJsonSchema":{"type":"any","description":"Optional. An internal detail. Use `responseJsonSchema` rather than this field."},"responseLogprobs":{"type":"boolean","description":"Optional. If true, export the logprobs results in response."},"responseMimeType":{"type":"string","description":"Optional. 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 [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types."},"responseModalities":{"type":"array","description":"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 supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text."},"responseSchema":{"type":"object","description":"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)."},"seed":{"type":"number","description":"Optional. Seed used in decoding. If not set, the request uses a randomly generated seed."},"speechConfig":{"type":"object","description":"Config for speech generation and transcription."},"stopSequences":{"type":"array","description":"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."},"temperature":{"type":"number","description":"Optional. 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]."},"thinkingConfig":{"type":"object","description":"Config for thinking features."},"topK":{"type":"number","description":"Optional. 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 don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests."},"topP":{"type":"number","description":"Optional. 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 sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests."},"translationConfig":{"type":"object","description":"Config for translation features."}}},"model":{"type":"string","description":"Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.","required":true},"safetySettings":{"type":"array","description":"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. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY, HARM_CATEGORY_JAILBREAK are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.","items":{"type":"object","properties":{"category":{"type":"string","description":"Required. The category for this setting.","required":true,"enum":["HARM_CATEGORY_UNSPECIFIED","HARM_CATEGORY_DEROGATORY","HARM_CATEGORY_TOXICITY","HARM_CATEGORY_VIOLENCE","HARM_CATEGORY_SEXUAL","HARM_CATEGORY_MEDICAL","HARM_CATEGORY_DANGEROUS","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_CIVIC_INTEGRITY","HARM_CATEGORY_JAILBREAK"]},"threshold":{"type":"string","description":"Required. Controls the probability threshold at which harm is blocked.","required":true,"enum":["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"]}}}},"serviceTier":{"type":"string","description":"Optional. The service tier of the request.","enum":["unspecified","standard","flex","priority"]},"store":{"type":"boolean","description":"Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config."},"systemInstruction":{"type":"object","description":"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.","properties":{"parts":{"type":"array","description":"Ordered `Parts` that constitute a single message. Parts may have different MIME types."},"role":{"type":"string","description":"Optional. 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."}}},"toolConfig":{"type":"object","description":"The Tool configuration containing parameters for specifying `Tool` use in the request.","properties":{"functionCallingConfig":{"type":"object","description":"Configuration for specifying function calling behavior."},"includeServerSideToolInvocations":{"type":"boolean","description":"Optional. 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."},"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"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`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.","items":{"type":"object","properties":{"codeExecution":{"type":"object","description":"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."},"computerUse":{"type":"object","description":"Computer Use tool type."},"fileSearch":{"type":"object","description":"The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API."},"functionDeclarations":{"type":"array","description":"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 execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn."},"googleMaps":{"type":"object","description":"The GoogleMaps Tool that provides geospatial context for the user's query."},"googleSearch":{"type":"object","description":"GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."},"googleSearchRetrieval":{"type":"object","description":"Tool to retrieve public web data for grounding, powered by Google."},"mcpServers":{"type":"array","description":"Optional. MCP Servers to connect to."},"urlContext":{"type":"object","description":"Tool to support URL context retrieval."}}}}}},"example":{"cachedContent":"","contents":[],"generationConfig":{},"model":"","safetySettings":[],"serviceTier":"","store":"","systemInstruction":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/templates/{templatesId}/templateGenerateContent":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Name of the template to use in the request. projects/project-id/location/location-name/template/template-id Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.templates/templateGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/templates/{templatesId}:templateGenerateContent"},"summary":"Generate content with multimodal inputs using a server-side prompt template. (Templategeneratecontent 2)","description":"Generate content with multimodal inputs using a server-side prompt template.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"history":{"type":"array","description":"Optional. Conversation history for multi-turn prompts and function calling.","items":{"type":"object","properties":{"parts":{"type":"array","description":"List of consecutive messages from a given party."},"role":{"type":"string","description":"Optional. Indicates who generated these messages in the history. Generally this will be either 'user' or 'model'."}}}},"inputs":{"type":"object","description":"Optional. Client provided data that can be used when rendering the template. When calling via JSON/http surfaces this should be wire compatible with an arbitrary JSON object.","properties":{}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"Optional. A list of tools that the model may use to generate the response.","items":{"type":"object","properties":{"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"templateFunctions":{"type":"array","description":"Optional. A list of user-provided functions for function calling. For functions whose names are listed in the template frontmatter, the model may decide to call a subset of these functions by populating `FunctionCall` in the response. User should provide a `FunctionResponse` for each function call in the next turn."}}}}}},"example":{"history":[],"inputs":{},"toolConfig":{},"tools":[]}}}}}},"/v1beta/projects/{projectsId}/templates/{templatesId}/templateStreamGenerateContent":{"post":{"tags":["Templates"],"parameters":[{"name":"projectsId","in":"path","description":"Required. Name of the template to use in the request. projects/project-id/location/location-name/template/template-id Segment `projects` of the `name` resource path.","required":true,"schema":{"type":"string","example":""}},{"name":"templatesId","in":"path","description":"Prompt template ID — the `templates` segment of the resource path.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.templates/templateStreamGenerateContent","api_endpoint":"https://firebasevertexai.googleapis.com/v1beta/projects/{projectsId}/templates/{templatesId}:templateStreamGenerateContent"},"summary":"Generate content with multimodal inputs and streaming outputs using a server-side prompt template. (Templatestreamgeneratecontent 2)","description":"Generate content with multimodal inputs and streaming outputs using a server-side prompt template.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"history":{"type":"array","description":"Optional. Conversation history for multi-turn prompts and function calling.","items":{"type":"object","properties":{"parts":{"type":"array","description":"List of consecutive messages from a given party."},"role":{"type":"string","description":"Optional. Indicates who generated these messages in the history. Generally this will be either 'user' or 'model'."}}}},"inputs":{"type":"object","description":"Optional. Client provided data that can be used when rendering the template. When calling via JSON/http surfaces this should be wire compatible with an arbitrary JSON object.","properties":{}},"toolConfig":{"type":"object","description":"Tool config. This config is shared for all tools provided in the request.","properties":{"retrievalConfig":{"type":"object","description":"Retrieval config."}}},"tools":{"type":"array","description":"Optional. A list of tools that the model may use to generate the response.","items":{"type":"object","properties":{"googleMaps":{"type":"object","description":"Tool to retrieve public maps data for grounding, powered by Google."},"templateFunctions":{"type":"array","description":"Optional. A list of user-provided functions for function calling. For functions whose names are listed in the template frontmatter, the model may decide to call a subset of these functions by populating `FunctionCall` in the response. User should provide a `FunctionResponse` for each function call in the next turn."}}}}}},"example":{"history":[],"inputs":{},"toolConfig":{},"tools":[]}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}