# Wan2.7 Image API

> Wan2.7 Image — fast, high-fidelity AI image generation & editing.

- **Provider**: Wan
- **Model id**: `wan-2-7-image-pro`
- **Modality**: image
- **Price**: 6.96 credits /image

## Overview

Wan2.7 Image is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `wan-2-7-image-pro` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL we POST the finished task to. Signed with `X-Webhook-Signature` once you create a webhook signing key in Dashboard → Settings |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | Text prompts for image generation. Supports both Chinese and English, with a minimum of 1 characters and a maximum of 5,000 characters. Max 5000 characters. (example: Restyle into a warm hand-tinted vintage photograph, a sepia base with delicate hand-painted color on the artisan's hands and worn tools, soft film grain and a… — full value in the request example) |
| input_urls | string[] | No | Upload an image file to use as input for the API (image URL) |
| bbox_list | string | No | Draw edit regions on each image. Coordinates are saved as [x1, y1, x2, y2] using the original image pixel coordinates. Each image supports up to 2 boxes. |
| enable_sequential | boolean | No | Enable Gallery Mode (true/false) (default: false) |
| color_palette | object[] | No | Optional custom theme, 3-10 colours (8 recommended). Ratios must sum to 100.00%. Only available with Sequential Mode off. (array of { hex, ratio }) |
| n | number | Conditional | when `enable_sequential` is `false`: When the group image mode is turned off, n represents the number of generated images (1-4); when it is turned on, n represents the maximum number of images (1-12), and the actual value is determined by the model. (range 1-4) · when `enable_sequential` is `true`: When the group image mode is turned off, n represents the number of generated images (1-4); when it is turned on, n represents the maximum number of images (1-12), and the actual value is determined by the model. (range 1-12) |
| resolution | string | No | Resolution of the generated image. Higher resolutions take longer to generate.(4K generation is available only for text-to-image in Standard Mode) (options: 1K \| 2K \| 4K) (default: 2K) |
| thinking_mode | boolean | No | Enhances reasoning for higher-quality outputs. Only available when Gallery Mode is off and no images are uploaded. May increase generation time. (true/false) (default: false) |
| aspect_ratio | string | No | Aspect ratio of the generated image (options: 1:1 \| 3:4 \| 4:3 \| 1:8 \| 8:1 \| 9:16 \| 16:9 \| 21:9) (default: 1:1) |
| watermark | boolean | No | Whether to add a watermark identifier (true/false) (default: false) |
| seed | number | No | Using the same seeds and the same prompts for the same version of the model can keep the generated content relatively stable. (default: 0) |
| nsfw_checker | boolean | No | A configurable parameter. Defaults to true in the Playground. (true/false) (default: true) |

### Request example

```json
{
  "modelId": "wan-2-7-image-pro",
  "input": {
    "prompt": "Restyle into a warm hand-tinted vintage photograph, a sepia base with delicate hand-painted color on the artisan's hands and worn tools, soft film grain and a gentle vignette.",
    "input_urls": [
      "https://you.bot/examples/grok-imagine-text-to-image.jpg"
    ],
    "bbox_list": "example",
    "enable_sequential": false,
    "color_palette": [
      {
        "hex": "example",
        "ratio": "example"
      },
      {
        "hex": "example",
        "ratio": "example"
      },
      {
        "hex": "example",
        "ratio": "example"
      }
    ],
    "n": 0,
    "resolution": "2K",
    "thinking_mode": false,
    "aspect_ratio": "1:1",
    "watermark": false,
    "seed": 0,
    "nsfw_checker": true
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 6.96
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=wan-2-7-image-pro`

When `state` is `success`, the output is in `resultUrls`: `{ "state": "success", "resultUrls": [ ... ] }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed — check API Key |
| 402 | Insufficient account balance |
| 403 | IP not allowed for this key, or the key is restricted to other models |
| 404 | Task not found, or it has expired |
| 409 | Duplicate request — an identical submit arrived moments ago. Nothing was charged; retry is safe |
| 413 | Payload too large — see the character and file-size limits for this model |
| 429 | Rate limit exceeded — retry after the Retry-After header |
| 500 | Internal server error |
| 504 | Upstream timed out — nothing was delivered; retry is safe |
