Generate images
Image models use POST /v1/images/generations. You can generate from text or edit existing images.
Text to image#
Describe the image in prompt. Adjust aspect_ratio, resolution and num_images. Cost is per image × count.
curl -X POST "https://api18.dev/v1/generate?wait=true" \
-H "Authorization: Bearer $API18_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"hera-1.0-text-to-image","prompt":"A studio product photo of a ceramic coffee mug on marble, soft light","aspect_ratio":"1:1","resolution":"1k","num_images":1}'
# → returns the finished job; the output URL is at .data[0].urlImage editing#
Send 1–3 images in images (public URLs) and describe the change in prompt.
curl -X POST "https://api18.dev/v1/generate?wait=true" \
-H "Authorization: Bearer $API18_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"hera-1.0-image-edit","prompt":"Replace the background with a sunny beach, keep the subject unchanged","images":["https://example.com/photo.jpg"]}'
# → returns the finished job; the output URL is at .data[0].urlInput images must be public URLs (JPEG/PNG/WEBP/BMP, up to 10MB each).