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

# 阿里百炼万相 2.7 图片生成

> 调用阿里云百炼万相 2.7（`wan2.7-image-pro`）的同步图片生成接口。
单次请求生成 1 张，按张计费。
上游官方 OSS 临时 URL 直接透传，官方保留约 24 小时，请及时下载。

[查看使用指南](/guides/aliwan-wan27)




## OpenAPI

````yaml /openapi/gateway-v1.openapi.yaml post /v1/images/aliwan
openapi: 3.1.0
info:
  title: WengaoCloud AI Gateway API
  version: 0.1.0
  description: WengaoCloud AI 聚合平台公开 API 契约草案，覆盖 OpenAI 兼容接口、Anthropic 原生接口和平台扩展接口。
servers:
  - url: https://xxx.wengaocloud.com
    description: 问高云 API 网关根域名。OpenAI SDK 的 base_url 使用 https://xxx.wengaocloud.com/v1。
  - url: https://{tenant}.wengaocloud.com
    description: 控制台展示的租户或 OEM API 网关根域名。
    variables:
      tenant:
        default: xxx
security:
  - bearerAuth: []
tags:
  - name: models
    x-group: 模型
  - name: openai-compatible
    x-group: OpenAI 兼容接口
  - name: anthropic-native
    x-group: Anthropic 原生接口
  - name: images-v3
    x-group: 图片（V3 同步）
  - name: volcengine-images
    x-group: 图片（火山直连）
  - name: images
    x-group: 图片（V1 兼容）
  - name: async-images
    x-group: 图片异步任务
  - name: aliwan-images
    x-group: 图片（百炼万相）
  - name: videos
    x-group: 视频
paths:
  /v1/images/aliwan:
    post:
      tags:
        - aliwan-images
      summary: 阿里百炼万相 2.7 图片生成
      description: |
        调用阿里云百炼万相 2.7（`wan2.7-image-pro`）的同步图片生成接口。
        单次请求生成 1 张，按张计费。
        上游官方 OSS 临时 URL 直接透传，官方保留约 24 小时，请及时下载。

        [查看使用指南](/guides/aliwan-wan27)
      operationId: createAliwanImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AliwanImageGenerationRequest'
            examples:
              textOnly:
                summary: 文生图
                value:
                  model: wan2.7-image-pro
                  prompt: 一朵七色花，通透花瓣，纯色背景，质感细腻
                  size: 2K
              withReference:
                summary: 参考图生成
                value:
                  model: wan2.7-image-pro
                  prompt: 保留主体，将背景替换为星空场景
                  size: 2K
                  image:
                    - https://example.com/subject.png
              withWatermark:
                summary: 带水印
                value:
                  model: wan2.7-image-pro
                  prompt: 产品宣传海报，商务风格
                  size: 1920*1080
                  watermark: true
      responses:
        '200':
          description: 图片生成成功，返回结果图 URL。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AliwanImageGenerationResponse'
              examples:
                success:
                  value:
                    created: 1784125568
                    data:
                      - url: >-
                          https://dashscope-7c2c.oss-accelerate.aliyuncs.com/example.png
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientQuota'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    AliwanImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: 平台模型调用 ID，平台会按当前模型配置完成实际调用。
          example: wan2.7-image-pro
        prompt:
          type: string
          description: 图片生成提示词，不能为空。
          example: 一朵七色花，通透花瓣，纯色背景，质感细腻
        'n':
          type: integer
          description: 生成图片数量，当前只允许 1，不传时默认为 1。
          minimum: 1
          maximum: 1
          default: 1
        size:
          type: string
          description: >-
            可选。① 档位：1K / 2K（默认）/ 4K（仅文生图）

            ② 像素：1920*1080 或 1920x1080（总像素在 [768*768, 4096*4096]，宽高比范围 [1:8,
            8:1]）。

            当前各规格同价。
          example: 2K
        seed:
          type: integer
          description: 随机种子；如需复现效果可传整数。
        watermark:
          type: boolean
          description: 是否添加水印；不传时使用官方默认 false。
          default: false
        image:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
              maxItems: 9
          description: 参考图片 URL 或图片 Data URI；数组最多 9 张。图片大小由官方接口校验。
      additionalProperties: false
    AliwanImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: 响应创建时间戳（Unix 秒）。
        data:
          type: array
          description: 生成图片结果列表，单次请求最多 1 张。
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
                description: 图片 URL（OSS 临时链接，官方保留约 24 小时，请及时下载）。
              b64_json:
                type: string
                description: 当官方返回 Base64 图片时返回该字段。
        error:
          type: object
          description: 请求失败时返回错误对象；官方接口返回的参数错误会返回给调用方。
          properties:
            code:
              type: string
            message:
              type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              example: model_endpoint_mismatch
            message:
              type: string
              example: 该模型不支持当前 endpoint。
  responses:
    BadRequest:
      description: 请求参数无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API Key 缺失或无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InsufficientQuota:
      description: 余额或额度不足。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: 模型不可见、API Key 无权限或档位不可用。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      x-default: sk-your-api-key

````