openapi: 3.0.0
info:
  title: 悠船开放平台
  version: 1.1.0
servers:
  - url: https://ali.youchuan.cn
security:
  - x-youchuan-app: []
    x-youchuan-secret: []
tags:
  - name: 图片生成
    description: 悠船AI图片生成接口，包括文生图、图生图、背景移除等功能(需提供有效的授权信息)
  - name: 账户管理
    description: 悠船账户管理相关接口，包括费用查询、用量统计等功能（需提供有效的授权信息）
  - name: Moodboard
    description: 悠船灵感看板管理接口，支持创建、更新和获取Moodboard（需提供有效的授权信息）
  - name: 视频生成
    description: 悠船AI视频生成接口，包括视频生成、视频编辑等功能(需提供有效的授权信息)
paths:
  /v1/tob/callback:
    post:
      tags:
        - 图片生成
      summary: 通知示例
      operationId: api_TestCallback
      requestBody:
        description: 任务的详细信息描述
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1Job'
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/cost-monthly:
    get:
      tags:
        - 账户管理
      summary: 按计费周期列举消耗详情
      operationId: api_ListCostMonthly
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
        - name: pageNo
          in: query
          description: 页码[1-1000]
          required: true
          schema:
            type: integer
            format: int64
        - name: pageSize
          in: query
          description: 每页数据量[1-500]
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ListCostMonthlyResp'
  /v1/tob/costs:
    get:
      tags:
        - 账户管理
      summary: 查询任务消耗历史记录
      operationId: api_ListJobCosts
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
        - name: pageNo
          in: query
          description: 页码[1-1000]
          required: true
          schema:
            type: integer
            format: int64
        - name: pageSize
          in: query
          description: 每页数据量[1-500]
          required: true
          schema:
            type: integer
            format: int64
        - name: since
          in: query
          description: 起始时间
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: 结束时间
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ListJobCostsResp'
  /v1/tob/diffusion:
    post:
      tags:
        - 图片生成
      summary: 文生图
      operationId: api_Diffusion
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: DiffusionReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1DiffusionReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 无效Prompt参数
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 400
                  message: 无效Prompt参数
                  reason: Invalid_Prompt_Parameter
        '401':
          description: 无效App身份
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 401
                  message: 无效App身份
                  reason: Invalid_App_Identifier
        '402':
          description: 账户余额不足
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 402
                  message: 账户余额不足[,Relax模式已用完]
                  reason: Account_Fee_Not_Enough[,No_More_Relax_Credit]
        '403':
          description: Prompt包含敏感词汇
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 403
                  message: Prompt包含敏感词汇
                  reason: Msg_Sensitive
        '429':
          description: 已达当前套餐最大并发
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 429
                  message: 已达当前套餐最大并发
                  reason: Max_Concurrent_Limited
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 500
                  message: 服务器内部错误
                  reason: Internal_Server_Error
  /v1/tob/edit:
    post:
      tags:
        - 图片生成
      summary: 编辑
      operationId: api_Edit
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: RepaintReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1RepaintReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/inpaint:
    post:
      tags:
        - 图片生成
      summary: 区域重绘
      operationId: api_Inpaint
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: InpaintReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1InpaintReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/job/{jobId}:
    get:
      tags:
        - 账户管理
      summary: 查询任务信息
      operationId: api_QueryJob
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
        - name: jobId
          in: path
          description: 任务ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/moodboard:
    post:
      tags:
        - Moodboard
      summary: 创建Moodboard
      operationId: api_CreateMoodboard
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: CreateMoodboardReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1CreateMoodboardReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Moodboard'
  /v1/tob/moodboard/{id}:
    put:
      tags:
        - Moodboard
      summary: 更新Moodboard
      operationId: api_UpdateMoodboard
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
        - name: id
          in: path
          description: moodboard id, 可在生图任务中以--p方式引用
          required: true
          schema:
            type: string
      requestBody:
        description: UpdateMoodboardReq
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - images
              properties:
                images:
                  description: 图片URL数组, 最多30张图片
                  type: array
                  items:
                    type: string
                tag:
                  description: 用于标识
                  type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Moodboard'
  /v1/tob/moodboards:
    get:
      tags:
        - Moodboard
      summary: 获取Moodboard列表
      operationId: api_ListMoodboards
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
        - name: pageNo
          in: query
          description: 页码[1-1000]
          required: true
          schema:
            type: integer
            format: int64
        - name: pageSize
          in: query
          description: 每页数据量[1-500]
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ListMoodboardsResp'
  /v1/tob/outpaint:
    post:
      tags:
        - 图片生成
      summary: 扩图
      operationId: api_Outpaint
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: OutpaintReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1OutpaintReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/pan:
    post:
      tags:
        - 图片生成
      summary: 延展（单方向）
      operationId: api_Pan
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: PanReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1PanReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/remix:
    post:
      tags:
        - 图片生成
      summary: 重塑
      operationId: api_Remix
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: RemixReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1RemixReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/remove-background:
    post:
      tags:
        - 图片生成
      summary: 移除背景
      operationId: api_RemoveBackground
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: RemoveBackgroundReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1RemoveBackgroundReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/reroll:
    post:
      tags:
        - 图片生成
      summary: 重新执行任务
      operationId: api_Reroll
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: RerollReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1RerollReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/retexture:
    post:
      tags:
        - 图片生成
      summary: 转绘
      operationId: api_Retexture
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: RetextureReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1RetextureReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/subscribe:
    get:
      tags:
        - 账户管理
      summary: 获取当前账户信息
      operationId: api_GetSubscribe
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Subscribe'
  /v1/tob/upload-paint:
    post:
      tags:
        - 图片生成
      summary: 高级编辑
      operationId: api_Uploadpaint
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: UploadpaintReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1UploadpaintReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
  /v1/tob/upscale:
    post:
      tags:
        - 图片生成
      summary: 高清
      operationId: api_Upscale
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: UpscaleReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1UpscaleReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 高清任务不支持再次高清
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 400
                  message: 高清任务不支持再次高清
                  reason: Job_ReUpscale_Not_Support
        '401':
          description: 无效App身份
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 401
                  message: 无效App身份
                  reason: Invalid_App_Identifier
        '402':
          description: 账户余额不足
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 402
                  message: 账户余额不足[,Relax模式已用完]
                  reason: Account_Fee_Not_Enough[,No_More_Relax_Credit]
        '403':
          description: 高清任务不支持此操作
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 403
                  message: 高清任务不支持此操作
                  reason: Upscale_Not_Support
        '429':
          description: 已达当前套餐最大并发
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 429
                  message: 已达当前套餐最大并发
                  reason: Max_Concurrent_Limited
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 500
                  message: 服务器内部错误
                  reason: Internal_Server_Error
  /v1/tob/variation:
    post:
      tags:
        - 图片生成
      summary: 变化
      operationId: api_Variation
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: VariationReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1VariationReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '405':
          description: Not_Support
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  reason:
                    type: string
                example:
                  code: 405
                  message: 【高级编辑/转绘】任务仅支持【高清】
                  reason: Not_Support
  /v1/tob/enhance:
    post:
      tags:
        - 图片生成
      summary: 增强
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1EnhanceReq'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 无效请求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
  /v1/tob/video-diffusion:
    post:
      tags:
        - 视频生成
      summary: 图生视频
      operationId: api_VideoDiffusion
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: VideoDiffusionReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1VideoDiffusionReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 无效Prompt参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '401':
          description: 无效App身份
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '402':
          description: 账户余额不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '403':
          description: Prompt包含敏感词汇
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '429':
          description: 已达当前套餐最大并发
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
  /v1/tob/extend-video:
    post:
      tags:
        - 视频生成
      summary: 视频延长
      operationId: api_VideoExtend
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: VideoExtendReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1VideoExtendReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 无效Prompt参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '401':
          description: 无效App身份
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '402':
          description: 账户余额不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '403':
          description: Prompt包含敏感词汇
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '405':
          description: 视频最多可扩展4次
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '429':
          description: 已达当前套餐最大并发
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
  /v1/tob/video-upscale:
    post:
      tags:
        - 视频生成
      summary: 视频高清
      operationId: api_VideoUpscale
      parameters:
        - in: header
          name: x-youchuan-secret
          required: true
          schema:
            type: string
          example: "{{x-youchuan-secret}}"
        - in: header
          name: x-youchuan-app
          required: true
          schema:
            type: string
          example: "{{x-youchuan-app}}"
      requestBody:
        description: VideoUpscaleReq
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1VideoUpscaleReq'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Job'
        '400':
          description: 无效请求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1ErrorResponse'
