API Documentation

Quick integration guide and complete API reference

Image Generation

POST/v1/images/generations

The 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.

Method

POST /v1/images/generations

Common use cases

Text-to-image, posters, illustrations, product shots, cover art

Recommended first test

Generate one image first to confirm the model, permissions, and response format

When to use this endpoint

1
For text-to-image

If you want the model to generate an image from a written prompt, this is usually the right starting point.

2
For style and size tuning

Use this endpoint when testing different sizes, quality settings, or multiple returned images.

3
For first image integration

Begin with the simplest parameters, then add advanced options such as more images or reference inputs after the basic request succeeds.

CURL example

CURL
curl 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.