# Generate images

POST /v1/images/generations: OpenAI-compatible text-to-image with negative prompts, seeds and aspect ratios. Models, prices, limits and errors.

## Request

Send a JSON body with your API key as a Bearer token. Standard OpenAI fields work; `quality`, `style` and `user` are accepted and ignored. A `dall-e-*` or `gpt-image-*` model name maps to our default model.



```
curl https://tryunrestrictedai.com/v1/images/generations \
  -H "Authorization: Bearer $UNCENSORED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lustify-v8",
    "prompt": "a lighthouse on a cliff in a storm, oil painting",
    "n": 2,
    "size": "1024x1024",
    "negative_prompt": "blurry, watermark",
    "seed": 42
  }'
```


## Fields





| Field | Type | Notes |
| --- | --- | --- |
| `prompt` | string, required | Up to 1,500 characters. |
| `model` | string | One of `lustify-v8`, `flux-dev`, `chroma`, `pony-realism`, `anime-illustrious`, `z-image-turbo`, `flux-schnell`. Default `lustify-v8`. |
| `n` | integer | 1 to 4. Default 1. |
| `size` | string | `WIDTHxHEIGHT`; mapped to the nearest supported aspect ratio. Default 1024x1024. |
| `aspect_ratio` | string | Overrides size: `1:1`, `3:4`, `4:3`, `2:3`, `3:2`, `9:16`, `16:9`. |
| `response_format` | string | `b64_json` (default) or `url` (valid 24 hours). |
| `negative_prompt` | string | Up to 1,000 characters. Ignored by FLUX models. |
| `seed` | integer | 0 to 999999999, for repeatable results. |

## Response

Images are WebP. `usage` reports images returned and the charge.



```
{
  "created": 1762650000,
  "data": [{ "b64_json": "UklGR...", "revised_prompt": null }],
  "model": "lustify-v8",
  "seed": 42,
  "output_format": "webp",
  "usage": { "images": 1, "cost_usd": 0.025 }
}
```


## Models and prices

Charged per image returned. Live list and prices: [/api/catalog](/api/catalog).



| Model | Description | Per image |
| --- | --- | --- |
| `lustify-v8` | Photoreal SDXL, the most permissive. Adult-capable. | $0.025 |
| `flux-dev` | FLUX quality, strong prompt following and text. | $0.025 |
| `chroma` | Uncensored FLUX-based model. Adult-capable. | $0.025 |
| `pony-realism` | Pony SDXL, realistic and stylized. Adult-capable. | $0.015 |
| `anime-illustrious` | Anime and illustration. Adults only. | $0.025 |
| `z-image-turbo` | Fast general model, good for drafts. | $0.025 |
| `flux-schnell` | Fastest and cheapest FLUX. | $0.01 |

## Python and JavaScript

Use the OpenAI SDK with our base URL; put extra fields in `extra_body` (Python) or the request object (JavaScript).



```
# Python
result = client.images.generate(model="flux-dev", prompt="a red fox in snow", size="1024x1024",
                                extra_body={"seed": 7})

// JavaScript
const result = await client.images.generate({ model: "flux-dev", prompt: "a red fox in snow", size: "1024x1024" });
```


## Content rules

Two limits apply on every plan and every model: **no sexual or suggestive content involving minors** or anyone who could read as under 18, and **no sexual or nude images of real, identifiable people** (celebrities, politicians, private people, or "undress this photo"). Prompts are checked before anything is generated.

A blocked prompt returns `400 content_policy_violation` and costs nothing. Adult prompts need a paid plan or a credit top-up (`403 adult_requires_paid` otherwise; the free trial covers non-adult images). Repeated violations return `403 image_suspended` for 24 hours.




## Errors and billing

The price for `n` images is reserved before generation, so the same balance, plan allowance and key budget checks as chat apply (`402 insufficient_credit`, `402 key_budget_exceeded`, `429 rate_limit`). If a provider fails, the next provider for that model is tried; if all fail you get `502 image_upstream_failed` and nothing is charged. A provider’s own content refusal returns `422 provider_refused`, also free.




Canonical: https://tryunrestrictedai.com/api/docs/images
