# Nano Banana 2 — Orthogonal API

> Pay-per-use API on Orthogonal. Each call is billed to your Orthogonal balance.
> Base API: `https://api.orth.sh/v1/run` · [llms.txt](https://orthogonal.com/llms.txt) · [browse all APIs](https://orthogonal.com/discover)

Generate and edit images using Google Gemini 3.1 Flash Image (Nano Banana 2). Combines Pro-level quality with Flash speed. Advanced world knowledge, subject consistency, precise text rendering, and rapid iteration.

**Verified:** no

## Access

**Run API:** `POST https://api.orth.sh/v1/run`
**Auth:** `Authorization: Bearer $ORTHOGONAL_API_KEY`
Get an API key at https://orthogonal.com/dashboard/settings/api-keys

Every call goes through the unified Run API: send the API `slug`, the endpoint `path`, and the `query`/`body` parameters. The response is `{ "success": true, "price": "<usd>", "data": { ... } }`.

## Endpoints

### Generate Image

Generate images with Nano Banana 2 (Gemini 3.1 Flash Image). Pro-quality at Flash speed. Supports text-to-image, image editing, multi-image composition (up to 5 characters, 14 objects). Subject consistency, precise text rendering, and translation.

`POST /v1beta/models/gemini-3.1-flash-image-preview:generateContent`

**Estimated cost:** $0.05

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `contents` | array | Yes | Array with one object containing parts. Example: [{"parts": [{"text": "A cute cat wearing a hat"}]}]. For editing, add inlineData: [{"parts": [{"text": "Add a hat"}, {"inlineData": {"mimeType": "image/jpeg", "data": "base64..."}}]}] |
| `generationConfig` | object | No | Config options: responseModalities (["IMAGE"] or ["TEXT","IMAGE"]), imageConfig.aspectRatio (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9) |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"nano-banana-2","path":"/v1beta/models/gemini-3.1-flash-image-preview:generateContent","body":{"contents":"<array>","generationConfig":"<object>"}}'
```

### List Models

List all available Gemini models with their capabilities, token limits, and supported methods.

`GET /v1beta/models`

**Cost:** Free

_No parameters required._

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"nano-banana-2","path":"/v1beta/models","method":"GET"}'
```

---

Full details and an interactive quickstart: https://orthogonal.com/discover/nano-banana-2
