Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Wan 2.5 Image is an Alibaba image model for text-to-image and image-to-image generation. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDwan-2-5-image
Modestext-to-image, image-to-image
PromptRequired, non-empty; supports Chinese/English; max 2000 characters (model-side truncation)
Negative promptOptional; supports Chinese/English; max 500 characters (model-side truncation)
Images per tasknum_images supports 1-4, default 4
Reference imagesimage-to-image requires 1-3 image URLs
Input image limits (image_urls)JPEG/JPG/PNG(no alpha)/BMP/WEBP, width/height 384-5000 px, file size <=10MB
Aspect ratios (text-to-image)1:1, 3:4, 4:3, 9:16, 16:9
Aspect ratios (image-to-image)1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/wan-2-5-imageSubmit a generation task
GET/statusTask/wan-2-5-image?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

This minimal request submits a text-to-image task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-5-image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-image",
      "prompt": "a cinematic panda in snow",
      "aspect_ratio": "1:1",
      "num_images": 4
    }
  }'
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/wan-2-5-image?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/img1.png\",\"https://file.apixo.ai/img2.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected by the model service",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const imageUrls = payload.resultUrls;

Request body

Text-to-image

{
  "request_type": "async",
  "input": {
    "mode": "text-to-image",
    "prompt": "a cinematic panda in snow",
    "negative_prompt": "blurry, low quality",
    "aspect_ratio": "16:9",
    "num_images": 4
  }
}

Image-to-image

{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "prompt": "merge style of image 2 into image 1 and keep image 3 color mood",
    "negative_prompt": "low quality",
    "aspect_ratio": "3:4",
    "num_images": 3,
    "image_urls": [
      "https://example.com/base.png",
      "https://example.com/style.png",
      "https://example.com/color.png"
    ]
  }
}

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
Wan 2.5 Image input parameters.

Response format

Submit task response

POST /generateTask/wan-2-5-image 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. Present after completion when provider timing is available.
If at least one image succeeds, the task can still return success, and resultJson.resultUrls includes only successful images.

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/wan-2-5-image" \
  -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": "turn this into a cinematic movie still",
      "aspect_ratio": "16:9",
      "num_images": 2,
      "image_urls": [
        "https://example.com/source-1.png"
      ]
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Wan 2.5 Image is billed per generated image.
ModeAPIXO price
text-to-image$0.03 / image
image-to-image$0.03 / image
Billing behavior:
precharge = requested_num_images * unit_price_for_mode
final_charge = successful_images * unit_price_for_mode
refund = precharge - final_charge (if partial failure)
For current public pricing, see Pricing. If this route is not listed there, backend billing follows ModelPricing.md.

Latency and polling

Wan 2.5 Image tasks are asynchronous. The backend does not provide a fixed public latency SLA; actual latency varies by prompt complexity, requested image count, media fetch speed, and queue load.
WorkflowRecommended first pollPoll interval
text-to-image10s after task creation5s-10s
image-to-image10s-15s after task creation5s-10s
For production workloads, 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
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Third-party model service errorRetry with backoff
504Third-party model timeoutRetry or use callback mode

Task failure codes

failCode is route-dependent and may come from mapped third-party model failures. Common values include:
Fail codeMeaningWhat to do
PromptInvalidPrompt is invalid or rejected by the model serviceRewrite the prompt and retry
MissingParameter / BadRequestRequired fields are missing or malformedCheck required fields for the selected mode
SensitiveContentDetected / ProhibitedContentDetectedPrompt or media failed safety checksRewrite prompt or change input images
RateLimitExceededModel service or route rate limit was reachedRetry with backoff
Task TimeOut / TimeoutGeneration did not finish in timeRetry or use callback mode

Parameter troubleshooting

  • prompt is required for both modes and cannot be empty.
  • image_urls is required only for image-to-image, and must contain 1-3 items.
  • num_images supports 1-4; if omitted, default is 4.
  • aspect_ratio must match the selected mode’s supported set.
  • aspect_ratio defaults to 1:1 when omitted.
  • In text-to-image, any provided image_urls input is ignored.
See Error Codes for the full error reference.