components: 
  schemas:
    v1Canvas:
      type: object
      properties:
        height:
          description: 像素高
          type: integer
          format: int32
        width:
          description: 像素宽
          type: integer
          format: int32
    v1CanvasImg:
      type: object
      properties:
        height:
          description: 像素高
          type: integer
          format: int32
        width:
          description: 像素宽
          type: integer
          format: int32
        x:
          description: 相对画布左上角水平位移
          type: integer
          format: int32
        y:
          description: 相对画布左上角垂直位移
          type: integer
          format: int32
    v1CostMonth:
      type: object
      properties:
        feeCost:
          description: 费用消耗值(单位分)
          type: number
          format: double
        plan:
          description: 套餐
          $ref: '#/components/schemas/v1Plan'
        relaxCost:
          description: relax任务消耗值(单位次)
          type: number
          format: double
        termEnd:
          description: 计费周期结束时间
          type: string
          format: date-time
        termStart:
          description: 计费周期开始时间
          type: string
          format: date-time
    v1CreateMoodboardReq:
      description: CreateMoodboardReq
      type: object
      required:
        - images
      properties:
        images:
          description: 图片URL数组, 最多500张图片
          type: array
          items:
            type: string
        tag:
          description: 用于标识（非必需，默认同id)
          type: string
    v1DiffusionReq:
      description: DiffusionReq
      type: object
      required:
        - text
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        text:
          description: 文本信息，长度[1-8192]
          type: string
    v1InpaintReq:
      description: InpaintReq
      type: object
      required:
        - jobId
        - imageNo
        - mask
      properties:
        area:
          description: 绘制区域
          $ref: '#/components/schemas/v1Polygon'
        callback:
          description: 任务结果回调通知接口
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        mask:
          description: 绘制区域(对area参数的补充，支持多区域重绘)
          $ref: '#/components/schemas/v1Mask'
        remixPrompt:
          description: 重绘区域提示词, 长度[1-8192]
          type: string
    v1Job:
      description: 任务的详细信息描述
      type: object
      properties:
        audits:
          description: 图片审核结果；与urls按照数组下标对应，空代表审核通过
          type: array
          items:
            type: string
        comment:
          description: 任务状态详细描述
          type: string
        cost:
          description: GPU/费用消耗额度
          $ref: '#/components/schemas/v1JobCost'
        id:
          description: 任务ID
          type: string
        seed:
          description: 种子值
          type: integer
          format: int64
        status:
          description: 任务状态
          $ref: '#/components/schemas/v1JobStatus'
        text:
          description: 文本，长度[1-8192]
          type: string
        urls:
          description: 图片URL数组;若单个url为空代表审核未通过,原因参考audits字段的同下标元素
          type: array
          items:
            type: string
    v1JobCost:
      type: object
      properties:
        costAt:
          description: 消费时间
          type: string
          format: date-time
        fastCost:
          description: 计费系数
          type: number
          format: double
        feeCost:
          description: 费用消耗值(单位分)
          type: number
          format: double
        jobId:
          description: 任务ID
          type: string
        relaxCost:
          description: 慢速计费系数(暂不开放)
          type: number
          format: double
    v1JobStatus:
      description: |-
        - 0: 新创建
        - 1: 执行中
        - 2: 执行成功
        - 3: 失败
      type: integer
      format: int32
      enum:
        - 0
        - 1
        - 2
        - 3
      default: 0
    v1ListCostMonthlyResp:
      type: object
      properties:
        costs:
          description: 每个计费周期消费详情
          type: array
          items:
            $ref: '#/components/schemas/v1CostMonth'
    v1ListJobCostsResp:
      type: object
      properties:
        costs:
          type: array
          items:
            $ref: '#/components/schemas/v1JobCost'
    v1ListMoodboardsResp:
      type: object
      properties:
        moodboards:
          type: array
          items:
            $ref: '#/components/schemas/v1Moodboard'
        pageNo:
          type: integer
          format: int64
    v1Mask:
      description: 绘制区域(替代area参数，支持多区域重绘)， areas/url 2选1
      type: object
      properties:
        areas:
          description: 多边形区域(支持指定多个区域)
          type: array
          items:
            $ref: '#/components/schemas/v1Polygon'
        url:
          description: 以黑白2值图片指定多边形区域(支持指定多个区域，白色区域为重绘区)
          type: string
    v1Moodboard:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        id:
          description: moodboard id, 可在生图任务中以--p方式引用
          type: string
        images:
          description: 图片URL数组, 最多30张图片
          type: array
          items:
            type: string
        tag:
          description: 用于标识（非必需)
          type: string
        updatedAt:
          type: string
          format: date-time
    v1OutpaintReq:
      description: OutpaintReq
      type: object
      required:
        - jobId
        - imageNo
        - scale
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        remixPrompt:
          description: 扩图区域提示词, 长度[1-8192]
          type: string
        scale:
          description: 扩图目标比例, 即在视图中新图所占区域相较原图区域的倍数，取值范围[1.1-2.0]；例如 一个1:1图片扩图后，外扩20%(scale=1.2)
          type: number
          format: float
    v1PanDirection:
      description: |-
        - 0: 向下
        - 1: 向右
        - 2: 向上
        - 3: 向左
      type: integer
      format: int32
      enum:
        - 0
        - 1
        - 2
        - 3
      default: 0
    v1PanReq:
      description: PanReq
      type: object
      required:
        - jobId
        - imageNo
        - direction
        - scale
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        direction:
          description: 延展方向
          $ref: '#/components/schemas/v1PanDirection'
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        remixPrompt:
          description: 延展区域提示词, 长度[1-8192]
          type: string
        scale:
          description: 延展目标比例,即在延展方向上 视图中新图所占区域相较原图区域的倍数（非像素倍数，是占比比例）, 取值范围[1.1-3.0]；例如 一个 1:1的图片，向右扩13%，则scale=1.13
          type: number
          format: float
    v1Plan:
      type: object
      properties:
        details:
          description: 其它详细描述
          type: array
          items:
            type: string
        fastConcurrentNum:
          description: fast模式任务并发条数
          type: string
          format: uint64
        fastLimit:
          description: fast模式任务条数限制(默认无限制)
          type: string
          format: uint64
        fastOutPlanPerCost:
          description: 套餐外fast模式任务计费(分/条)
          type: string
          format: uint64
        fastPerCost:
          description: fast模式任务计费(分/条)
          type: string
          format: uint64
        id:
          type: string
        minCost:
          description: 每月最低消费(单位分)
          type: string
          format: uint64
        name:
          description: 套餐名
          type: string
        relaxConcurrentNum:
          description: 套餐内relax模式任务并发条数
          type: string
          format: uint64
        relaxLimit:
          description: 套餐内relax模式任务限制
          type: string
          format: uint64
        relaxOutPlanPerCost:
          description: 套餐外relax模式任务计费(分/条)
          type: string
          format: uint64
        relaxPerCost:
          description: 套餐内relax模式任务计费(分/条)
          type: string
          format: uint64
        startupCharge:
          description: 起充额度(单位分)
          type: string
          format: uint64
    v1Polygon:
      description: Polygon
      type: object
      required:
        - width
        - height
        - points
      properties:
        height:
          description: 图片像素高(500-4096)
          type: integer
          format: int32
        points:
          description: 多边形区域(坐标以左上为原点，按顺时针方向、以XYXY的方式组织)
          type: array
          items:
            type: integer
            format: int32
        width:
          description: 图片像素宽(500-4096)
          type: integer
          format: int32
    v1RemixReq:
      description: RemixReq
      type: object
      required:
        - jobId
        - imageNo
        - remixPrompt
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        mode:
          description: remix模式(默认【强烈模式】)
          $ref: '#/components/schemas/v1RemixType'
        remixPrompt:
          description: 新提示词, 长度[1-8192]
          type: string
    v1RemixType:
      description: |-
        - 0: 强烈调整
        - 1: 细微调整
      type: integer
      format: int32
      enum:
        - 0
        - 1
      default: 0
    v1RemoveBackgroundReq:
      description: RemoveBackgroundReq
      type: object
      required:
        - imgUrl
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imgUrl:
          description: 图片url[长度1024]
          type: string
    v1RepaintReq:
      description: RepaintReq
      type: object
      required:
        - jobId
        - imageNo
        - remixPrompt
        - canvas
        - imgPos
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        canvas:
          description: 画布(目标图宽高，此数据用来定位图片的位置，最终图片大小以实际生图为准)
          $ref: '#/components/schemas/v1Canvas'
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        imgPos:
          description: 图片相对画布的坐标及大小
          $ref: '#/components/schemas/v1CanvasImg'
        jobId:
          description: 任务ID
          type: string
        mask:
          description: 原图重绘区域
          $ref: '#/components/schemas/v1Mask'
        remixPrompt:
          description: 提示词
          type: string
    v1RerollReq:
      description: RerollReq
      type: object
      required:
        - jobId
      properties:
        jobId:
          description: 任务ID
          type: string
    v1RetextureReq:
      description: RetextureReq
      type: object
      required:
        - imgUrl
        - remixPrompt
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imgUrl:
          description: 图片url[长度1024]
          type: string
        remixPrompt:
          description: 提示词（目前只支持6.1及以上的模型）
          type: string
    v1Subscribe:
      type: object
      properties:
        curTermCost:
          description: 当前计费周期的费用信息
          $ref: '#/components/schemas/v1TermCost'
        curTermPlan:
          description: 当前套餐信息
          $ref: '#/components/schemas/v1V2Plan'
        currentAvail:
          description: 当前可用余额(分)
          type: number
          format: double
        nextTermPlan:
          description: 下个周期套餐信息
          $ref: '#/components/schemas/v1Plan'
        plan:
          description: 当前套餐信息(已弃用，参考 curTermPlan)
          $ref: '#/components/schemas/v1Plan'
        shouldChargeAt:
          description: 预计下次充值时间(此时间会随费用消耗而变动)
          type: string
          format: date-time
    v1TermCost:
      type: object
      properties:
        endAt:
          description: 套餐周期结束时间
          type: string
          format: date-time
        extraFee:
          description: 套餐外消耗费用，单位(分)
          type: number
          format: float
        pkgFee:
          description: 套餐内消耗费用，单位(分)
          type: number
          format: float
        startAt:
          description: 套餐周期开始时间
          type: string
          format: date-time
    v1UploadpaintReq:
      description: UploadpaintReq
      type: object
      required:
        - imgUrl
        - canvas
        - imgPos
        - remixPrompt
        - mask
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        canvas:
          description: 画布(目标图宽高，此数据用来定位图片的位置，最终图片大小以实际生图为准)
          $ref: '#/components/schemas/v1Canvas'
        imgPos:
          description: 图片相对画布的坐标及大小
          $ref: '#/components/schemas/v1CanvasImg'
        imgUrl:
          description: 图片url[长度1024]
          type: string
        mask:
          description: 原图重绘区域
          $ref: '#/components/schemas/v1Mask'
        remixPrompt:
          description: 提示词
          type: string
    v1UpscaleReq:
      description: UpscaleReq
      type: object
      required:
        - jobId
        - imageNo
        - type
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        type:
          description: 高清类型
          $ref: '#/components/schemas/v1UpscaleType'
    v1UpscaleType:
      description: |-
        - 0: v6/niji6/v6.1/v7 subtle高清
        - 1: v6/niji6/v6.1/v7 creative高清
        - 2: v5/niji5 2倍高清(deprecated)
        - 3: v5/niji5 4倍高清(deprecated)
      type: integer
      format: int32
      enum:
        - 0
        - 1
        - 2
        - 3
      default: 0
    v1V2Plan:
      type: object
      properties:
        ability:
          description: 套餐能力(默认允许全部)
          type: integer
          format: int64
        details:
          description: 其它详细描述
          type: array
          items:
            type: string
        fastConcurrentNum:
          description: fast模式任务并发条数
          type: integer
          format: int64
        fastLimit:
          description: fast模式任务条数限制(默认无限制)
          type: integer
          format: int64
        fastOutPlanPerCost:
          description: 套餐外fast模式任务计费(分/条)
          type: integer
          format: int64
        fastPerCost:
          description: fast模式任务计费(分/条)
          type: integer
          format: int64
        id:
          type: string
        minCost:
          description: 每月最低消费(单位分)
          type: integer
          format: int64
        name:
          description: 套餐名
          type: string
        relaxConcurrentNum:
          description: 套餐内relax模式任务并发条数
          type: integer
          format: int64
        relaxLimit:
          description: 套餐内relax模式任务限制
          type: integer
          format: int64
        relaxOutPlanPerCost:
          description: 套餐外relax模式任务计费(分/条)
          type: integer
          format: int64
        relaxPerCost:
          description: 套餐内relax模式任务计费(分/条)
          type: integer
          format: int64
        startupCharge:
          description: 起充额度(单位分)
          type: integer
          format: int64
    v1VariationReq:
      description: VariationReq
      type: object
      required:
        - jobId
        - imageNo
        - type
      properties:
        callback:
          description: 任务结果回调通知接口
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)
          type: integer
          format: int32
        jobId:
          description: 任务ID
          type: string
        remixPrompt:
          description: 新提示词, 长度[1-8192]
          type: string
        type:
          description: 变换类型
          $ref: '#/components/schemas/v1VaryType'
    v1VaryType:
      description: |-
        - 0: subtle 轻微变换
        - 1: strong 强烈变换
      type: integer
      format: int32
      enum:
        - 0
        - 1
      default: 0
    v1EnhanceReq:
      type: object
      required:
        - jobId
        - imageNo
      properties:
        jobId:
          type: string
          description: 任务ID
        imageNo:
          type: integer
          description: 图片编号(0/1/2/3)
        callback:
          type: string
          description: 任务结果回调通知接口
    v1ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: 错误码
        reason:
          type: string
          description: 错误原因
        message:
          type: string
          description: 错误信息
    v1VideoDiffusionReq:
      description: VideoDiffusionReq - jobId/prompt 二选一
      type: object
      properties:
        jobId:
          description: 任务ID（可选，通过任务ID指定首帧图）
          type: string
        imageNo:
          description: 图片编号(0/1/2/3)（当提供jobId时使用）
          type: integer
          format: int32
          enum: [0, 1, 2, 3]
        prompt:
          description: 视频生成提示文本(可通过图片链接指定首帧图)，长度[1-8192]（与jobId二选一）
          type: string
          minLength: 1
          maxLength: 8192
        callback:
          description: 任务结果回调通知接口
          type: string
          minLength: 1
          maxLength: 2048
        videoType:
          description: 视频类型
          $ref: '#/components/schemas/v1VideoType'
    v1VideoType:
      description: |-
        - 0: 480p
        - 1: 720p
      type: integer
      format: int32
      enum:
        - 0
        - 1
      default: 0
    v1VideoExtendReq:
      description: VideoExtendReq
      type: object
      required:
        - jobId
        - videoNo
      properties:
        jobId:
          description: 任务ID
          type: string
        videoNo:
          description: 视频编号(0/1/2/3)
          type: integer
          format: int32
          enum: [0, 1, 2, 3]
        callback:
          description: 任务结果回调通知接口
          type: string
          minLength: 1
          maxLength: 2048
        prompt:
          description: 视频延长提示文本，长度[1-8192]
          type: string
          minLength: 1
          maxLength: 8192
    v1VideoUpscaleReq:
      type: object
      required:
        - jobId
        - videoNo
      properties:
        jobId:
          description: 任务ID
          type: string
        videoNo:
          description: 视频编号(0/1/2/3)
          type: integer
          format: int32
          enum: [0, 1, 2, 3]
        callback:
          description: 任务结果回调通知接口
          type: string
          minLength: 1
          maxLength: 2048
    
  securitySchemes:
    x-youchuan-app:
      type: apiKey
      name: x-youchuan-app
      in: header
      description: 悠船授权用户app
    x-youchuan-secret:
      type: apiKey
      name: x-youchuan-secret
      in: header
      description: 悠船授权用户secret
