Skip to content
Vercel April 2026 security incident

Gemini 3.1 Pro Preview

google/gemini-3.1-pro-preview

Gemini 3.1 Pro Preview advances software engineering and agentic workflows with targeted quality improvements for finance and spreadsheet applications, plus more efficient thinking that reduces token consumption while maintaining performance.

File InputTool UseReasoningVision (Image)Web Searchtiered-costImplicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'google/gemini-3.1-pro-preview',
prompt: 'Why is the sky blue?'
})

What To Consider When Choosing a Provider

  • Zero Data Retention

    AI Gateway supports Zero Data Retention for this model via direct gateway requests (BYOK is not included). To configure this, check the documentation.

    Authentication

    AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.

This model supports the medium thinking level via thinking_level in providerOptions.google, giving you control over the cost, performance, and speed tradeoff.

When to Use Gemini 3.1 Pro Preview

Best For

  • Automated code review:

    Security vulnerability analysis and test suite generation

  • Agentic software engineering:

    Tasks requiring planning across multiple code changes

  • Financial and spreadsheet analysis:

    Modeling, formula generation, and structured numerical work

  • Pro-tier reasoning tasks:

    The efficient thinking improvement reduces per-task token cost

  • Long agentic sessions:

    Accumulated token consumption from reasoning steps is a cost concern

Consider Alternatives When

  • Initial Gemini 3 Pro baseline:

    You need capabilities without the 3.1 updates (consider google/gemini-3-pro-preview)

  • Speed and cost at volume:

    Your primary need is efficiency at high throughput (consider google/gemini-3-flash or google/gemini-3.1-flash-lite-preview)

  • Image generation alongside reasoning:

    Your task requires native image output (consider google/gemini-3-pro-image)

  • Flash-tier reasoning is enough:

    Pro-tier capability is not required (consider google/gemini-3-flash)

Conclusion

Gemini 3.1 Pro Preview addresses the most common reasons teams hit limits with Gemini 3 Pro: token-heavy reasoning sessions in agentic workflows, and the need for more reliable performance in finance and structured data applications. The efficiency improvements in thinking make extended pro-tier reasoning more economically viable for sustained production deployments.

FAQ

Three areas: quality improvements for software engineering and agentic workflows, enhanced usability for finance and spreadsheet applications, and more efficient thinking that reduces token consumption while maintaining performance.

No. Performance stays the same while token consumption decreases. The model uses fewer tokens to reason through a problem without degrading output quality, which reduces cost per task.

medium thinking level, configured via thinking_level in providerOptions.google. This provides finer control over the cost, performance, and speed tradeoff.

Yes. Software engineering quality improvements are a primary focus of the 3.1 update, making it well suited for code review, security analysis, and test generation.

Under providerOptions.google in your streamText or generateText call, set thinking_level to low, medium, or high.

No. AI Gateway manages all provider credentials. You connect using a Vercel API key or OIDC token.

Gemini 3.1 Pro specifically improves on finance and spreadsheet usability. These tasks involve structured numerical analysis, formula generation, and multi-step calculation that benefit from pro-tier reasoning.

For complex multi-step engineering tasks where correctness of the reasoning chain matters, security audits, architectural planning, test generation, the Pro tier provides more thorough reasoning. For high-volume, more repetitive engineering tasks like code completion or linting at scale, Flash-tier models offer a better cost-to-quality ratio.