> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kymaapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 3.1 Pro

> The first Gemini Pro tier on Kyma. Every other Gemini here is a Flash or a Flash Lite; this is the step above them, for work those tiers cannot carry. It is a preview model upstream, and it is priced above the Flash family.

## Overview

Gemini 3.1 Pro is Google's Pro-tier reasoning model. It takes a 1M-token context, emits up to 65,536 tokens in one response, and accepts text, image, audio, video and file input, returning text. Tool calling, reasoning and structured outputs are all supported.

The rate steps up above 200,000 prompt tokens: input and output both roughly double past that threshold. Kyma publishes the base rate on the model and pricing pages and the step alongside it, so a request that will cross 200K can be costed before it is sent.

Google labels this release a preview. Behaviour may change before a stable build, so test before locking it into a critical path. On Kyma it serves through an OpenAI-compatible endpoint with automatic failover to a second independent route. Prompt caching is supported and repeated prefixes bill at this model's cached input rate. Every response carries the exact request cost in usage.cost and names the model that answered in the X-Kyma-Model header.

## Specs

| Field              | Value                                                                |
| ------------------ | -------------------------------------------------------------------- |
| Model ID           | `gemini-3.1-pro`                                                     |
| Best for           | Hard reasoning and long-horizon agentic work that Flash cannot carry |
| Context window     | 1.048576M                                                            |
| Max output tokens  | 66K                                                                  |
| Input modalities   | Text, Image, Audio, Video, File                                      |
| Output modalities  | Text                                                                 |
| Tool calling       | Yes                                                                  |
| Structured outputs | Yes                                                                  |
| Prompt caching     | Yes                                                                  |
| Speed              | Medium                                                               |
| Cost band          | Premium                                                              |
| Release stage      | Preview                                                              |

## Pricing

|        | Per 1M tokens |
| ------ | :-----------: |
| Input  |     \$2.70    |
| Output |    \$16.20    |

Above a long prompt this model costs more per token, because the infrastructure
serving it charges more there. The threshold is on the **prompt**, so you know which
rate applies before you send.

| Prompt length        |  Input |  Output |
| -------------------- | :----: | :-----: |
| Standard             | \$2.70 | \$16.20 |
| Above 200,000 tokens | \$5.40 | \$24.30 |

## Use this when

* **Reasoning past the Flash ceiling** — Problems where a Flash-tier answer is not good enough and the extra cost per token is worth paying.
* **Long-horizon agentic work** — Tool calling and reasoning across a 1M-token context, with a 64K output ceiling for long plans and long edits.
* **Whole-repository and whole-corpus analysis** — Reads very large inputs in one request; budget for the higher rate that applies above 200K prompt tokens.
* **Mixed-media analysis** — Accepts text, image, audio, video and file input in a single request and returns a long written result.

## Not ideal for

Do not reach for this on high-volume or short-answer work. It lists well above the Gemini Flash tiers, and for prompts a Flash model already answers correctly the extra cost buys nothing. It is also a preview build, so it is the wrong choice where behaviour must not shift.

## Pick something else when

* You want the newest Flash tier at a fraction of the rate: use [`gemini-3.7-flash`](/models/gemini-3.7-flash).
* You need the cheapest 1M-context tier: use [`gemini-3.5-flash-lite`](/models/gemini-3.5-flash-lite).
* You need a stable, non-preview frontier tier: use [`claude-opus-5`](/models/claude-opus-5) or [`gpt-5.6-terra`](/models/gpt-5.6-terra).

## Example

```python theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://kymaapi.com/v1", api_key="ky-...")

response = client.chat.completions.create(
    model="gemini-3.1-pro",
    messages=[{"role": "user", "content": "..."}],
    tools=[...],  # function calling supported
)
```

## Agent query example

Ask the API which models fit, instead of hardcoding an id:

```bash theme={null}
curl "https://kymaapi.com/v1/models?recommended_for=write-code&tools=true&quality_tier=frontier-open"
```

## FAQ

**How is this different from the Gemini Flash models on Kyma?**

It is the Pro tier rather than the Flash tier — Google's step up for harder reasoning — and it is priced accordingly, well above every Gemini Flash model in the catalogue. It also emits up to 65,536 tokens per response and accepts file input alongside text, image, audio and video.

**What happens to the price above 200K prompt tokens?**

Both the input and the output rate step up above 200,000 prompt tokens. Kyma publishes the base rate and the step; the higher rate applies to the whole request once the prompt crosses the threshold.

**Is this a stable release?**

No. Google ships it as a preview, so weights and behaviour may change before a stable build. Test before depending on it in a critical workflow.

**Does prompt caching work on this model?**

Yes. Repeated prompt prefixes bill at this model's cached input rate, and the saving is reported per request in usage.cache\_discount.
