---
title: Images
description: Generate images with POST /images/generations and the image models in the Sylphx catalogue.
type: how-to
product: ai
summary: The image models in the catalogue, the request and what comes back.
updated: 2026-10-01
order: 8
---

`POST https://api.sylphx.ai/v1/images/generations` generates images from a prompt and
answers one JSON document.

## The image models

These are the image models in the [catalogue](/ai/models):

| Model id | Name |
| --- | --- |
| `google/gemini-3-pro-image` | Nano Banana Pro |
| `google/gemini-3.1-flash-image` | Nano Banana 2 |
| `google/gemini-3.1-flash-lite-image` | Nano Banana 2 Lite |
| `openai/gpt-5.4-image-2` | GPT-5.4 Image 2 |

The catalogue is the only list: `GET https://api.sylphx.ai/v1/public/models` shows
exactly what is served, and another model id answers `404 model_not_found`.

## Request

```bash
curl https://api.sylphx.ai/v1/images/generations \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3.1-flash-image",
    "prompt": "A lighthouse on a cliff at dusk, painted in gouache",
    "aspect_ratio": "16:9",
    "response_format": "b64_json"
  }'
```

<PropertyTable
	properties={[
		{
			name: 'model',
			type: 'string',
			description: 'An image model id from the catalogue. Required.',
		},
		{
			name: 'prompt',
			type: 'string',
			description: 'What to draw, up to 32,000 characters. Required.',
		},
		{
			name: 'n',
			type: 'integer',
			description: 'How many images, 1 to 4. Default 1.',
		},
		{
			name: 'size',
			type: 'string',
			description: 'Width x height, for example 1024x1024, 1792x1024 or 1024x1792. Each edge is 64 to 4096. auto leaves the size to the model. Default 1024x1024.',
		},
		{
			name: 'aspect_ratio',
			type: 'string',
			description: 'auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9 or 9:21.',
		},
		{
			name: 'quality',
			type: 'string',
			description: 'auto, low, medium, high, standard or hd.',
		},
		{
			name: 'response_format',
			type: 'string',
			description: 'url (the default) or b64_json.',
		},
		{
			name: 'background, output_format, output_compression, moderation',
			type: 'string or integer',
			description: 'Passed to the model that serves the request: background is auto, transparent or opaque; output_format is auto, png, webp, jpeg or svg; output_compression is 0 to 100; moderation is auto or low. Each model honours the subset it supports.',
		},
	]}
/>

The request is strict: an unknown key is refused with a typed `invalid_request`
that names its path.

## Response

```json
{
  "created": 1790000000,
  "model": "google/gemini-3.1-flash-image",
  "data": [{ "b64_json": "…" }]
}
```

`model` is the catalogue id that served the request, never a provider's
internal name. Each `data` item carries `url` or `b64_json`, as you asked.

Only generation is served. `POST /images/edits` and `POST /images/variations`
answer `410`.

<RelatedDocs
	links={[
		{
			href: '/docs/ai/errors',
			label: 'Errors and retries',
			description: 'The error envelope and which failures are safe to retry.',
		},
		{
			href: '/docs/ai/contract',
			label: 'API contract',
			description: 'Every endpoint and the key format.',
		},
	]}
/>
