components:
  schemas:
    APIError:
      additionalProperties: false
      properties:
        error:
          $ref: "#/components/schemas/ErrorDetail"
      required:
        - error
      type: object
    Asset:
      additionalProperties: false
      properties:
        asset_id:
          type: string
        last_frame_asset_id:
          type: string
        metadata:
          $ref: "#/components/schemas/OutputMetadata"
        outputs:
          items:
            $ref: "#/components/schemas/DeliveredOutput"
          type:
            - array
            - "null"
        voice_id:
          type: string
      type: object
    CashAmount:
      additionalProperties: false
      properties:
        amount_minor:
          description: Original currency amount in integer minor units.
          format: int64
          minimum: 0
          type: integer
        currency:
          enum:
            - USD
            - CNY
          type: string
      required:
        - currency
        - amount_minor
      type: object
    CatalogEntry:
      additionalProperties: false
      properties:
        capabilityVersion:
          type: string
        inputSchema: {}
        modelId:
          type: string
        operation:
          type: string
        pricing:
          $ref: "#/components/schemas/ReferencePricing"
        referenceVideo:
          type: boolean
        routeId:
          type: string
      required:
        - modelId
        - operation
        - routeId
        - capabilityVersion
        - inputSchema
        - pricing
      type: object
    CatalogOutputBody:
      additionalProperties: false
      properties:
        entries:
          items:
            $ref: "#/components/schemas/CatalogEntry"
          type:
            - array
            - "null"
        next_cursor:
          type: string
      required:
        - entries
      type: object
    Charge:
      additionalProperties: false
      properties:
        display_estimates:
          $ref: "#/components/schemas/DisplayEstimates"
          description: Non-authoritative display estimates. Only the credit amount is used for charging.
        price:
          $ref: "#/components/schemas/CreditAmount"
      required:
        - price
      type: object
    CreditAmount:
      additionalProperties: false
      properties:
        amount:
          pattern: ^(0|[1-9][0-9]*)[.][0-9]{3}$
          type: string
        unit:
          enum:
            - credit
          type: string
      required:
        - unit
        - amount
      type: object
    CustomerGenerationEvent:
      additionalProperties: false
      properties:
        billing_status:
          type: string
        closed_status:
          type: string
        created_at:
          format: date-time
          type: string
        delivery_status:
          type: string
        error_code:
          type: string
        event_id:
          type: string
        execution_status:
          type: string
        free:
          type: boolean
        late_result_available:
          type: boolean
        result:
          anyOf:
            - $ref: "#/components/schemas/CustomerGenerationEventResultStruct"
            - type: "null"
        task_id:
          type: string
        type:
          enum:
            - generation.succeeded
            - generation.failed
            - generation.canceled
            - generation.unresolved
            - generation.refunded
            - generation.late_result_available
          type: string
        version:
          format: int64
          type: integer
      required:
        - event_id
        - type
        - created_at
        - task_id
        - version
        - execution_status
        - delivery_status
        - billing_status
        - closed_status
        - late_result_available
        - free
        - result
      type: object
    CustomerGenerationEventResultStruct:
      additionalProperties: false
      properties:
        asset_id:
          type: string
      required:
        - asset_id
      type: object
    CustomerWebhookTest:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        event_id:
          type: string
        test:
          type: boolean
        type:
          enum:
            - webhook.test
          type: string
      required:
        - event_id
        - type
        - created_at
        - test
      type: object
    DeliveredOutput:
      additionalProperties: false
      properties:
        asset_id:
          type: string
        content_type:
          type: string
        index:
          format: int64
          type: integer
      required:
        - index
        - asset_id
        - content_type
      type: object
    DisplayEstimate:
      additionalProperties: false
      properties:
        amount:
          pattern: ^(0|[1-9][0-9]*)([.][0-9]+)?$
          type: string
        basis:
          enum:
            - nominal_usd
            - current_standard_pack
          type: string
        pack_price_version:
          type: string
        quoted_at:
          format: date-time
          type: string
        status:
          enum:
            - available
            - unavailable
          type: string
        tax_included:
          enum:
            - false
          type: boolean
      required:
        - status
        - tax_included
      type: object
    DisplayEstimates:
      additionalProperties: false
      properties:
        cny:
          $ref: "#/components/schemas/DisplayEstimate"
        usd:
          $ref: "#/components/schemas/DisplayEstimate"
      required:
        - usd
        - cny
      type: object
    Download:
      additionalProperties: false
      properties:
        url:
          type: string
        url_expires_at:
          format: date-time
          type: string
      required:
        - url
        - url_expires_at
      type: object
    Entry:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        credits:
          type: string
        from:
          type: string
        id:
          type: string
        reference:
          type: string
        to:
          type: string
      required:
        - id
        - reference
        - from
        - to
        - credits
        - created_at
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
        request_id:
          type: string
        retryable:
          type: boolean
        task_id:
          type: string
      required:
        - code
        - message
        - retryable
        - request_id
      type: object
    FAQ:
      additionalProperties: false
      properties:
        a:
          type: string
        q:
          type: string
      required:
        - q
        - a
      type: object
    GenerationError:
      additionalProperties: false
      properties:
        code:
          type: string
      required:
        - code
      type: object
    GenerationPage:
      additionalProperties: false
      properties:
        entries:
          items:
            $ref: "#/components/schemas/View"
          type:
            - array
            - "null"
        next_cursor:
          type: string
      required:
        - entries
      type: object
    Locale:
      additionalProperties: false
      properties:
        code:
          type: string
        label:
          type: string
        urlPrefix:
          type: string
      required:
        - code
        - label
        - urlPrefix
      type: object
    MediaPart:
      additionalProperties: false
      properties:
        asset_id:
          type: string
        draft_generation_id:
          type: string
        role:
          type: string
        text:
          type: string
        type:
          type: string
        url:
          type: string
      required:
        - type
      type: object
    Metadata:
      additionalProperties: false
      properties:
        mime:
          type: string
        sha256:
          type: string
        size_bytes:
          format: int64
          type: integer
      required:
        - size_bytes
        - sha256
        - mime
      type: object
    ModelPage:
      additionalProperties: false
      properties:
        descriptionMd:
          type: string
        faq:
          items:
            $ref: "#/components/schemas/FAQ"
          type:
            - array
            - "null"
        featured:
          type: boolean
        locale:
          type: string
        modelId:
          type: string
        revision:
          format: int64
          type: integer
        samples:
          items:
            $ref: "#/components/schemas/Sample"
          type:
            - array
            - "null"
        sortOrder:
          format: int64
          type: integer
        summary:
          type: string
      required:
        - modelId
        - locale
        - revision
        - summary
        - descriptionMd
        - samples
        - faq
        - sortOrder
        - featured
      type: object
    ModerationOptions:
      additionalProperties: false
      properties:
        ips:
          items:
            type: string
          type:
            - array
            - "null"
      required:
        - ips
      type: object
    OfficialRate:
      additionalProperties: false
      properties:
        amount:
          type: string
        asOf:
          type: string
        components:
          items:
            $ref: "#/components/schemas/RateComponent"
          type:
            - array
            - "null"
        currency:
          type: string
        officialListUrl:
          type: string
        taxBasis:
          type: string
        unit:
          type: string
      required:
        - officialListUrl
        - asOf
      type: object
    OutputMetadata:
      additionalProperties: false
      properties:
        duration:
          format: int64
          type: integer
        frames:
          format: int64
          type: integer
        framespersecond:
          format: int64
          type: integer
        generate_audio:
          type: boolean
        ratio:
          type: string
        resolution:
          type: string
        seed:
          format: int64
          type: integer
      type: object
    Page:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/Entry"
          type:
            - array
            - "null"
        next_cursor:
          type: string
      required:
        - items
      type: object
    PageInfo:
      additionalProperties: false
      properties:
        next_cursor:
          type: string
      type: object
    Price:
      additionalProperties: false
      properties:
        charged:
          type: string
        price_version:
          type: string
        quoted:
          type: string
        reserved:
          type: string
        unit:
          enum:
            - credit
          type: string
      required:
        - price_version
        - reserved
        - unit
        - quoted
        - charged
      type: object
    PriceComparison:
      additionalProperties: false
      properties:
        official:
          $ref: "#/components/schemas/OfficialRate"
        officialRequestAmount:
          type: string
        ourAmount:
          type: string
        referencePack:
          $ref: "#/components/schemas/ReferencePack"
        savingsPercent:
          type: string
      required:
        - official
      type: object
    PublicPack:
      additionalProperties: false
      properties:
        currency:
          type: string
        packId:
          type: string
        principalMinor:
          format: int64
          type: integer
        purchasedCredits:
          type: string
        version:
          type: string
      required:
        - packId
        - currency
        - version
        - principalMinor
        - purchasedCredits
      type: object
    QuoteInput:
      additionalProperties: false
      properties:
        aspect_ratio:
          type: string
        asset_id:
          maxLength: 128
          type: string
        duration_seconds:
          format: int64
          minimum: -1
          type: integer
        generate_audio:
          type: boolean
        native: {}
        prompt:
          maxLength: 4000
          minLength: 1
          type: string
        resolution:
          type: string
        source_generation_id:
          maxLength: 128
          type: string
        video:
          $ref: "#/components/schemas/VideoOptions"
      type: object
    RateComponent:
      additionalProperties: false
      properties:
        condition:
          type: string
        currency:
          type: string
        maxAmount:
          type: string
        minAmount:
          type: string
        name:
          type: string
        taxBasis:
          type: string
        unit:
          type: string
      required:
        - name
        - minAmount
        - maxAmount
        - currency
        - unit
        - taxBasis
        - condition
      type: object
    ReferencePack:
      additionalProperties: false
      properties:
        currency:
          type: string
        id:
          type: string
        principalMinor:
          type: string
        purchasedUnits:
          type: string
        taxBasis:
          type: string
        version:
          type: string
      required:
        - id
        - version
        - currency
        - principalMinor
        - purchasedUnits
        - taxBasis
      type: object
    ReferencePricing:
      additionalProperties: false
      properties:
        asOf:
          format: date-time
          type: string
        cny:
          $ref: "#/components/schemas/DisplayEstimate"
        comparison:
          $ref: "#/components/schemas/PriceComparison"
        credits:
          type: string
        kind:
          type: string
        priceVersion:
          type: string
        usd:
          $ref: "#/components/schemas/DisplayEstimate"
      required:
        - kind
        - credits
        - usd
        - cny
        - priceVersion
        - asOf
      type: object
    Request:
      additionalProperties: false
      properties:
        input:
          $ref: "#/components/schemas/QuoteInput"
        metadata:
          additionalProperties:
            type: string
          type: object
        model:
          minLength: 1
          type: string
        operation:
          enum:
            - text-to-video
            - image-to-video
            - reference-to-video
            - video-edit
            - video-extend
            - video-draft
            - draft-to-video
            - generate-image
            - generate-audio
            - clone-voice
            - generate-video
            - process-video
          type: string
        quote_id:
          minLength: 1
          type: string
        routing:
          $ref: "#/components/schemas/Routing"
        webhook_endpoint_id:
          type: string
      required:
        - model
        - operation
        - input
      type: object
    Routing:
      additionalProperties: false
      properties:
        mode:
          enum:
            - pinned
          type: string
        route:
          minLength: 1
          type: string
      required:
        - mode
        - route
      type: object
    Sample:
      additionalProperties: false
      properties:
        credits:
          type: string
        kind:
          enum:
            - video
            - image
            - audio
          type: string
        mediaUrl:
          type: string
        operation:
          type: string
        posterUrl:
          type: string
        prompt:
          type: string
        spec:
          type: string
      required:
        - kind
        - mediaUrl
        - prompt
        - spec
        - operation
      type: object
    SiteExport:
      additionalProperties: false
      properties:
        catalogUrl:
          type: string
        catalogVersion:
          type: string
        formatVersion:
          format: int64
          type: integer
        generatedAt:
          format: date-time
          type: string
        locales:
          items:
            $ref: "#/components/schemas/Locale"
          type:
            - array
            - "null"
        modelPages:
          additionalProperties:
            additionalProperties:
              $ref: "#/components/schemas/ModelPage"
            type: object
          type: object
        packs:
          items:
            $ref: "#/components/schemas/PublicPack"
          type:
            - array
            - "null"
        referencePacks:
          additionalProperties:
            $ref: "#/components/schemas/SiteReferencePack"
          type: object
      required:
        - formatVersion
        - generatedAt
        - catalogVersion
        - catalogUrl
        - locales
        - packs
        - referencePacks
        - modelPages
      type: object
    SiteReferencePack:
      additionalProperties: false
      properties:
        packId:
          type: string
        version:
          type: string
      required:
        - packId
        - version
      type: object
    Upload:
      additionalProperties: false
      properties:
        asset_id:
          type: string
        upload_url:
          type: string
        url_expires_at:
          format: date-time
          type: string
      required:
        - asset_id
        - upload_url
        - url_expires_at
      type: object
    UploadRequest:
      additionalProperties: false
      properties:
        max_bytes:
          format: int64
          maximum: 20000000
          minimum: 1
          type: integer
        mime:
          enum:
            - image/png
            - image/jpeg
            - image/webp
            - video/mp4
            - audio/mpeg
            - audio/wav
          type: string
      required:
        - mime
        - max_bytes
      type: object
    VideoOptions:
      additionalProperties: false
      properties:
        bitrate_mode:
          type: string
        content:
          items:
            $ref: "#/components/schemas/MediaPart"
          type:
            - array
            - "null"
        draft:
          type: boolean
        execution_expires_after:
          format: int64
          type: integer
        moderation_options:
          $ref: "#/components/schemas/ModerationOptions"
        omni_reference_task_type:
          type: string
        output_format:
          type: string
        return_last_frame:
          type: boolean
        safety_identifier:
          type: string
        seed:
          format: int64
          type: integer
        tools:
          items:
            $ref: "#/components/schemas/VideoTool"
          type:
            - array
            - "null"
        watermark:
          type: boolean
      type: object
    VideoTool:
      additionalProperties: false
      properties:
        type:
          type: string
      required:
        - type
      type: object
    View:
      additionalProperties: false
      properties:
        allowed_actions:
          items:
            type: string
          type:
            - array
            - "null"
        billing_status:
          type: string
        closed_at:
          format: date-time
          type:
            - string
            - "null"
        customer_resolution_deadline:
          format: date-time
          type: string
        delivery_status:
          type: string
        error:
          anyOf:
            - $ref: "#/components/schemas/GenerationError"
            - type: "null"
        execution_status:
          type: string
        id:
          type: string
        late_result_available:
          type: boolean
        metadata:
          additionalProperties:
            type: string
          type: object
        price:
          $ref: "#/components/schemas/Price"
        result:
          anyOf:
            - $ref: "#/components/schemas/Asset"
            - type: "null"
        status:
          type: string
        version:
          format: int64
          type: integer
      required:
        - id
        - status
        - execution_status
        - delivery_status
        - billing_status
        - version
        - price
        - allowed_actions
        - customer_resolution_deadline
        - closed_at
        - late_result_available
        - error
        - result
      type: object
    Wallet:
      additionalProperties: false
      properties:
        available:
          type: string
        held:
          type: string
        paid_available:
          type: string
        promotional_available:
          type: string
        refund_reserved:
          type: string
        total:
          type: string
        unit:
          enum:
            - credit
          type: string
      required:
        - unit
        - available
        - held
        - refund_reserved
        - total
        - paid_available
        - promotional_available
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
info:
  title: VizoAPI
  version: v1
