Images
POST https://dev.typno.ai/v1/images/generations makes an image from a description.
curl https://dev.typno.ai/v1/images/generations \
-H "Authorization: Bearer $TYPNO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "z-image-turbo", "prompt": "a lighthouse at sunset, flat illustration", "size": "1024x1024"}'
| Field | |
|---|---|
model |
An image model, see below |
prompt |
What the image shows; English works best |
size |
WIDTHxHEIGHT, 256 to 2048 pixels per side. Default 1024x1024 |
n |
Number of images, 1 to 4. Default 1 |
The answer has the images as base64 in data[].b64_json.
import base64
result = client.images.generate(model="z-image-turbo", prompt="a lighthouse at sunset")
open("lighthouse.jpg", "wb").write(base64.b64decode(result.data[0].b64_json))
Models
| Model | Per megapixel |
|---|---|
Flux.2 [klein]flux2-klein | € 0,0055 |
Z-Image Turboz-image-turbo | € 0,0099 |
Qwen Imageqwen-image | € 0,0825 |
Images are billed per megapixel of output.