Skip to main content
API Reference for vertexai/gemini-3.1-flash-lite, served by Comfy Router from Google.

Quick start

Create a key at platform.comfy.org/profile/api-keys and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: vertexai/gemini-3.1-flash-lite Endpoint: POST https://api.comfy.org/v2/models/vertexai/gemini-3.1-flash-lite

Schema

Input

Router has not published an authored input schema for this model yet: GET /v2/models/vertexai/gemini-3.1-flash-lite/openapi.json returns an open object with x-comfy-input-schema-authored: false. Router forwards the body to Google unchanged, so Google’s own API reference is authoritative for the request fields, and nothing is validated server side.

Output

object[]
object
object[]
string[]
integer
string
string (date)
Format: date
integer
string
string
object
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 and the latest request.
object[]
required
object
URI based data.
string
URI
string
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values: application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv
object
Inline data in raw bytes. For gemini-2.0-flash-lite and gemini-2.0-flash, you can specify up to 3000 images by using inlineData.
string (byte)
The base64 encoding of the image, PDF, or video to include inline in the prompt. When including media inline, you must also specify the media type (mimeType) of the data. Size limit: 20MBFormat: byte
string
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values: application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv
string
A text prompt or code snippet.
boolean
Indicates this part is a thinking/reasoning step from the model.
string
required
Possible values: user, model
string
object[]
string
Possible values: HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_DANGEROUS_CONTENT
string
The probability that the content violates the specified safety categoryPossible values: NEGLIGIBLE, LOW, MEDIUM, HIGH, UNKNOWN
string
Timestamp when the response was created.
string
The model version used to generate the response.
object
string
string
object[]
string
Possible values: HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_DANGEROUS_CONTENT
string
The probability that the content violates the specified safety categoryPossible values: NEGLIGIBLE, LOW, MEDIUM, HIGH, UNKNOWN
string
Unique identifier for the response.
object
integer
Output only. Number of tokens in the cached part in the input (the cached content).
integer
Number of tokens in the response(s).
object[]
Breakdown of candidate tokens by modality.
string
Type of input or output content modality.Possible values: MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENT
integer
Number of tokens for the given modality.
integer
Number of tokens in the request. When cachedContent is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
object[]
Breakdown of prompt tokens by modality.
string
Type of input or output content modality.Possible values: MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENT
integer
Number of tokens for the given modality.
integer
Number of tokens present in thoughts output.
integer
Number of tokens present in tool-use prompt(s).
integer
Total number of tokens (prompt + candidates).
string
Traffic type used for the request (e.g., PROVISIONED_THROUGHPUT).

Examples

Output

Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the Comfy Router headers page: send an Idempotency-Key on every paid call and reuse it when you retry, expect the connection to be held up to Router’s 10 minute deadline, and keep X-Comfy-Request-Id from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, X-Comfy-Error-Type names the bucket, and a 422 means the body failed the model’s schema and was never billed.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Quick Start

Typed error handling in Python and TypeScript, reading the 422, walking the catalog.

Limitations

What Router does not do today, and what to use instead.