# Nano Banana — 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 native image generation models. Supports text-to-image, image editing, multi-image composition. Two models: gemini-2.5-flash-image (fast) and gemini-3-pro-image-preview (2K/4K with thinking/grounding).

**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 (Pro)

High-quality image generation with thinking capabilities. Supports 2K/4K output and Google Search grounding for factual images. Up to 14 input images for composition.

`POST /v1beta/models/gemini-3-pro-image-preview:generateContent`

**Estimated cost:** $0.15

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `contents` | array | Yes | Array with one object containing parts. Example: [{"parts": [{"text": "A detailed diagram of the solar system"}]}] |
| `generationConfig` | object | No | Config options: responseModalities (["IMAGE"] or ["TEXT","IMAGE"]), imageConfig.aspectRatio (1:1, 16:9, etc), imageConfig.outputSize (1024x1024, 2048x2048, 4096x4096), thinkingConfig.includeThoughts (boolean) |
| `tools` | array | No | For grounded images, add: [{"googleSearch": {}}] |

```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","path":"/v1beta/models/gemini-3-pro-image-preview:generateContent","body":{"contents":"<array>","generationConfig":"<object>","tools":"<array>"}}'
```

### List Models

List all available Gemini models with their capabilities, token limits, and supported methods. Image generation models: gemini-2.5-flash-image (Nano Banana), gemini-3-pro-image-preview (Nano Banana Pro).

`GET /v1beta/models`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `pageSize` | integer | No | Max models to return |
| `pageToken` | string | No | Pagination token |

```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","path":"/v1beta/models","method":"GET","query":{"pageSize":"<integer>","pageToken":"<string>"}}'
```

### Generate Image (Flash)

Generate images from text prompts. Also supports image editing (pass source image + edit instructions) and multi-image composition (up to 3 images). Returns base64-encoded images.

`POST /v1beta/models/gemini-2.5-flash-image:generateContent`

**Estimated cost:** $0.05

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `contents` | array | Yes | Array with one object containing parts. Example: [{"parts": [{"text": "A cute cat"}]}]. For editing, add inlineData: [{"parts": [{"text": "Add a hat"}, {"inlineData": {"mimeType": "image/jpeg", "data": "base64..."}}]}] |
| `generationConfig` | object | No | Optional config. Set responseModalities: ["IMAGE"] for image-only output, or ["TEXT", "IMAGE"] for both. Set imageConfig.aspectRatio to: 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","path":"/v1beta/models/gemini-2.5-flash-image:generateContent","body":{"contents":"<array>","generationConfig":"<object>"}}'
```

---

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