# Images > Generate an image from a text prompt with POST /v1/images/generations, paid with a key or per request with x402. Section: Developers. Web page: https://docs.katara.com/developers/images/ `POST https://api.katara.com/v1/images/generations` takes the OpenAI image generation request and returns one image. The model is `katara/glm-image@1`, which handles posters, illustrations, diagrams and text inside the picture well. ```sh curl https://api.katara.com/v1/images/generations \ -H "Authorization: Bearer $KATARA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"katara/glm-image@1","prompt":"A watercolor koi pond at dawn","size":"1280x1280"}' ``` With the OpenAI client, `client.images.generate(model="katara/glm-image@1", prompt="...")` works unchanged. ## What a request takes | Field | | |---|---| | `model` | `katara/glm-image@1`. | | `prompt` | What to draw, up to 4,000 characters. | | `size` | `WIDTHxHEIGHT`, each side 1024 to 2048 pixels and a multiple of 32, at most 4,194,304 pixels in all. The default is `1280x1280`; `1568x1056`, `1056x1568`, `1472x1088`, `1088x1472`, `1728x960` and `960x1728` suit other shapes. `auto` takes the default. | | `quality` | `hd` (the default, about 20 seconds) or `standard` (5 to 10 seconds). `high` and `auto` mean `hd`; `medium` and `low` mean `standard`. | | `n` | Only `1`. Send one request per image. | | `response_format` | Only `b64_json`. | | `user` | Accepted and not passed on. | Any other field is refused with `400` and code `unsupported_parameter`, so you never pay for a picture made differently from what you asked. Image editing and reference images are not available. ## The reply ```json { "created": 1792252800, "data": [{ "b64_json": "iVBORw0KGgo..." }], "output_format": "png", "usage": { "images": 1 }, "katara": { "cost_usdc": "0.03", "provider": "managed", "fallback": true, "served": { "model": "katara/glm-image@1", "managed": true } } } ``` `data[0].b64_json` is the image itself, base64-encoded; `output_format` says whether it is `png`, `jpeg` or `webp`. Katara stores nothing you need to fetch afterwards, so save the image from the reply. ## Paying Every image has one price, known before it is made. `/v1/models` lists the model with `image_generation: true` and its `image_price`. - A key that pays with USDC is charged the listed image price, 0.03 USDC. - A key that pays with Account Credits is charged $0.018 per image; `katara.cost_usd` carries the charge. - Without a key, the request is paid with [x402](https://docs.katara.com/developers/x402.txt). The quote is exactly the image price, 0.03 USDC, with the same schemes and settlement as a chat completion. Images are made by Katara's own model provider only, never by Katara Community, whatever pays. A request that fails before the image comes back is not charged. In the chat app, ask Katara Cortex for a picture and it draws one with this model, charged the same way.