For the complete documentation index, see llms.txt. This page is also available as Markdown.

Qwen Image 3

This documentation is valid for the following list of our models:

  • alibaba/qwen-image-3

Model Overview

Qwen Image 3 text-to-image model with strong Chinese and English text rendering and automatic prompt expansion.

How to make the first API call

1️⃣ Required setup (don’t skip this)Create an account: Sign up on the AI/ML API website (if you don’t have one yet). ▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.

2️ Copy the code example At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

3️ Update the snippet for your use caseInsert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key. ▪ Select a model: set the model field to the model you want to call. ▪ Provide input: fill in the request input field(s) shown in the example.

4️ (Optional) Tune the request See the API schema below for optional generation settings.

5️ Run your code Run the updated code in your development environment.

API Schema

post
Body
modelstring · enumRequiredPossible values:
promptstring · max: 800Required

The text prompt describing the content, style, or composition of the image to be generated.

image_sizeany ofOptionalDefault: square_hd
or
string · enumOptional

The size of the generated image.

Possible values:
negative_promptstring · max: 500Optional

The description of elements to avoid in the generated image.

num_imagesinteger · min: 1 · max: 4Optional

The number of images to generate.

Default: 1
output_formatstring · enumOptional

The format of the generated image.

Default: pngPossible values:
seedinteger · max: 2147483647Optional

The same seed and the same prompt given to the same version of the model will output the same image every time.

enable_prompt_expansionbooleanOptional

If set to True, prompt will be upsampled with more details.

Default: true
enable_safety_checkerbooleanOptional

If set to True, the safety checker will be enabled.

Default: true
Responses
200

Successful response.

application/json
post/v1/images/generations
curl --request POST \
  --url 'https://api.aimlapi.com/v1/images/generations' \
  --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"model": "alibaba/qwen-image-3", "prompt": "Describe what you want the model to generate."}'
200

Successful response.

{
  "data": [
    {
      "url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
      "b64_json": null
    }
  ],
  "meta": {
    "usage": {
      "credits_used": 120000,
      "usd_spent": 0.06
    }
  }
}

Code Example

Response

Last updated

Was this helpful?