User Guide
Image Generation Model

Qwen Image Generation

Call the Qwen Image series via `/v1/images/generations`; the current project returns `ImageResponse` synchronously without using task_id polling.

  • Route: POST /v1/images/generations
  • Returns ImageResponse synchronously on success
curl --request POST \
  --url https://api.magickapi.com/v1/images/generations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "qwen-image",
    "prompt": "A cute orange cat dozing off in the sunlight",
    "n": 1,
    "response_format": "url",
    "parameters": {
      "size": "1024*1024",
      "watermark": false
    }
  }'

Successful Response Example

{
  "created": 1712345678,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "b64_json": "",
      "revised_prompt": ""
    }
  ]
}

Error Response Example

{
  "error": {
    "message": "Invalid request",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request"
  }
}

Confirmable Fields

Standard Image Fields

The current project's public image API guarantees the availability of the following standard fields:

  • model
  • prompt
  • n
  • size
  • quality
  • response_format

Qwen / Alibaba Extended Fields

If you need to use Alibaba-compatible extensions, use nested objects instead of the top-level extension fields in the legacy documentation:

  • parameters
  • input

For example:

{
  "model": "qwen-image",
  "prompt": "Cyberpunk city night scene",
  "parameters": {
    "size": "1536*1024",
    "n": 2,
    "watermark": false
  }
}

Compatibility Notes

  • For image editing, use /v1/images/edits or /v1/edits instead

Last updated on

On this page