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

# Images

> Generate and edit images with GPT and Gemini image models.

There are two ways to generate images, and which one you use depends on the model family.

| Family | Path | Reference |
| - | - | - |
| GPT image models | `POST /v1/images/generations` | [Create an image](/api-reference/image/generations) |
| Gemini image models | `POST /v1beta/models/{model}:generateContent` | [Generate an image with Gemini](/api-reference/image/gemini) |

The OpenAI-compatible route is the familiar one: point the OpenAI SDK at `https://api.pipellm.ai/v1` and call it unchanged. It also covers [editing](/api-reference/image/edits) an existing image.

Gemini image models have no `/v1/images/*` route of their own. They generate through the same `generateContent` endpoint as text models and return the image as an inline part. There is no `/v2/images` route on PipeLLM.

See [Nano Banana](/use-cases/nano-banana) for the full Gemini request and response examples.

| Model | Typical use |
| - | - |
| `gemini-3.1-flash-lite-image` | Cheapest and fastest |
| `gemini-3.1-flash-image` | Fast image generation |
| `gemini-3-pro-image` | Higher-fidelity production images |

```bash theme={"dark"}
curl -X POST \
  "https://api.pipellm.ai/v1beta/models/gemini-3.1-flash-image:generateContent" \
  -H "x-goog-api-key: $PIPELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "role": "user",
      "parts": [{"text": "A red bicycle leaning against a cafe window"}]
    }]
  }'
```

Confirm the current image model IDs with [`GET /v1/models`](/api-reference/list-models). For video, use [`POST /v2/videos`](/guides/video).


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