openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ultra-fast-ai-text-to-video-generator
info:
  title: Ultra-Fast Text-to-Video Generator API (Hailuo 02)
  description: Generate 6s or 10s 512p AI videos from text prompts
    instantlyperfect for rapid prototyping, creative projects, and engaging
    content creation.
  version: 7acaa557f6db5f07372660faaf16007010cf9e24c365a65fee2dc01845e2f82e
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
        - first_frame_image
      properties:
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: Text prompt for generation
          example: she looks up and grabs the front of her baseball cap as a gesture
        go_fast:
          type: boolean
          title: Go Fast
          default: false
          x-order: 4
          description: Generate videos faster with slightly lower quality
          example: false
        duration:
          allOf:
            - $ref: "#/components/schemas/duration"
          default: 6
          x-order: 2
          description: Duration of the video in seconds.
          example: 10
        prompt_optimizer:
          type: boolean
          title: Prompt Optimizer
          default: true
          x-order: 3
          description: Use prompt optimizer
          example: true
        first_frame_image:
          type: string
          title: First Frame Image
          format: uri
          x-order: 1
          description: First frame image for video generation. The output video will have
            the same aspect ratio as this image.
          example: https://replicate.delivery/pbxt/NSrQCi9UTEoIfQbslplv9ZEAF7bNALPRqa5tQzn2nL7S3uiG/image.png
    Output:
      type: string
      title: Output
      format: uri
    Status:
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      type: string
      title: Status
      description: An enumeration.
    duration:
      enum:
        - 6
        - 10
      type: integer
      title: duration
      description: An enumeration.
    WebhookEvent:
      enum:
        - start
        - output
        - logs
        - completed
      type: string
      title: WebhookEvent
      description: An enumeration.
    ValidationError:
      type: object
      title: ValidationError
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
    PredictionRequest:
      type: object
      title: PredictionRequest
      properties:
        id:
          type: string
          title: Id
          nullable: true
        input:
          $ref: "#/components/schemas/Input"
          nullable: true
        context:
          type: object
          title: Context
          nullable: true
          additionalProperties:
            type: string
        webhook:
          type: string
          title: Webhook
          format: uri
          nullable: true
          maxLength: 65536
          minLength: 1
        created_at:
          type: string
          title: Created At
          format: date-time
          nullable: true
        output_file_prefix:
          type: string
          title: Output File Prefix
          nullable: true
        webhook_events_filter:
          type: array
          items:
            $ref: "#/components/schemas/WebhookEvent"
          default:
            - start
            - output
            - logs
            - completed
          nullable: true
    PredictionResponse:
      type: object
      title: PredictionResponse
      properties:
        id:
          type: string
          title: Id
          nullable: true
        logs:
          type: string
          title: Logs
          default: ""
        error:
          type: string
          title: Error
          nullable: true
        input:
          $ref: "#/components/schemas/Input"
          nullable: true
        output:
          $ref: "#/components/schemas/Output"
        status:
          $ref: "#/components/schemas/Status"
          nullable: true
        metrics:
          type: object
          title: Metrics
          nullable: true
          additionalProperties: true
        version:
          type: string
          title: Version
          nullable: true
        created_at:
          type: string
          title: Created At
          format: date-time
          nullable: true
        started_at:
          type: string
          title: Started At
          format: date-time
          nullable: true
        completed_at:
          type: string
          title: Completed At
          format: date-time
          nullable: true
    HTTPValidationError:
      type: object
      title: HTTPValidationError
      properties:
        detail:
          type: array
          items:
            $ref: "#/components/schemas/ValidationError"
          title: Detail
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with minimax/hailuo-02-fast
      description: Run inference with the minimax/hailuo-02-fast model on API.market
      operationId: createHailuo_02_fastPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 7acaa557f6db5f07372660faaf16007010cf9e24c365a65fee2dc01845e2f82e
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 7acaa557f6db5f07372660faaf16007010cf9e24c365a65fee2dc01845e2f82e
                  input:
                    prompt: she looks up and grabs the front of her baseball cap as a gesture
                    go_fast: false
                    duration: 10
                    prompt_optimizer: true
                    first_frame_image: https://replicate.delivery/pbxt/NSrQCi9UTEoIfQbslplv9ZEAF7bNALPRqa5tQzn2nL7S3uiG/image.png
      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: 7acaa557f6db5f07372660faaf16007010cf9e24c365a65fee2dc01845e2f82e
                    status: starting
                    created_at: 2025-08-17T16:40:50.364Z
        "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 minimax/hailuo-02-fast prediction
        from API.market
      operationId: getHailuo_02_fastPrediction
      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://blog.api.market/wp-content/uploads/2025/08/api-market-hailou.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: text-to-video
    description: Operations related to text-to-video
