Loading
Loading
POST /v1/images/generations — create images from text. You pay for each image returned.
| Field | Meaning |
|---|---|
| model | id of an image model from the catalog |
| prompt | Image description, required, up to 4000 characters |
| n | How many images; 1 by default. The maximum depends on the model: DALL·E 3 returns one image |
| size | Size, for example 1024x1024 |
| quality | Quality, if the model supports it |
| response_format | url or b64_json |
| user | Your end user’s ID: why |
curl https://llmproxy.org/v1/images/generations \ -H "Authorization: Bearer $LLMPROXY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-3.1-flash-lite-image", "prompt": "A ginger cat in a spacesuit, watercolor", "n": 1}'
The response uses the OpenAI format: a data array with url links or base64 in b64_json, depending on response_format and the model. Image links are temporary: save the image on your side.
import base64 resp = client.images.generate( model="google/gemini-3.1-flash-lite-image", prompt="A ginger cat in a spacesuit, watercolor", response_format="b64_json",)with open("cat.png", "wb") as file: file.write(base64.b64decode(resp.data[0].b64_json))
For models served by fal and Replicate, the per-image price assumes one megapixel. Larger sizes are scaled down to 1 MP, keeping the aspect ratio.
Before generation, the price of n images is held on your balance. You’re charged for each image actually returned: if only part of the batch arrives, the rest isn’t charged.
Prompts are moderated. For images, any flagged category means a refusal — 400 content_policy_violation. If moderation is temporarily unavailable, the request may be rejected with 503 moderation_unavailable: retry in a few seconds.