Back to Models
google logoGoogle
gemini-3.1-pro-preview

Gemini 3.1 Pro Preview

Gemini 3.1 Pro Preview is Google’s frontier reasoning model, delivering enhanced software engineering performance, improved agentic reliability, and more efficient token usage across complex workflows. Building on the multimodal foundation of the Gemini 3 series, it combines high-precision reasoning across text, image, video, audio, and code with a 1M-token context window. The 3.1 update introduces measurable gains in SWE benchmarks and real-world coding environments, along with stronger autonomous task execution in structured domains such as finance and spreadsheet-based workflows. Designed for advanced development and agentic systems, Gemini 3.1 Pro Preview improves long-horizon stability and tool orchestration while increasing token efficiency. It introduces a new medium thinking level to better balance cost, speed, and performance. The model excels in agentic coding, structured planning, multimodal analysis, and workflow automation, making it well-suited for autonomous agents, financial modeling, spreadsheet automation, and high-context enterprise tasks.

2/19/2026
1,048,576 tokens
Input: $2.11/M
Output: $12.66/M

Specifications

Modalities

Input
audio
file
image
text
video
Output
text

Supported Parameters

include_reasoning
max_tokens
reasoning
response_format
seed
stop
structured_outputs
temperature
tool_choice
tools
top_p

Max Output Tokens

65,536

Reasoning Configuration

Default
Thinking on (effort: medium)
Selectable effort levels
high
medium
low
Turning thinking off
Not possible (always thinks)

How to control thinking, and what it costs

Data policy

Prompt retention
Unknown — we could not confirm
Training
Unknown — not declared

"Unknown" does not mean "safe". It means we could not confirm it.

Whether a provider trains on prompts is a declared value from our terms with them. Retention is determined from the upstream listing for every host this model can reach. Neither is guessed.

Measured performance

Time to first response (p50)5.1s
Throughput (p50)710 tokens/s

    Measured through FastMetal's own gateway over the last 30 days (627 first-response samples).

    Throughput is sampled once a day: the median of 25 observations over the last 30 days.

    Time to first response is measured to the first streamed chunk; throughput counts all output tokens, including reasoning tokens. These are observations, not a performance guarantee.

    Code Examples

    curl https://api.fastmetal.ai/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "model": "gemini-3.1-pro-preview",
        "messages": [{"role": "user", "content": "Hello!"}]
      }'

    How Gemini 3.1 Pro Preview actually answers

    Real responses to our standard prompts, recorded on FastMetal.

    Count the number of 'r's in 'strawberry'

    Count the number of 'r's in 'strawberry'. Explain your reasoning step by step.

    There are **3** 'r's in the word 'strawberry'. Here is the step-by-step breakdown of the spelling: 1. **s** - not an 'r' 2. **t** - not an 'r' 3. **r** - **1st 'r'** 4. **a** - not an 'r' 5. **w** - not an 'r' 6. **b** - not an 'r' 7. **e** - not an 'r' 8. **r** - **2nd 'r'** 9. **r** - **3rd 'r'** 10. **y** - not an 'r' Therefore, the total count is 3.
    5.3s response503 output tokens

    Debug This Error

    I'm getting the following error in my Node.js application: TypeError: Cannot read properties of undefined (reading 'map') at UserList (/app/components/UserList.js:12:25) at renderWithHooks (/app/node_modules/rea…

    ### The Cause This error occurs because the `users` prop being passed to your `UserList` component is currently `undefined`. In JavaScript, you can only use the `.map()` method on arrays. Because `users` is `undefined` (often due to data not finishing an API fetch yet, or the parent component forgetting to pass the prop), Node/React throws an error when it tries to read `.map`. ### How to Fix It You can fix this in a few different ways, depending on how you want your application to behave. #### Fix 1: Assign a Default Value (Recommended) The cleanest way to handle this is to assign a default empty array to `users` in your component's parameters. If `users` is undefined, it defaults to…
    13.2s response1511 output tokens

    Code Review

    Please review the following Python function and suggest improvements for readability, performance, and best practices: def get_data(url, retries=3): import requests import time for i in range(retries):…

    Here is a review of your function. While the original code works, there are several areas where it can be improved regarding **best practices**, **readability**, and **performance**. ### 1. Refactored Code Here is the improved version of your function. I will explain the specific changes below. ```python import time import requests import logging from typing import Any # Optional: Set up a logger logger = logging.getLogger(__name__) def get_data(url: str, retries: int = 3, delay: int = 2, timeout: int = 10) -> list[dict[str, Any]]: """ Fetches JSON data from a URL and extracts active items. Args: url: The API endpoint to fetch data from. retries: Number o…
    23.6s response3094 output tokens

    Compare these answers side by side with other models →

    Frequently asked questions

    How much does the Gemini 3.1 Pro Preview API cost?
    On FastMetal, Gemini 3.1 Pro Preview is billed per token: $2.11 per 1M input tokens and $12.66 per 1M output tokens on a US-dollar account, before tax. Usage is drawn from a prepaid balance; there is no subscription or monthly fee.
    Can I call Gemini 3.1 Pro Preview with the OpenAI SDK?
    Yes. Point base_url at https://api.fastmetal.ai/v1 and pass "gemini-3.1-pro-preview" as the model; existing OpenAI-style code works unchanged, including streaming, tool calls and structured output.
    What is the context window of Gemini 3.1 Pro Preview?
    1,048,576 tokens, shared between the prompt and the response.
    What do I need to try Gemini 3.1 Pro Preview?
    Create an account and add credit; the model is then available both in the browser chat and over the API. There is no contract or minimum spend.

    Try Gemini 3.1 Pro Preview right now

    Gemini 3.1 Pro Preview is available on FastMetal through one API key. Start in the browser, or call it from the OpenAI SDK.