Image Generations
POST /v1/images/generations
Generate images from text prompts using Imagen, Flux, and MAI models, with CDN-hosted output URLs.
Request
POST https://api.chuizi.ai/v1/images/generations
Authentication
Authorization: Bearer ck-your-api-key
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Model name, e.g. google/imagen-4.0, azure/flux-kontext-pro |
prompt | string | Yes | — | Text description of the image to generate |
size | string | No | "1024x1024" | Image dimensions. Options vary by model |
Request Example
config.json
json
{ "model": "google/imagen-4.0", "prompt": "A futuristic city skyline at sunset, digital art style", "size": "1024x1024", "n": 1, "response_format": "url" }
Response
config.json
json
{ "created": 1712000000, "data": [ { "url": "https://media.chuizi.ai/images/gen-xxxxxxxx.png", "revised_prompt": "A futuristic city skyline at sunset with neon lights..." } ], "x_chuizi": { "generation_id": "gen-xxxxxxxxxxxxxxxx", "latency_ms": 8500, "cost": "0.04000000" } }
Code Examples
terminal
bash
curl -X POST https://api.chuizi.ai/v1/images/generations \ -H "Authorization: Bearer ck-your-key" \ -H "Content-Type: application/json" \ -d '{ "model": "google/imagen-4.0", "prompt": "A futuristic city skyline at sunset", "size": "1024x1024" }'
Next Steps
- Image Generation Guide — tips for effective prompts and model comparison
- Image Edits API — edit existing images with inpainting, background removal, and upscaling
- Pricing — image generation costs per model