Skip to content
Pricing
Google

Gemini 3.1 Pro Preview API

Use Gemini 3.1 Pro Preview for complex reasoning and multimodal understanding. Check this preview model’s live price and configured route limits before integrating.

MODALITIES
TextText
Available
INPUT / OUTPUT80% OFF
$0.4/ 1M
/
$2.4/ 1M
USD per million tokens
CACHED INPUT
$0.04/ 1M
Platform price · USD
CONTEXT WINDOW
128,000tokens
Max output: 16,384 tokens

API Usage Examples

API documentation ↗
POSTGet API Key ↗
curl 'https://newrouters.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $MODEL_API_KEY" \
  --data '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Explain how an HTTP request works in three concise steps."
        }
      ]
    }
  ],
  "generationConfig": {
    "maxOutputTokens": 1024
  }
}'

Set MODEL_API_KEY in your server environment. Requests use this model’s native API and your account pricing.

Docs: authentication and keys · Error handling

Gemini 3.1 Pro Preview pricing

Estimate one request, then choose a budget for your workflow.

UsageQuantityRateCost
tokens$0.4/ 1M$0.0004
tokens$0.04/ 1M$0
tokens$2.4/ 1M$0.0012
tokens$2.4/ 1M$0
Cost per request$0.0016

Public USD estimate. Your account rate and final recorded usage determine the actual charge.

Model pricing details
SpecificationOur priceOfficial reference
Input$0.4 / 1M tokens$2 About 80% less than official
Cached input$0.04 / 1M tokens$0.2 About 80% less than official
Output$2.4 / 1M tokens$12 About 80% less than official
Reasoning$2.4 / 1M tokens$12 About 80% less than official

Gemini 3.1 Pro Preview API · Examples

Start with a clear task. Copy these example prompts into your own API requests.

EXPLAIN & ANSWER

Explain HTTP requests and responses to a programming beginner, using three steps and one simple example.

USER MESSAGE
01

Make complex ideas clear

Define the reader, response length and structure to keep an answer focused on the question.

CODE & BUILD

Write a TypeScript async retry function with exponential backoff. Explain which errors should be retried and include a usage example.

USER MESSAGE
02

Turn a brief into code

Specify the language, inputs, outputs and constraints, then request code and an explanation together.

ORGANIZE & PLAN

Create a two-week product prototype plan for a team of three. List goals, deliverables and open questions for each day.

USER MESSAGE
03

Give information a structure

Provide context and practical constraints to organize material into a structure you can work with.

What Is Gemini 3.1 Pro Preview?

Use Gemini 3.1 Pro Preview for complex reasoning and multimodal understanding. Check this preview model’s live price and configured route limits before integrating.

Use the model ID below with the supported native endpoint. System instructions define the task and response style; messages provide the context for each request. Check the available capabilities and token limits when integrating the model into your application.

Gemini 3.1 Pro Preview Specifications

SpecificationGemini 3.1 Pro Preview
Model IDgemini-3.1-pro-preview
ProviderGoogle
API/v1beta/models/{model}:generateContent · /v1beta/models/{model}:streamGenerateContent · /v1/interactions · /v1beta/interactions
Context window128,000 tokens
Maximum output16,384 tokens
Declared capabilitiesTools · Streaming
Protocol & capability details

Protocol & capabilities

gemini · gemini-3.1-pro-preview

Context limit
128000
Maximum output
16384

tools · stream

Compare Gemini 3.1 Pro Preview with related models

SpecificationGemini 3.1 Pro PreviewGemini 3.7 FlashGemini 3.8 Flash
ProviderGoogleGoogleGoogle
Input → outputTextTextTextTextTextText
Selection basisCurrent modelSame gemini protocol · Same billing unitsSame gemini protocol · Same billing units
Context / max output128,000 / 16,384128,000 / 16,384128,000 / 16,384
Starting price$0.4 / 1M tokens$0.15 / 1M tokens$0.15 / 1M tokens

Choose by the input types, output settings and billing unit your workflow needs. Try the same prompt across models to compare results for your own use case.

Integrate Gemini 3.1 Pro Preview into your app

Keep the native request format and point your application to the platform API. Prepare a key with model access, then review status and charges in your usage records.

View API examples

Gemini 3.1 Pro Preview API · Common Questions

Everything you need to know about API access, pricing and model capabilities.

How is Gemini 3.1 Pro Preview billed?

Charges depend on the recorded token usage and your account rates. Input, output and supported cache or reasoning categories are listed separately in the pricing table. The calculator uses public USD prices; the final usage receipt determines the charge.

How do I get an API key?

Choose “Get API access” to open the integration guide. Sign in to your NewRouters account, prepare a key with access to this model and copy an API example.

Which API endpoints can I use?

Supported endpoints: /v1beta/models/{model}:generateContent、/v1beta/models/{model}:streamGenerateContent、/v1/interactions、/v1beta/interactions. Choose an endpoint in the API examples to see its native request format.

Does the model support streaming?

The current model route declares streaming support. Use the native endpoint’s streaming option and consume its events. Usage already completed may still be billed if the connection is interrupted.

Can I use tools or structured output?

Tools: supported. Structured output: not declared. Request fields follow the selected native endpoint.

Where can I check usage and charges?

Keep the request ID and open your account’s LLM usage records to inspect request status, token counts and charges. Prompt and answer content are not a conversation history in this view.

Explore LLM Use Cases

All LLM models ↗

Integration topics / Documentation

All documentation ↗