Gemini 3.1 Pro Preview Chat API

google/gemini-3.1-pro-preview
1M tokens · 160 input / 960 output credits / 1M tokens

Gemini 3.1 Pro Preview Chat turns text and multimodal context into detailed analysis, code, and answers for complex tasks, with a 1M-token context window and adjustable reasoning depth. Provide the task, source material, and success criteria so each response stays grounded in the evidence.

Gemini 3.1 Pro Preview

Google · chat-completions

Chat with Gemini 3.1 Pro Preview

Each model has its own conversation. Switching never sends another model's history, and switching back resumes where you left off. Requests are billed from actual token usage.

Ctrl / ⌘ + Enter to send0 / 32,000

Continue with

Gemini 3.1 Pro Preview Chat

Gemini 3.1 Pro Preview is Google's Gemini 3 model for complex reasoning, coding, and multimodal analysis. Its 1M-token context window holds related files, documents, and conversation turns while adjustable thinking depth helps match reasoning to the task. Vidgo offers Chat Completions and Gemini Native requests with complete JSON or SSE responses.

Why Choose Gemini 3.1 Pro Preview?

  • Complex reasoningWork through connected constraints and evidence to produce a detailed answer.

  • Agentic codingUse requirements, source files, and tool results to plan and review multi-step code work.

  • Long-context analysisExamine related reports or code files together in a 1M-token context window.

  • Multimodal understandingConnect text with images and other media when analyzing a task.

Parameters

ParameterRequirementDescription
modelChat Completions required

Use google/gemini-3.1-pro-preview.

messagesChat Completions required

A non-empty array of conversation messages.

contentsGemini Native required

A non-empty array of turns with role and parts; the model ID is in the URL.

contents[].parts[].inlineDataGemini Native optional

Inline media with mimeType and Base64 data alongside text parts.

generationConfigGemini Native optional

Set temperature, topP, topK, maxOutputTokens, or stopSequences for the response.

safetySettingsGemini Native optional

Safety settings for the request.

streamChat Completions optional

Set true for an SSE response.

Defaultfalsetrue

How to Use

  1. Define the problemState the requested conclusion, deliverable, and acceptance criteria.

  2. Supply relevant evidenceInclude source text, code, documents, or media needed to reason through the task.

  3. Choose the API formatSend messages through Chat Completions or contents through Gemini Native.

  4. Review the resultInspect the answer and token usage, then give a follow-up instruction or additional evidence.

Pricing

Input and output tokens are billed separately. Rates apply per 1M tokens.

UsageRateDetails
Input$0.80 · 160 credits / 1M tokensRequest input tokens.
Output$4.80 · 960 credits / 1M tokensGenerated output tokens, including reasoning tokens recorded in usage.

Best Use Cases

  • Multi-step codingPlan and review code changes against requirements and test results.

  • Research synthesisCompare long reports and trace conclusions back to supplied evidence.

  • Multimodal analysisCombine visual material with text questions for focused interpretation.

Pro Tips

  • Give the target outcome, constraints, and source material in the same request.
  • Ask for conclusions tied to specific passages or files when reviewing long context.
  • Check usageMetadata or Chat Completions usage when estimating a run's token cost.

Usage Notes

  • The context window is 1M tokens.
  • The on-page Playground offers a 256–8,192-token output control.
  • Use google/gemini-3.1-pro-preview in Chat Completions or in the Gemini Native model URL.

Related Models

Gemini 3.1 Pro Preview Chat API frequently asked questions

What is the Gemini 3.1 Pro Preview Chat API?

Gemini 3.1 Pro Preview is Google's Gemini 3 model for complex reasoning, coding, and multimodal analysis. It turns text and media context into detailed answers, code, and structured findings with a 1M-token context window. Set reasoning depth for the task, call the model through Chat Completions or Gemini Native, or try it in the playground above.

How can Gemini 3.1 Pro Preview help with coding?

Send the goal, relevant source files, constraints, and test results. Ask the model to connect the evidence, plan the change, and review the result against the requirements.

How much context can Gemini 3.1 Pro Preview analyze?

It has a 1M-token context window. Group the documents, code, and conversation history needed to answer one focused question.

How do I send multimodal input to Gemini 3.1 Pro Preview?

Use Gemini Native contents with text and inlineData parts. Include mimeType and Base64 data for inline media, then state the details to analyze in text.

How do I stream Gemini 3.1 Pro Preview responses?

Set stream to true in Chat Completions, or call streamGenerateContent?alt=sse through Gemini Native. Read the SSE events in order and inspect usageMetadata for token counts.

What does Gemini 3.1 Pro Preview cost on Vidgo AI?

Input costs 160 credits ($0.80) and output costs 960 credits ($4.80) per 1M tokens. Check response usage and the Pricing table above for the rate applied to each token direction.