Skip to main content

Overview

Qwen Image is an asynchronous image-to-image API. Provide one source image and a prompt, then poll the task until the generated variants are ready.
CapabilityValue
Model IDqwen
Modeimage-to-image
Prompt length1-2000 characters
Source imageExactly 1 public image_url
Images per tasknum_images must be 1, 2, 3, or 4
Aspect ratios1:1, 4:3, 3:4, 9:16, 16:9
Speed optionsnone, regular, high
Output formatspng, jpeg

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/qwenSubmit an image-to-image task
GET/statusTask/qwen?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

curl -X POST "https://api.apixo.ai/api/v1/generateTask/qwen" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "image-to-image",
      "prompt": "turn this product photo into a clean studio hero image with soft reflections",
      "image_url": "https://example.com/source.png",
      "num_images": 2,
      "aspect_ratio": "16:9",
      "speed": "regular",
      "output_format": "png"
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final result.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/qwen?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/image-1.png\",\"https://file.apixo.ai/image-2.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const imageUrls = payload.resultUrls;

Request body

{
  "request_type": "async",
  "callback_url": "https://your-server.com/webhooks/apixo",
  "input": {
    "mode": "image-to-image",
    "prompt": "transform into a warm sunrise scene with cinematic lighting",
    "image_url": "https://example.com/source.jpg",
    "num_images": 4,
    "aspect_ratio": "16:9",
    "speed": "regular",
    "num_inference_steps": 30,
    "guidance_scale": 8,
    "output_format": "jpeg",
    "negative_prompt": "low quality, blurry, distorted",
    "seed": 42
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a callback URL that can receive the final task payload. See Webhooks.
input
object
required
Qwen Image input parameters.

Response format

Submit task response

POST /generateTask/qwen returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing generated image URLs in resultUrls. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds when available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/qwen" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "image-to-image",
      "prompt": "make this image look like a premium editorial campaign",
      "image_url": "https://example.com/source.jpg",
      "num_images": 1
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Qwen Image is billed by the requested num_images value.
Requested imagesAPIXO price
1$0.025 / generation
2$0.050 / generation
3$0.075 / generation
4$0.100 / generation
For current route and market comparison pricing, see Pricing.

Latency and polling

Qwen Image tasks are asynchronous. Actual latency varies by source image fetch speed, requested image count, prompt complexity, and queue load.
Use caseRecommended first pollPoll interval
Normal image-to-image task10s-15s after task creation5s-10s
Multiple outputs or high-concurrency workloadsPrefer callback modeIf polling, use 10s or longer
For production queues or batches, use callback mode to avoid frequent polling.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, parameter type, or valueFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the modelCheck permissions and route strategy
404Task not foundVerify the taskId and model ID
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server or unmapped model errorRetry with backoff
502Model service errorRetry with backoff
504Model service timeoutRetry or use callback mode for long-running jobs

Request validation

ConditionBackend behavior
Missing inputReturns The required parameter {{input}} is missing.
Missing promptReturns The required parameter {{prompt}} is missing.
Prompt is empty or too longReturns a validation or length error
Missing image_urlReturns The required parameter {{image_url}} is missing.
Invalid num_imagesReturns The parameter {{num_images}} must be 1, 2, 3 or 4.
Invalid aspect_ratioReturns the supported aspect-ratio list
Invalid speedReturns The parameter {{speed}} must be either 'none', 'regular' or 'high'.
Invalid output_formatReturns The parameter {{output_format}} must be either 'jpeg' or 'png'.
See Error Codes for the full error reference.