# alibaba/wan-2-7-image-pro

Source: https://docs.sociaro.com/models/alibaba-wan-2-7-image-pro/

Wan 2.7 Image Pro text-to-image. prompt (required); size; n (the vendor's own count — the charge follows the number of images it reports producing, and the poll lists every one of them in media_urls; media_url is the first); watermark (default false); thinking_mode; enable_sequential (image-set mode: n becomes a maximum of 1-12, default 12, and every image the generator makes is charged); seed (the same seed gives similar results; the vendor does not guarantee identical ones); color_palette (3 to 10 {hex, ratio} objects whose ratios add up to 100.00%; only with enable_sequential false).

Any other generator parameter is passed to the vendor unchanged and its own error comes back to you.

Served via the relay: POST /v1/alibaba/generations, poll GET /v1/alibaba/generations/{task_id}. Per-image pricing, billed by the relay from the vendor's reported count.

|  |  |
| --- | --- |
| Slug | `alibaba/wan-2-7-image-pro` |
| Kind | image |
| Vendor | alibaba |
| Endpoint | `POST /v1/alibaba/generations` |

[View pricing and billing conditions](https://docs.sociaro.com/models/alibaba-wan-2-7-image-pro/#pricing)

## Example request

cURL

```bash
curl https://api.sociaro.com/v1/alibaba/generations \
  -H "Authorization: Bearer $SOCIARO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "alibaba/wan-2-7-image-pro",
        "prompt": "a paper boat on a rain-soaked street"
      }'

# then poll the job id it returns:
curl https://api.sociaro.com/v1/alibaba/generations/JOB_ID \
  -H "Authorization: Bearer $SOCIARO_API_KEY"
```

Python

```python
# Requires Python 3 and requests (pip install requests).
import os
import time
import requests

payload = {'model': 'alibaba/wan-2-7-image-pro',
 'prompt': 'a paper boat on a rain-soaked street'}

response = requests.post(
    'https://api.sociaro.com/v1/alibaba/generations',
    headers={
        'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        'Content-Type': 'application/json',
    },
    json=payload,
    timeout=120,
)
response.raise_for_status()
submitted = response.json()
job_id = submitted['job_id']
print(submitted)

# then poll the job id it returns:
while True:
    response = requests.get(
        'https://api.sociaro.com/v1/alibaba/generations/' + job_id,
        headers={
            'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        },
        timeout=120,
    )
    response.raise_for_status()
    result = response.json()
    status = result['status']
    if status == 'completed':
        break
    if status not in ('submitted', 'processing'):
        raise RuntimeError(result)
    time.sleep(5)
print(result)
```

JavaScript

```javascript
// Run as an .mjs file with Node.js 22 or later.
let jobId;
let result;

{
  const payload = {
    "model": "alibaba/wan-2-7-image-pro",
    "prompt": "a paper boat on a rain-soaked street"
  };
  
  const response = await fetch("https://api.sociaro.com/v1/alibaba/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
  const submitted = await response.json();
  jobId = submitted.job_id;
  console.log(submitted);
}

// then poll the job id it returns:
{
  while (true) {
    const response = await fetch("https://api.sociaro.com/v1/alibaba/generations/" + jobId, {
      headers: {
        "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      },
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
    result = await response.json();
    const status = result.status;
    if (status === "completed") break;
    if (!["submitted", "processing"].includes(status)) throw new Error(JSON.stringify(result));
    await new Promise(resolve => setTimeout(resolve, 5000));
  }
  console.log(result);
}
```

## Parameters

- `prompt`
- `size`
- `n`
- `watermark`
- `thinking_mode`
- `enable_sequential`
- `seed`
- `color_palette`

The endpoint rejects unknown request fields.

## Pricing

| Billable unit and options | Rate (USD) |
| --- | --- |
| per image | $0.075 |

[View this model in the pricing catalogue](https://sociaro.com/pricing?model=alibaba%2Fwan-2-7-image-pro). Your [billing logs](https://docs.sociaro.com/billing/index.md) show the actual charge for each request.
