# Gemini 3.1 Pro Preview

Refined agentic intelligence for software engineering and structured data: Gemini 3.1 Pro Preview improves on Gemini 3 Pro with more efficient thinking, enhanced finance and spreadsheet reasoning, and tighter software engineering quality.

- **Model ID:** `google/gemini-3.1-pro-preview`
- **Type:** chat
- **Providers:** google, vertex
- **Context window:** 1,000,000
- **Maximum output tokens:** 64,000
- **Pricing:** $2/1M input tokens, $12/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/gemini-3.1-pro-preview

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'google/gemini-3.1-pro-preview',
  prompt: 'Why is the sky blue?'
})
```

## About

Gemini 3.1 Pro Preview is the updated flagship in the Gemini 3.1 family, building directly on Gemini 3 Pro with quality improvements targeted at real-world production domains. Software engineering and agentic workflows are the primary areas of improvement, alongside enhanced usability for finance and spreadsheet applications.

The model introduces more efficient thinking. At the pro tier, input tokens are a significant cost factor in long agentic sessions. Better reasoning efficiency means the model works through complex tasks without generating proportionally more tokens, directly reducing per-task operating cost compared to Gemini 3 Pro.

For teams building developer tooling, code review automation, or financial analysis pipelines, Gemini 3.1 Pro Preview is designed for the level of structured reasoning those applications require.

## What to consider

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

### Best For
- Automated code review, security vulnerability analysis, and test suite generation
- Agentic software engineering tasks requiring planning across multiple code changes
- Financial modeling, spreadsheet formula generation, and structured numerical analysis
- Pro-tier reasoning tasks where the efficient thinking improvement reduces per-task token cost
- Long agentic sessions where accumulated token consumption from reasoning steps is a cost concern

### Consider Alternatives When
- You need the initial Gemini 3 Pro capabilities without the 3.1 updates (consider `google/gemini-3-pro-preview`)
- Your primary need is speed and cost efficiency at high volume (consider `google/gemini-3-flash` or `google/gemini-3.1-flash-lite-preview`)
- The task involves native image generation alongside reasoning (consider `google/gemini-3-pro-image`)
- Flash-tier reasoning quality is sufficient for your use case (consider `google/gemini-3-flash`)

## 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

- **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`)

## Frequently asked questions

### What improvements does Gemini 3.1 Pro Preview have over Gemini 3 Pro?

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.

### Does more efficient thinking mean lower quality outputs?

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.

### What thinking level does this model support?

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

### Is this model suitable for automated code review?

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.

### How do I set the thinking level in the AI SDK?

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

### Does Gemini 3.1 Pro Preview require its own Google API account?

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

### What makes this model well-suited for finance and spreadsheet tasks?

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.

### When should I use Gemini 3.1 Pro versus Gemini 3.1 Flash for engineering tasks?

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.

## Links

- [Model page](https://vercel.com/ai-gateway/models/gemini-3.1-pro-preview)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://ai.google.dev/gemini-api/docs/models)
- [Provider pricing](https://ai.google.dev/pricing)
