openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/automatic-video-captioning-api
info:
  title: Ultra-Fast Video Captioning API (fictions-ai/autocaption)
  description: Instantly generate accurate captions for any video with high-speed
    AIenhance accessibility, engagement, and searchability in your apps.
  version: 18a45ff0d95feb4449d192bbdc06b4a6df168fa33def76dfc51b78ae224b599b
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:
        MaxChars:
          default: 20
          description: Max characters space for subtitles. 20 is good for videos, 10 is
            good for reels
          title: Maxchars
          type: integer
          x-order: 8
          example: 20
        color:
          default: white
          description: Caption color
          title: Color
          type: string
          x-order: 5
          example: white
        font:
          default: Poppins/Poppins-ExtraBold.ttf
          description: Font
          enum:
            - Poppins/Poppins-Bold.ttf
            - Poppins/Poppins-BoldItalic.ttf
            - Poppins/Poppins-ExtraBold.ttf
            - Poppins/Poppins-ExtraBoldItalic.ttf
            - Poppins/Poppins-Black.ttf
            - Poppins/Poppins-BlackItalic.ttf
            - Atkinson_Hyperlegible/AtkinsonHyperlegible-Bold.ttf
            - Atkinson_Hyperlegible/AtkinsonHyperlegible-BoldItalic.ttf
            - M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf
            - Arial/Arial_Bold.ttf
            - Arial/Arial_BoldItalic.ttf
            - Tajawal/Tajawal-Bold.ttf
            - Tajawal/Tajawal-ExtraBold.ttf
            - Tajawal/Tajawal-Black.ttf
          title: font
          type: string
          x-order: 10
          example: example
        fontsize:
          default: 7
          description: Font size. 7.0 is good for videos, 4.0 is good for reels
          title: Fontsize
          type: number
          x-order: 7
          example: 7
        highlight_color:
          default: yellow
          description: Highlight color
          title: Highlight Color
          type: string
          x-order: 6
          example: yellow
        kerning:
          default: -5
          description: Kerning for the subtitles
          title: Kerning
          type: number
          x-order: 13
          example: 0.5
        opacity:
          default: 0
          description: Opacity for the subtitles background
          title: Opacity
          type: number
          x-order: 9
          example: 0
        output_transcript:
          default: true
          description: Output transcript json, if true will output a transcript file that
            you can edit and use for the next run in transcript_file_input
          title: Output Transcript
          type: boolean
          x-order: 3
          example: true
        output_video:
          default: true
          description: Output video, if true will output the video with subtitles
          title: Output Video
          type: boolean
          x-order: 2
          example: true
        right_to_left:
          default: false
          description: Right to left subtitles, for right to left languages. Only Arial
            fonts are supported.
          title: Right To Left
          type: boolean
          x-order: 14
          example: true
        stroke_color:
          default: black
          description: Stroke color
          title: Stroke Color
          type: string
          x-order: 11
          example: example
        stroke_width:
          default: 2.6
          description: Stroke width
          title: Stroke Width
          type: number
          x-order: 12
          example: 512
        subs_position:
          default: bottom75
          description: Subtitles position
          enum:
            - bottom75
            - center
            - top
            - bottom
            - left
            - right
          title: subs_position
          type: string
          x-order: 4
          example: bottom75
        transcript_file_input:
          description: Transcript file, if provided will use this for words rather than
            whisper.
          format: uri
          title: Transcript File Input
          type: string
          x-order: 1
          example: https://example.com/image.jpg
        translate:
          default: false
          description: Translate the subtitles to English
          title: Translate
          type: boolean
          x-order: 15
          example: true
        video_file_input:
          description: Video file
          format: uri
          title: Video File Input
          type: string
          x-order: 0
          example: https://cdn.api.market/e1aIYfQOlE0X712mi-qlQzY2vl51LAcc/-/pbxt/K5zuJ6HCdsffhegX0JZwDl10qm7fYAh5txe0FZc7XFccpdtm/kingnobelbig.mp4
      required:
        - video_file_input
      title: Input
      type: object
    Output:
      items:
        format: uri
        type: string
      title: Output
      type: array
    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
    font:
      description: An enumeration.
      enum:
        - Poppins/Poppins-Bold.ttf
        - Poppins/Poppins-BoldItalic.ttf
        - Poppins/Poppins-ExtraBold.ttf
        - Poppins/Poppins-ExtraBoldItalic.ttf
        - Poppins/Poppins-Black.ttf
        - Poppins/Poppins-BlackItalic.ttf
        - Atkinson_Hyperlegible/AtkinsonHyperlegible-Bold.ttf
        - Atkinson_Hyperlegible/AtkinsonHyperlegible-BoldItalic.ttf
        - M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf
        - Arial/Arial_Bold.ttf
        - Arial/Arial_BoldItalic.ttf
        - Tajawal/Tajawal-Bold.ttf
        - Tajawal/Tajawal-ExtraBold.ttf
        - Tajawal/Tajawal-Black.ttf
      title: font
      type: string
    subs_position:
      description: An enumeration.
      enum:
        - bottom75
        - center
        - top
        - bottom
        - left
        - right
      title: subs_position
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with fictions-ai/autocaption
      description: Run inference with the fictions-ai/autocaption model on API.market
      operationId: createAutocaptionPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 18a45ff0d95feb4449d192bbdc06b4a6df168fa33def76dfc51b78ae224b599b
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 18a45ff0d95feb4449d192bbdc06b4a6df168fa33def76dfc51b78ae224b599b
                  input:
                    color: white
                    opacity: 0
                    MaxChars: 20
                    fontsize: 7
                    output_video: true
                    subs_position: bottom75
                    highlight_color: yellow
                    video_file_input: https://cdn.api.market/e1aIYfQOlE0X712mi-qlQzY2vl51LAcc/-/pbxt/K5zuJ6HCdsffhegX0JZwDl10qm7fYAh5txe0FZc7XFccpdtm/kingnobelbig.mp4
                    output_transcript: true
      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: 18a45ff0d95feb4449d192bbdc06b4a6df168fa33def76dfc51b78ae224b599b
                    status: starting
                    created_at: 2025-04-24T13:12:40.786Z
        "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 fictions-ai/autocaption prediction
        from API.market
      operationId: getAutocaptionPrediction
      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://cdn.api.market/14PV7h0_4E_SYQkm97oI9xu_AVy64PbJ/-/pbxt/whrbS9OKgPIJNh2bhqKEV7WKo3mf26yjvx1AifpnY5n7H9ESA/output.mp4
                      - https://cdn.api.market/61VuIaD9Tp1UJe7xhc_ZGqq0uYl3fQ1D/-/pbxt/zT7Pr1mfeMtPF00RBUeFenobyQrpTGQeWXL6nxsuzWjmfRPhE/transcript_out.json
                    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: transcription
    description: Operations related to transcription
  - name: text-to-speech
    description: Operations related to text-to-speech
  - name: speech-to-text
    description: Operations related to speech-to-text
