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

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Google Gemini 3.1

> What to know when adopting Gemini 3.1, including reasoning controls, multimodal handling, and thought signatures.

# Google Gemini 3.1

Use this guide to adopt the Gemini 3.1 family safely in production:

* `google/gemini-3-pro-preview`
* `google/gemini-3-flash-preview`
* `google/gemini-3.1-pro-preview`
* `google/gemini-3.1-flash-lite-preview`

Gemini 3 introduced real API-level changes around reasoning control and multimodal handling. Gemini 3.1 then raised the baseline again, especially for more complex reasoning-heavy tasks.

## What's new

* Gemini 3 introduced `thinking_level` as the main control for reasoning depth
* Gemini 3 added `media_resolution` for multimodal vision handling
* Gemini 3 uses Thought Signatures to preserve reasoning context across calls
* in stricter workflows, missing Thought Signatures can produce degraded quality or `400` errors
* Gemini 3.1 Pro is positioned as the stronger reasoning upgrade for complex tasks and agentic workflows

## Migration quickstart

### 1. Re-map reasoning controls

If your app exposes a generic reasoning knob, map it carefully for Gemini 3 routes. In OpenAI-compatible flows, `reasoning_effort` maps conceptually to Gemini `thinking_level`, but the behavior is not one-to-one and needs retesting.

### 2. Handle Thought Signatures correctly

If you use the official Gemini SDKs and standard chat history, signatures are usually handled for you. If you build lower-level request flows, especially around function calling or image generation and editing, make sure the returned signatures are preserved and sent back exactly as required.

### 3. Revisit prompt style

Gemini 3 guidance favors more direct prompts and parameter-driven control rather than longer prompt scaffolding. If your current prompts are heavily compensating for older model behavior, simplify them and re-evaluate.

### 4. Tune multimodal settings

If your routes include images, documents, or mixed media, re-test `media_resolution` settings instead of assuming older defaults still fit.

## What to test

### Prompt and reasoning behavior

* concise prompts versus heavily scaffolded prompts
* step-by-step reasoning tasks
* long-context synthesis
* agent-style workflows that depend on maintaining reasoning continuity

### Response handling

* signature preservation across turns
* function-calling success rate
* schema pass rate
* empty, partial, or malformed outputs after changing thinking controls

### Production metrics

* latency at each `thinking_level`
* token usage and cost
* multimodal route performance under different `media_resolution` settings
* task success when comparing Gemini 3 versus Gemini 3.1 Pro

## Rollout advice

Treat Gemini 3 and Gemini 3.1 as separate migrations.

1. First migrate the request shape and signature handling.
2. Then re-run prompt and schema evaluations on Gemini 3.
3. Promote Gemini 3.1 Pro separately for the routes that need deeper reasoning.
4. Keep a simpler or cheaper fallback path for high-volume workloads.

## Sources

* [Gemini 3 developer guide](https://ai.google.dev/gemini-api/docs/gemini-3)
* [New Gemini API updates for Gemini 3](https://developers.googleblog.com/en/new-gemini-api-updates-for-gemini-3/)
* [Gemini 3.1 Pro announcement](https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-1-pro/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.