openapi: 3.1.0
paths:
  /site/v1/export.json:
    get:
      operationId: getSiteExport
      parameters:
        - in: header
          name: If-None-Match
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SiteExport"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
            ETag:
              schema:
                type: string
        "304":
          description: The export matches If-None-Match.
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      tags:
        - Site
  /v1/assets/uploads:
    post:
      operationId: createAssetUpload
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UploadRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Upload"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Assets
  /v1/assets/{id}:
    delete:
      operationId: deleteAsset
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "202":
          description: Accepted
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Assets
  /v1/assets/{id}/complete:
    post:
      operationId: completeAssetUpload
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Metadata"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Assets
  /v1/assets/{id}/download:
    get:
      operationId: downloadAsset
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Download"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Assets
  /v1/generations:
    get:
      operationId: listGenerations
      parameters:
        - explode: false
          in: query
          name: limit
          schema:
            default: 50
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - explode: false
          in: query
          name: client_reference
          schema:
            maxLength: 256
            type: string
        - explode: false
          in: query
          name: cursor
          schema:
            maxLength: 64
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenerationPage"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Payment Required
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "429":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Too Many Requests
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Generations
    post:
      description: Each accepted POST durably records a separate generation. While pending_funding the reserved amount is zero. Funding success queues the job; check its status for a funding rejection. Submitting the same request twice can incur two charges. After a lost response, check the generation list before deciding to create another task.
      operationId: createGeneration
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Request"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/View"
          description: Accepted
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Payment Required
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "429":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Too Many Requests
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Generations
  /v1/generations/{id}:
    get:
      operationId: getGeneration
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/View"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Payment Required
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "429":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Too Many Requests
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Generations
  /v1/generations/{id}/cancel:
    post:
      operationId: cancelGeneration
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/View"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Payment Required
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      tags:
        - Generations
  /v1/ledger:
    get:
      operationId: listLedger
      parameters:
        - explode: false
          in: query
          name: cursor
          schema:
            maxLength: 19
            type: string
        - explode: false
          in: query
          name: limit
          schema:
            default: 50
            format: int64
            maximum: 100
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Bad Request
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      summary: listLedger
      tags:
        - Billing
  /v1/models:
    get:
      operationId: listModels
      parameters:
        - explode: false
          in: query
          name: limit
          schema:
            default: 50
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - explode: false
          in: query
          name: cursor
          schema:
            maxLength: 64
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogOutputBody"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      summary: List accessible model specifications
      tags:
        - Models
  /v1/models/{id}:
    get:
      operationId: getModel
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogOutputBody"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      summary: Read accessible specifications for one model
      tags:
        - Models
  /v1/wallet:
    get:
      operationId: getWallet
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Wallet"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Bad Request
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unauthorized
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Forbidden
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Not Found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Conflict
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Unprocessable Entity
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Internal Server Error
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/APIError"
          description: Service Unavailable
      security:
        - bearerAuth: []
      summary: getWallet
      tags:
        - Billing
webhooks:
  generationEvent:
    post:
      description: Verify Base64(HMAC-SHA256(signing secret, timestamp + '.' + event_id + '.' + raw_body)) with a constant-time comparison and a five-minute Unix timestamp window. Deduplicate by event_id. Redelivery preserves the body and event_id.
      operationId: generationEvent
      parameters:
        - in: header
          name: X-Relay-Key-ID
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Event-ID
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Timestamp
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Signature
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomerGenerationEvent"
        required: true
      responses:
        2XX:
          description: Delivery accepted
  webhookTest:
    post:
      description: Verify Base64(HMAC-SHA256(signing secret, timestamp + '.' + event_id + '.' + raw_body)) with a constant-time comparison and a five-minute Unix timestamp window. Deduplicate by event_id. Redelivery preserves the body and event_id.
      operationId: webhookTest
      parameters:
        - in: header
          name: X-Relay-Key-ID
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Event-ID
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Timestamp
          required: true
          schema:
            type: string
        - in: header
          name: X-Relay-Signature
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomerWebhookTest"
        required: true
      responses:
        2XX:
          description: Delivery accepted
