Alibaba chat and image APIs
Qwen chat completions, Z-Image Turbo and Wan 2.7 image generation.
Use an Official Group APIPool key and the base URL https://app.apipool.dev/v1.
Current availability and prices are shown in the Alibaba catalog.
Qwen chat
The chat example covers qwen3.6-flash, qwen3.6-plus,
qwen3.7-plus, qwen3.7-max, qwen3.8-max, qwen3.7-flash,
qwen3.8-flash, qwen3.8-27b, qwen3.8-2.4t-a95b, and qwen3.8-max-0902.
Check current availability in the catalog and replace model with your target ID.
curl https://app.apipool.dev/v1/chat/completions \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3.8-flash","messages":[{"role":"user","content":"Hello"}],"stream":false}'Only Chat Completions is enabled for this family. Requests default to non-streaming;
with stream: true, usage is included in the final stream chunk. User-defined
function tools and implicit cache reads are supported. Built-in search/tools,
explicit cache creation, and Responses are not enabled. Cached input is charged
at its own rate and reasoning tokens are included in output usage.
Images
All three models use JSON POST /v1/images/generations and the
asynchronous image task workflow.
| Model ID | Outputs per request | Reference images | Resolution |
|---|---|---|---|
z-image-turbo | Exactly 1; omit n | None | 1K (default), 2K |
wan2.7-image | n=1..4, default 1 | Up to 9 | 1K, 2K (default) |
wan2.7-image-pro | n=1..4, default 1 | Up to 9 | 1K, 2K (default); 4K for text-to-image only |
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"wan2.7-image-pro","prompt":"A quiet flower shop in watercolor","n":1,"size":"16:9","resolution":"4K"}'Standalone Z-Image Turbo text-to-image example (omit n):
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"z-image-turbo","prompt":"A blue ceramic cup on a white table","size":"1:1","resolution":"1K"}'Save the returned task id, then poll GET /v1/tasks/{id} with the same key.
A 202 submission is not a completed image. Download the result after the task
reaches completed; follow the expiration timestamps in the response.
size supports 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, and 2:3.
Wan also accepts 1K, 2K, or supported 4K in size; do not supply a
conflicting resolution. Custom pixel sizes are not enabled.
For Wan image editing, pass image_urls (HTTP(S) or data:image URLs) to the
same generation endpoint. With references, output resolution cannot exceed 2K
and the output matches the last reference image's aspect ratio.
The prompt is required: at most 800 characters for Z-Image, 5000 for Wan.
Wan also accepts a string negative_prompt.
Wan reference-image editing example; replace the URL with a real image reachable by the server:
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"wan2.7-image","prompt":"Change the cup to green","image_urls":["https://your-cdn.example/source.png"],"resolution":"2K","n":1}'Standard generation is supported. Multipart edits, sequential generation,
bounding boxes, palettes, seed, watermark and thinking controls are not enabled.
prompt_extend and nsfw_check may only be omitted or false; requests that
enable these additional paid services are rejected before billing.
Images are charged by the number successfully delivered. Wan reference images and supported resolutions do not add a fee. See Alibaba model details for current rates.
These image models use the Images task API, not Chat / Responses text requests. See the runnable submission and polling example.