众扬汇 AI 开放平台 API 文档

即梦4 绘图

接口:POST /v1/images/generations 归属:绘图模型/ 豆包(即梦、火山)绘图/即梦4 调用地址:Base URL https://api.allyang.cn(OpenAI 兼容前缀 https://api.allyang.cn/v1)+ 上述路径 鉴权:请求头 Authorization: Bearer <你的令牌>;令牌在控制台「令牌管理」创建 说明:下方为本接口契约。路径、字段名与枚举取值与线上接口一致;叙述文字已按本平台口径重写。价格、并发与限流等数值以控制台及实际返回为准,未确认处标注「待补」。

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/images/generations:
    post:
      summary: 即梦4 绘图
      description: "支持多图参考。"
      tags:
        - 绘图模型/ 豆包(即梦、火山)绘图/即梦4
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
            default: Bearer {{YOUR_API_KEY}}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                prompt:
                  type: string
                image:
                  type: array
                  items:
                    type: string
                  description: "不传即为文生图。"
                sequential_image_generation:
                  type: string
                response_format:
                  type: string
                size:
                  type: string
                stream:
                  type: boolean
                watermark:
                  type: boolean
                'n':
                  type: string
                  description: "组图。"
              required:
                - model
                - prompt
            example:
              model: doubao-seedream-4-0-250828
              prompt: 生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片,涵盖早晨、中午、晚上
              image:
                - >-
                  https://api.allyang.cn/<外部地址已按合规要求移除>
                - >-
                  https://api.allyang.cn/<外部地址已按合规要求移除>
              sequential_image_generation: auto
              'n': 3
              response_format: url
              size: 2K
              stream: true
              watermark: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                  created:
                    type: integer
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                      completion_tokens:
                        type: integer
                      total_tokens:
                        type: integer
                      prompt_tokens_details:
                        type: object
                        properties:
                          cached_tokens_details:
                            type: object
                            properties: {}
                        required:
                          - cached_tokens_details
                      completion_tokens_details:
                        type: object
                        properties: {}
                      output_tokens:
                        type: integer
                    required:
                      - prompt_tokens
                      - completion_tokens
                      - total_tokens
                      - prompt_tokens_details
                      - completion_tokens_details
                      - output_tokens
                required:
                  - data
                  - created
                  - usage
              example:
                data:
                  - url: >-
                      https://api.allyang.cn/<外部地址已按合规要求移除>
                  - url: >-
                      https://api.allyang.cn/<外部地址已按合规要求移除>
                  - url: >-
                      https://api.allyang.cn/<外部地址已按合规要求移除>
                created: 1758200023
                usage:
                  prompt_tokens: 0
                  completion_tokens: 0
                  total_tokens: 53400
                  prompt_tokens_details:
                    cached_tokens_details: {}
                  completion_tokens_details: {}
                  output_tokens: 53400
          headers: {}
      security: []
components:
  schemas: {}
  securitySchemes: {}
servers: []
security: []