API Documentation
Quick integration guide and complete API reference
Image Generation
/v1/images/generationsThe main endpoint for generating images
Unified image generation endpoint supporting fields such as prompt, n, size, quality, and image_url. Per-image models settle on the number of returned images.
Once your text endpoint works, image generation is usually the next step. Start with the simplest prompt + n + size combination before trying more complex options.
POST /v1/images/generations
Text-to-image, posters, illustrations, product shots, cover art
Generate one image first to confirm the model, permissions, and response format
When to use this endpoint
If you want the model to generate an image from a written prompt, this is usually the right starting point.
Use this endpoint when testing different sizes, quality settings, or multiple returned images.
Begin with the simplest parameters, then add advanced options such as more images or reference inputs after the basic request succeeds.
CURL example
CURLcurl https://api.weiapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-2.0",
"prompt": "A clean editorial product poster",
"n": 2,
"size": "1024*1024"
}'Things to keep in mind
- Make sure the model field contains a real callable image model ID from this platform.
- For your first test, set n to 1 so it is easier to verify the response and billing behavior.
- If the response returns image URLs, image data, or the platform's success payload, the image endpoint is working.
