{
  "openapi": "3.0.1",
  "info": {
    "title": "FFmpeg Media Toolkit: Trim, Convert, Compress, GIF, Subtitles",
    "description": "Trim, convert, compress, extract audio or frames, make GIFs, and add or burn subtitles for video and audio files you supply (uploads or direct file URLs). Powered by FFmpeg. Video-platform links are not supported.",
    "version": "0.1",
    "x-build-id": "dKSvO6eWuteiWiiy3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steady_kahikatea~media-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steady_kahikatea-media-toolkit",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/steady_kahikatea~media-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-steady_kahikatea-media-toolkit",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/steady_kahikatea~media-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-steady_kahikatea-media-toolkit",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "convert",
              "compress",
              "trim",
              "extract_audio",
              "extract_frames",
              "gif",
              "subtitles"
            ],
            "type": "string",
            "description": "What to do with each file.",
            "default": "compress"
          },
          "fileUrls": {
            "title": "Media files (upload or direct URLs)",
            "type": "array",
            "description": "Upload files or paste direct links to media files you have the rights to (e.g. https://example.com/video.mp4). Video/social platform links (YouTube, TikTok, Instagram, Vimeo, X, Facebook…) are rejected. Max 10 files, 500 MB and 30 minutes each."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "mp4",
              "webm",
              "mov",
              "mkv",
              "mp3",
              "m4a",
              "wav",
              "opus",
              "flac",
              "ogg"
            ],
            "type": "string",
            "description": "For convert/compress/trim/extract_audio. Video: mp4, webm, mov, mkv. Audio: mp3, m4a, wav, opus, flac, ogg."
          },
          "quality": {
            "title": "Quality",
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "type": "string",
            "description": "Video quality vs file size. high = larger files, low = smallest.",
            "default": "medium"
          },
          "maxHeight": {
            "title": "Max resolution (short side, px)",
            "minimum": 144,
            "maximum": 1080,
            "type": "integer",
            "description": "Downscale so the shorter side is at most this (never upscales). Output is capped at 1080. 720 or lower is billed at the cheaper SD rate.",
            "default": 1080
          },
          "targetSizeMB": {
            "title": "Compress: target size (MB)",
            "minimum": 0.1,
            "type": "number",
            "description": "Optional. Two-pass H.264 encode aimed at this file size (billed as 2× video minutes)."
          },
          "start": {
            "title": "Start (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Trim/convert/GIF start time."
          },
          "end": {
            "title": "End (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Trim/convert end time. Leave empty for the end of the file."
          },
          "accurate": {
            "title": "Trim: frame-accurate (re-encode)",
            "type": "boolean",
            "description": "Off = fast keyframe cut without re-encoding (cheap). On = exact cut, billed as video minutes.",
            "default": false
          },
          "audioBitrate": {
            "title": "Audio bitrate",
            "type": "string",
            "description": "For lossy audio outputs, e.g. 128k, 192k, 320k.",
            "default": "192k"
          },
          "frameCount": {
            "title": "Frames: count",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of evenly spaced frames to extract (max 100).",
            "default": 10
          },
          "frameIntervalSeconds": {
            "title": "Frames: every N seconds",
            "minimum": 0.1,
            "type": "number",
            "description": "Alternative to count: one frame every N seconds (max 100 frames)."
          },
          "imageFormat": {
            "title": "Frame image format",
            "enum": [
              "jpg",
              "png"
            ],
            "type": "string",
            "description": "jpg or png.",
            "default": "jpg"
          },
          "frameWidth": {
            "title": "Frame width (px)",
            "minimum": 64,
            "maximum": 1920,
            "type": "integer",
            "description": "Max frame width; never upscales.",
            "default": 1280
          },
          "gifSeconds": {
            "title": "GIF length (seconds)",
            "minimum": 0.5,
            "maximum": 30,
            "type": "number",
            "description": "Max 30.",
            "default": 5
          },
          "gifWidth": {
            "title": "GIF width (px)",
            "minimum": 64,
            "maximum": 640,
            "type": "integer",
            "description": "Max 640.",
            "default": 480
          },
          "fps": {
            "title": "GIF frames per second",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "Max 15.",
            "default": 10
          },
          "subtitleUrl": {
            "title": "Subtitle file (SRT, VTT or ASS)",
            "type": "string",
            "description": "Upload or link a subtitle file (max 1 MB). Required for the subtitles operation."
          },
          "subtitleMode": {
            "title": "Subtitle mode",
            "enum": [
              "burn",
              "soft"
            ],
            "type": "string",
            "description": "burn = draw onto the video (re-encode, video minutes). soft = add a selectable subtitle track (no re-encode, cheap).",
            "default": "burn"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}