# Gemini 3.1 Pro API

> Gemini 3.1 Pro — frontier reasoning and generation through one API.

- **Provider**: Google
- **Model id**: `gemini-3-1-pro`
- **Modality**: text
- **Price**: 97.45–622.15 credits

## Overview

Gemini 3.1 Pro is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `gemini-3-1-pro` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | Text value (default: Explain how honeybees tell the hive where flowers are, using one clear everyday analogy anyone can picture.) |
| memory | boolean | No | Automatically append previous messages to maintain multi-turn context. May increase token usage. (true/false) (default: false) |
| google_search | boolean | No | Use Google Search (true/false) (default: true) |
| thinking | boolean | No | Include the model's thinking process in the response (true/false) (default: true) |
| reasoning_effort | string | No | Control reasoning depth: Low for faster responses, High for deeper analysis (options: Low | High) (default: High) |
| system | string | No | System instruction for the model. Defaults to "You are Gemini 3.1 Pro, developed by Google." when omitted. |

### Request example

```json
{
  "modelId": "gemini-3-1-pro",
  "input": {
    "prompt": "Explain how diffusion models generate images, in two short sentences.",
    "memory": false,
    "google_search": true,
    "thinking": true,
    "reasoning_effort": "High"
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 24
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=gemini-3-1-pro`

When `state` is `success`, the output is in `resultUrls`: `{ "text": "…" }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, check API Key |
| 402 | Insufficient account balance |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
