> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 尺寸与计费档位

> `size` 的取值范围、常用尺寸，以及按输出像素划分的 1K / 2K 计费档位。

## size 取值

`parameters.size` 的格式为 `宽*高`（用星号连接），例如 `1024*1024`。文生图和图片编辑都要求总像素在 512\*512 \~ 2048\*2048 之间（262,144 \~ 4,194,304），宽高比在 1:8 \~ 8:1 之间；不传 `size` 时由模型根据提示词推荐分辨率。格式不是 `宽*高` 时网关直接返回 400；像素超出范围由模型服务校验，返回 400 `InvalidParameter`。实际输出尺寸以响应中的 `usage.output_width` / `usage.output_height` 为准。

## 常用尺寸

| 比例 | 1K 档示例 | 2K 档示例 |
| - | - | - |
| 1:1 | `1024*1024`、`1328*1328` | `1536*1536`、`2048*2048` |
| 16:9 | `1664*928` | `2048*1152` |
| 9:16 | `928*1664` | `1152*2048` |
| 4:3 | `1472*1104` | `2048*1536` |
| 3:4 | `1104*1472` | `1536*2048` |
| 3:2 | `1584*1056` | `1872*1248` |
| 2:3 | `1056*1584` | `1248*1872` |

## 计费档位

按图片张数计费。每张输出图片按自身的总像素（宽 × 高）分档：不超过 2,250,000（1500\*1500）为 1K 档，超过为 2K 档，对应响应中的 `usage.output_image_type`（`qima_output_1k` / `qima_output_2k`）。图片编辑的每张参考图另按输入图片计费（`usage.input_image_count`）。

| 计费项 | `qwen-image-3.0` 单价 |
| - | - |
| 输出图片 · 1K 档 | \$0.03 / 张 |
| 输出图片 · 2K 档 | \$0.03 / 张 |
| 输入图片 | \$0.003 / 张 |

一次请求的费用 = 输出图片张数 × 所在档位单价 + 输入图片张数 × 输入单价。例如用 1 张参考图编辑、`n: 2`、输出 1328\*1328（1K 档）：2 × $0.03 + 1 × $0.003 = \$0.063。

发起请求前按本次最多可能生成的图片预检余额（`n` 张；未传 `size` 或 `size` 超过 2,250,000 像素时按 2K 档），余额不足返回 402，不调用模型；之后按响应中的 `usage` 实际扣费。参数错误和生成失败不扣费。以控制台显示的价格为准。

## 2K 请求示例

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-3.0",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "text": "微距摄影：一片带着露珠的绿叶，叶脉清晰，背景是柔和的散景，清晨逆光"
            }
          ]
        }
      ]
    },
    "parameters": {
      "size": "2048*2048",
      "watermark": false,
      "seed": 20261117
    }
  }'
```

```python Python theme={null}
import os

import requests

URL = "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "qwen-image-3.0",
    "input": {
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "text": "微距摄影：一片带着露珠的绿叶，叶脉清晰，背景是柔和的散景，清晨逆光"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "size": "2048*2048",
        "watermark": False,
        "seed": 20261117
    }
}

result = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
if "output" not in result:
    raise SystemExit(result)
for item in result["output"]["choices"][0]["message"]["content"]:
    print(item["image"])
```

```json theme={null}
{
  "request_id": "req_7c1e9a4b2d3f5a6b8c9d0e1f",
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": [
            {
              "type": "image",
              "image": "https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997390&Signature=..."
            }
          ]
        }
      }
    ],
    "rewrite_status": "success"
  },
  "usage": {
    "output_width": 2048,
    "output_height": 2048,
    "input_image_count": 0,
    "input_image_type": "qima_input_2k",
    "output_image_count": 1,
    "output_image_type": "qima_output_2k"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.