Text
Gemini 3.1 Pro
Native Gemini requests, multimodal inputs, thinking, tools, caching and streaming. Includes model limits and verification status.
Use gemini-3.1-pro-preview with the native Gemini format. The model page includes the Playground and current prices; the model variant guide explains the two official IDs.
Model ID
| Model ID | Input limit | Default effort |
|---|---|---|
gemini-3.1-pro-preview | 1,048,576 tokens | high |
Quick example
curl https://api.seedrouter.ai/v1beta/models/gemini-3.1-pro-preview:generateContent \
-H "Authorization: Bearer $SEEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Explain a mutex in one sentence."}]}],"generationConfig":{"thinkingConfig":{"thinkingLevel":"low"},"maxOutputTokens":1024}}'The model belongs in the URL. contents is required. An answer includes native candidates, finishReason and usageMetadata; retain complete content parts, including thoughtSignature, for conversation history.
Endpoints
| Operation | Endpoint |
|---|---|
| JSON response | POST /v1beta/models/gemini-3.1-pro-preview:generateContent |
| Server-sent events | POST /v1beta/models/gemini-3.1-pro-preview:streamGenerateContent?alt=sse |
The OpenAPI specification includes every nested request and response schema. Optional fields use API defaults when omitted. SeedRouter forwards the submitted body without filtering unknown fields, removing unsupported fields or validating model parameter values. The Gemini API decides whether a request is accepted.
Request parameters
The URL fixes the model to gemini-3.1-pro-preview. The request contract contains 12 top-level fields. Fields are optional unless marked required; omission differs from JSON null. Nullable arbitrary JSON is preserved where the official schema permits it.
| Field | Type | Required | Default and constraints |
|---|---|---|---|
contents | object[] | Yes | Nonempty conversation; each content has nonempty parts |
systemInstruction | object | No | Text-only parts; no automatic user identity is inserted |
generationConfig | object | No | Generation parameters in the next table |
tools | object[] | No | Function declarations and built-in tool configurations |
toolConfig | object | No | Function selection and retrieval configuration |
safetySettings | object[] | No | One setting per category; no duplicate categories |
cachedContent | string | No | Existing cachedContents/{id} resource; requires compatible access |
serviceTier | string | No | unspecified, standard, flex, priority; ordinary processing is standard |
labels | object | No | String values; lowercase keys/values, maximum 63 Unicode codepoints each |
model | string | No | Optional resource name; the URL determines the actual model |
store | boolean | No | Generic request storage preference; model-specific effect unverified |
continuationToken | string | No | Generic opaque token; continuation is not an established 3.1 Pro capability |
Generation parameters
Field in generationConfig | Type | Default and constraints |
|---|---|---|
maxOutputTokens | integer | 1–65,536, including thinking; model default 65,536 |
thinkingConfig | object | thinkingLevel: low, medium, high (default high); uppercase spellings accepted. includeThoughts: boolean, default false. thinkingBudget: integer, mutually exclusive with thinkingLevel; no model-specific numeric range is established |
temperature | number | 0–2; Google recommends the default 1.0 |
topP | number | 0–1; omit to use the model default |
topK | integer | Optional; model-specific configurable range not established |
candidateCount | integer | Exactly 1 |
stopSequences | string[] | Maximum five sequences |
responseMimeType | string | Default text/plain; legacy JSON schema output requires application/json |
responseSchema | object | Official schema dialect; mutually exclusive with responseJsonSchema |
responseJsonSchema | JSON | JSON Schema; mutually exclusive with responseSchema |
responseFormat | object | Text format configuration; text.mimeType and optional text.schema. Schema requires JSON MIME type |
responseModalities | string[] | Text only: TEXT; empty means text |
mediaResolution | enum | MEDIA_RESOLUTION_UNSPECIFIED, LOW, MEDIUM, HIGH with the MEDIA_RESOLUTION_ prefix |
seed | integer | Signed 32-bit value; model-specific deterministic behavior unverified |
presencePenalty | number | Generic field; model-specific effect/range unverified |
frequencyPenalty | number | Generic field; model-specific effect/range unverified |
responseLogprobs | boolean | Generic field; model-specific availability unverified |
logprobs | integer | 0–20; requires responseLogprobs: true; model support unverified |
enableEnhancedCivicAnswers | boolean | Generic field; model support unverified |
enableAffectiveDialog | boolean | Generic field; model support unverified |
audioTranscriptionConfig | object | Generic field; model-specific options unverified |
translationConfig | object | Generic field; model-specific options unverified |
The OpenAPI document lists nested types, enums, required properties and documented bounds for every message. The schemas describe official parameters; they are not a SeedRouter request allowlist. Caller-supplied fields and values are preserved. A field accepted by the schema is not proof of support for every model or account. minimal thinking and Agentic Video processing are not supported by this model.
Structured output
{
"contents": [{"parts": [{"text": "Return a JSON object with ok set to true."}]}],
"generationConfig": {
"thinkingConfig": {"thinkingLevel": "low"},
"maxOutputTokens": 1024,
"responseMimeType": "application/json",
"responseJsonSchema": {
"type": "object",
"properties": {"ok": {"type": "boolean"}},
"required": ["ok"]
}
}
}The legacy responseSchema and responseJsonSchema fields cannot be used together. Both require responseMimeType: "application/json". The newer responseFormat.text schema must likewise specify JSON. Use REST enum spellings (APPLICATION_JSON and TEXT_PLAIN) in that message. Requests pass through unchanged; media MIME types and arbitrary function JSON are not rewritten.
Functions and built-in tools
Use tools[].functionDeclarations with a name and either parameters or parametersJsonSchema, not both. Response schemas follow the same mutual-exclusion rule. Function selection lives in toolConfig.functionCallingConfig; allowedFunctionNames requires ANY or VALIDATED and declared names.
The regular model supports function calling; the customtools variant is not required. Your application executes returned functions and supplies their results in the next conversation turn. Preserve each original thoughtSignature, function call and function response. Do not round numeric identifiers when serializing opaque function arguments.
Google lists Search, Maps, code execution and URL context as model capabilities. File Search is listed for AI Studio only. Existing cache and file-search resources require access under the credentials serving the request. Computer Use and native MCP configuration appear in the generic schema but their availability for this model is not established. The Playground does not execute your custom functions.
Multimodal input and safety
A contents[].parts[] item contains exactly one payload: text, inline media, a file reference, a function call/response, or an execution part. It may also carry a signature or media metadata. Input supports text, images, audio, video and PDFs; output is text only.
For inline bytes, use inlineData.mimeType and base64 data. For file references, use fileData.mimeType and fileUri. A syntactically valid URL is not proof the model can retrieve it. Video metadata can specify start/end offsets and a positive fps no greater than 24. Global and per-part media resolutions are distinct settings. Agentic Video is not supported.
Use native JSON for inline media, or an accessible file reference for larger media. Exact file-format, duration and per-request media limits remain subject to the official media documentation and live verification.
Safety settings use the official native format. Omission leaves the Gemini API defaults in effect; explicitly supplied settings pass through unchanged.
JSON responses and streaming
generateContent returns native JSON. streamGenerateContent?alt=sse emits native JSON in SSE data: events. Important fields include candidates[].content.parts, finishReason, safetyRatings, groundingMetadata, promptFeedback, modelVersion, responseId and usageMetadata.
Retain complete native content in conversation history. Thinking summaries are not the same as thought signatures. A disconnect does not prove generation failed or completed; inspect the partial result and account record before sending another request. Stream usage is cumulative, so use the latest counters instead of summing every chunk.
Unlike Argon, longer-output continuation has not been established for 3.1 Pro. Do not build a continuation loop merely because the generic response schema includes a token field.
Usage and pricing
promptTokenCount includes cached input. cachedContentTokenCount is charged at the cached-input rate, rather than charged again as uncached input. Billable output includes candidatesTokenCount plus thoughtsTokenCount. Reported tool-use prompt tokens also contribute to input.
The context threshold is 200,000 input tokens, including cached input; larger inputs use the long-context rates. Available account groups use the same model price expression and their own current multiplier. See the live pricing table.
Flex and Priority are separate processing tiers. Flex does not halve cached-input rates. A reported Standard result must not incur a Priority surcharge. If a requested Priority response does not establish its actual tier, this integration uses Standard token rates. Tool charges and explicit cache storage are separate from generation-token pricing; no shared free tool allowance is promised. Failed requests are not charged.
Multiple account groups
The model uses googlellm and googlellm-vertext, retaining their existing account permissions and pricing. The spelling of each group name is exact. Select an available group in the Playground, or use the optional API header:
X-SeedRouter-Group: googlellmUse googlellm-vertext to select the second group. The chosen group determines the price and available capacity; an explicit selection does not silently switch to another group. Omit the header or use auto to keep the API key's default behavior.
Check your API key's available groups without generating a response:
curl "https://api.seedrouter.ai/api/seedrouter/llm/groups?model=gemini-3.1-pro-preview" -H "Authorization: Bearer YOUR_SEEDROUTER_KEY"Verification status
The controls and documentation follow the official native format. Parameter validation belongs to the Gemini API. Offline transport and billing checks do not establish production availability. Live generation, both account groups, media understanding, cached resources, built-in tools and processing tiers still require paid end-to-end verification. No comparative quality result is claimed for the Customtools variant.
