openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/text-video-image-video-generator
info:
  title: Fast Text-to-Video & Image-to-Video API (Pyramid Flow)
  description: Generate high-quality AI videos from text or images in seconds with
    Pyramid Flows advanced autoregressive video generationperfect for content
    creation and rap
  version: 6c9132aee14409cd6568d030453f1ba50f5f3412b844fe67f78a9eb62d55664f
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            properties:
              loc:
                items:
                  anyOf:
                    - type: string
                    - type: integer
                title: Location
                type: array
              msg:
                title: Message
                type: string
              type:
                title: Error Type
                type: string
            required:
              - loc
              - msg
              - type
            title: ValidationError
            type: object
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Input:
      properties:
        embedded_guidance_scale:
          default: 6
          description: Guidance scale
          maximum: 10
          minimum: 1
          title: Embedded Guidance Scale
          type: number
          x-order: 5
          example: 6
        fps:
          default: 24
          description: Frames per second of the output video
          minimum: 1
          title: Fps
          type: integer
          x-order: 6
          example: 24
        height:
          default: 480
          description: Height of the video in pixels (must be divisible by 16)
          maximum: 1280
          minimum: 16
          title: Height
          type: integer
          x-order: 2
          example: 480
        infer_steps:
          default: 50
          description: Number of denoising steps
          minimum: 1
          title: Infer Steps
          type: integer
          x-order: 4
          example: 50
        prompt:
          default: A cat walks on the grass, realistic style
          description: The prompt to guide the video generation
          title: Prompt
          type: string
          x-order: 0
          example: A cat walks on the grass, realistic style
        seed:
          description: Random seed (leave empty for random)
          title: Seed
          type: integer
          x-order: 7
          example: 1
        video_length:
          default: 129
          description: "Number of frames to generate (must be 4k+1, ex: 49 or 129)"
          maximum: 200
          minimum: 1
          title: Video Length
          type: integer
          x-order: 3
          example: 129
        width:
          default: 864
          description: Width of the video in pixels (must be divisible by 16)
          maximum: 1280
          minimum: 16
          title: Width
          type: integer
          x-order: 1
          example: 864
      title: Input
      type: object
    Output:
      format: uri
      title: Output
      type: string
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            embedded_guidance_scale:
              default: 6
              description: Guidance scale
              maximum: 10
              minimum: 1
              title: Embedded Guidance Scale
              type: number
              x-order: 5
            fps:
              default: 24
              description: Frames per second of the output video
              minimum: 1
              title: Fps
              type: integer
              x-order: 6
            height:
              default: 480
              description: Height of the video in pixels (must be divisible by 16)
              maximum: 1280
              minimum: 16
              title: Height
              type: integer
              x-order: 2
            infer_steps:
              default: 50
              description: Number of denoising steps
              minimum: 1
              title: Infer Steps
              type: integer
              x-order: 4
            prompt:
              default: A cat walks on the grass, realistic style
              description: The prompt to guide the video generation
              title: Prompt
              type: string
              x-order: 0
            seed:
              description: Random seed (leave empty for random)
              title: Seed
              type: integer
              x-order: 7
            video_length:
              default: 129
              description: "Number of frames to generate (must be 4k+1, ex: 49 or 129)"
              maximum: 200
              minimum: 1
              title: Video Length
              type: integer
              x-order: 3
            width:
              default: 864
              description: Width of the video in pixels (must be divisible by 16)
              maximum: 1280
              minimum: 16
              title: Width
              type: integer
              x-order: 1
          title: Input
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: PredictionRequest
      type: object
    PredictionResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            embedded_guidance_scale:
              default: 6
              description: Guidance scale
              maximum: 10
              minimum: 1
              title: Embedded Guidance Scale
              type: number
              x-order: 5
            fps:
              default: 24
              description: Frames per second of the output video
              minimum: 1
              title: Fps
              type: integer
              x-order: 6
            height:
              default: 480
              description: Height of the video in pixels (must be divisible by 16)
              maximum: 1280
              minimum: 16
              title: Height
              type: integer
              x-order: 2
            infer_steps:
              default: 50
              description: Number of denoising steps
              minimum: 1
              title: Infer Steps
              type: integer
              x-order: 4
            prompt:
              default: A cat walks on the grass, realistic style
              description: The prompt to guide the video generation
              title: Prompt
              type: string
              x-order: 0
            seed:
              description: Random seed (leave empty for random)
              title: Seed
              type: integer
              x-order: 7
            video_length:
              default: 129
              description: "Number of frames to generate (must be 4k+1, ex: 49 or 129)"
              maximum: 200
              minimum: 1
              title: Video Length
              type: integer
              x-order: 3
            width:
              default: 864
              description: Width of the video in pixels (must be divisible by 16)
              maximum: 1280
              minimum: 16
              title: Width
              type: integer
              x-order: 1
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          format: uri
          title: Output
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: PredictionResponse
      type: object
    Status:
      description: An enumeration.
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      title: Status
      type: string
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebhookEvent:
      description: An enumeration.
      enum:
        - start
        - output
        - logs
        - completed
      title: WebhookEvent
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with tencent/hunyuan-video
      description: Run inference with the tencent/hunyuan-video model on API.market
      operationId: createHunyuan_videoPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 6c9132aee14409cd6568d030453f1ba50f5f3412b844fe67f78a9eb62d55664f
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 6c9132aee14409cd6568d030453f1ba50f5f3412b844fe67f78a9eb62d55664f
                  input:
                    fps: 24
                    width: 864
                    height: 480
                    prompt: A cat walks on the grass, realistic style
                    infer_steps: 50
                    video_length: 129
                    embedded_guidance_scale: 6
      responses:
        "201":
          description: Prediction created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  version:
                    type: string
                    description: Model version used for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
              examples:
                success:
                  summary: Successful prediction creation
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    version: 6c9132aee14409cd6568d030453f1ba50f5f3412b844fe67f78a9eb62d55664f
                    status: starting
                    created_at: 2025-04-24T12:21:47.025Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /predictions/{id}:
    get:
      summary: Get prediction status and results
      description: Get the status and results of a tencent/hunyuan-video prediction
        from API.market
      operationId: getHunyuan_videoPrediction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The prediction ID
      responses:
        "200":
          description: Prediction details
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  output:
                    $ref: "#/components/schemas/Output"
                  error:
                    type: string
                    description: Error message if the prediction failed
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
                  started_at:
                    type: string
                    format: date-time
                    description: When the prediction started processing
                  completed_at:
                    type: string
                    format: date-time
                    description: When the prediction completed
              examples:
                succeeded:
                  summary: Successful prediction result
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    status: succeeded
                    output: https://replicate.delivery/xezq/LWCE40Sd0p46AFKaeeqLckTtEoCe9ERt71OwABwCNN77q6QoA/output_49895.mp4
                    created_at: 2023-01-01T12:00:00.000Z
                    started_at: 2023-01-01T12:00:05.000Z
                    completed_at: 2023-01-01T12:01:00.000Z
        "401":
          description: Unauthorized, invalid API token
        "404":
          description: Prediction not found
    parameters:
      - *a1
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: video
    description: Operations related to video
  - name: media
    description: Operations related to media
  - name: text-to-image
    description: Operations related to text-to-image
  - name: text-to-video
    description: Operations related to text-to-video
