openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ai-video-editing-generation-api
info:
  title: Ultra-Fast Video Editing & Generation API (Gen4-Aleph)
  description: Edit, transform, and generate high-quality videos instantly with
    Gen4-Alephs advanced AI perfect for rapid creative workflows and dynamic
    content creation.
  version: 3d37185b6195904e35fa22116ae8e0fc810faf57c3f45d570d79d065ca258c41
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
        - video
      properties:
        seed:
          type: integer
          title: Seed
          x-order: 3
          nullable: true
          description: Random seed. Set for reproducible generation
          example: 1
        video:
          type: string
          title: Video
          format: uri
          x-order: 1
          description: Input video to generate from. Videos must be less than 16MB. Only
            5s of the input video will be used.
          example: https://replicate.delivery/xezq/cfzezDWlUogXCEeVhG2qFmR5JMkB7ZXpa8ej7bDp6CRX8CNUB/tmp0v9ykzlp.mp4
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: Text prompt for video generation
          example: make it winter
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          default: 16:9
          x-order: 2
          description: Video aspect ratio
          example: 16:9
        reference_image:
          type: string
          title: Reference Image
          format: uri
          x-order: 4
          nullable: true
          description: Reference image to influence the style or content of the output.
          example: https://example.com/image.jpg
    Output:
      type: string
      title: Output
      format: uri
    Status:
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      type: string
      title: Status
      description: An enumeration.
    WebhookEvent:
      enum:
        - start
        - output
        - logs
        - completed
      type: string
      title: WebhookEvent
      description: An enumeration.
    aspect_ratio:
      enum:
        - 16:9
        - 9:16
        - 4:3
        - 3:4
        - 1:1
        - 21:9
      type: string
      title: aspect_ratio
      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 runwayml/gen4-aleph
      description: Run inference with the runwayml/gen4-aleph model on API.market
      operationId: createGen4_alephPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 3d37185b6195904e35fa22116ae8e0fc810faf57c3f45d570d79d065ca258c41
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 3d37185b6195904e35fa22116ae8e0fc810faf57c3f45d570d79d065ca258c41
                  input:
                    video: https://replicate.delivery/xezq/cfzezDWlUogXCEeVhG2qFmR5JMkB7ZXpa8ej7bDp6CRX8CNUB/tmp0v9ykzlp.mp4
                    prompt: make it winter
                    aspect_ratio: 16:9
      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: 3d37185b6195904e35fa22116ae8e0fc810faf57c3f45d570d79d065ca258c41
                    status: starting
                    created_at: 2025-08-17T10:19:19.464Z
        "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 runwayml/gen4-aleph prediction from
        API.market
      operationId: getGen4_alephPrediction
      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/rMbukKckeO2PX6rYC3ihXK09Kb073VeszOHf1yE7urXmcwPqA/tmp6q6l1p7j.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: text-to-video
    description: Operations related to text-to-video
  - name: image-to-video
    description: Operations related to image-to-video
  - name: video-upscaling
    description: Operations related to video-upscaling
