Skip to content
Dashboard

Gemini 3.1 Pro is live on AI Gateway

Gemini 3.1 Pro Preview from Google is now available on AI Gateway.

This model release brings quality improvements across software engineering and agentic workflows, with enhanced usability for real-world tasks in finance and spreadsheet applications. Gemini 3.1 Pro Preview introduces more efficient thinking across use cases, reducing token consumption while maintaining performance.

To use this model, set model to google/gemini-3.1-pro-preview in the AI SDK. This model supports the medium thinking level for finer control over the trade-offs between cost, performance, and speed.

import { streamText } from 'ai';
const result = streamText({
model: 'google/gemini-3.1-pro-preview',
prompt:
`Review this pull request for security vulnerabilities,
suggest fixes, and update the test suite to cover edge cases.`,
providerOptions: {
google: {
thinking_level: 'medium',
},
},
});

AI Gateway provides a unified API for calling models, tracking usage and cost, and configuring retries, failover, and performance optimizations for higher-than-provider uptime. It includes built-in observability, Bring Your Own Key support, and intelligent provider routing with automatic retries.

Learn more about AI Gateway, view the AI Gateway model leaderboard or try it in our model playground.

Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

  • Agent stack: Build and operate agents with models, tools, and durable workflows.
  • Web applications: Choose rendering, data, authentication, and caching approaches.
  • Backends: Choose a runtime, connect services, and run background work.

Browse all stacks

Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.