Model APIs / Images

# Images

Generate images from a prompt. The response carries the images as base64 with their media type, plus the route and charge.

`POST` `/v1/images/generations` `inference:invoke`[Browse image models →](https://yelno.ai/catalog?type=images)

## Request

| Field | Required | Notes |
| --- | --- | --- |
| model | required | An image model's id from the catalog. |
| prompt | required | What to draw. |
| n | optional | How many images. |
| size | optional | Requested size, when the model takes one. |
| aspect_ratio | optional | For models sized by ratio, e.g. `"16:9"`. |
| quality · output_format · background · seed | optional | Generation settings, applied as the model defines them. |
| input_references | optional | Reference images: `[{type: "image_url", image_url: {url}}]`. |

Request

```
curl https://yelno.ai/v1/images/generations \
  -H "Authorization: Bearer $YELNO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL",
    "prompt": "A lighthouse on a basalt cliff at dusk, watercolor",
    "n": 1,
    "aspect_ratio": "16:9"
  }'
```

## Response

200 with the images as base64 and their media type — no hosted URL is returned.

200 · application/json

```
{
  "created": 1759572000,
  "data": [{ "b64_json": "iVBORw0KGgo…", "media_type": "image/png" }],
  "usage": { … },
  "yelno": {
    "request_id": "req_…",
    "provider": "…",
    "model": "…",
    "endpoint_id": "ep_…",
    "attempts": [ … ],
    "cost": { "state": "final", "currency": "USD", "customer_nanos": … }
  }
}
```

Every JSON response carries the same `yelno` block a chat response does: `request_id`, `provider`, `model`, `endpoint_id`, `attempts` and `cost`. `cost` is `{state: "final", currency, customer_nanos}` when the provider reported the cost with the response, or `{state: "pending", currency, note}` when it reports it later — the charge then settles once. Errors use the standard [error envelope](https://yelno.ai/docs/errors); upstream text never reaches you.

## Notes

No streaming yet: the gateway returns the finished images in one response.

Sending a model to a route it is not served on answers `422` `capability_unsupported` with `code: "operation_unsupported"` and a message naming the route that serves it. Every model in the [catalog](https://yelno.ai/catalog?type=images) shows its type and route.

Pricing. You pay the model's listed final price — shown on its catalog page — and nothing on top. A model without a fixed unit price is billed per request: its exact charge comes back with every response in `yelno.cost`. A hold is placed before dispatch and released down to the final charge; when the charge is reported after the response, the request settles once — it is never charged a guess.

Source: https://yelno.ai/docs/images
