{
  "openapi": "3.0.1",
  "info": {
    "title": "Media Converter for AI Agents (FFmpeg)",
    "description": "FFmpeg API for AI agents and automations. Send a media URL, get MP3, WAV, Whisper-ready 16 kHz mono WAV, FLAC, OGG, M4A, MP4, WebM, GIF or a JPEG thumbnail back. Trim and batch. No ffmpeg, Docker or server. Works via MCP, n8n, Make, API. Failed files are free.",
    "version": "0.1",
    "x-build-id": "Hjw5uqm4sxomD2Vuz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ent-e~media-converter-ffmpeg/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ent-e-media-converter-ffmpeg",
        "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/ent-e~media-converter-ffmpeg/runs": {
      "post": {
        "operationId": "runs-sync-ent-e-media-converter-ffmpeg",
        "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/ent-e~media-converter-ffmpeg/run-sync": {
      "post": {
        "operationId": "run-sync-ent-e-media-converter-ffmpeg",
        "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": {
          "url": {
            "title": "Media URL",
            "type": "string",
            "description": "Direct, publicly downloadable URL of ONE audio or video file (http/https; redirects followed). Any FFmpeg-readable format: mp4, mov, mkv, webm, avi, mp3, wav, m4a, ogg, flac, opus... Max 2 GB. Must be the file itself, not a YouTube/web page. Example: https://download.samplelib.com/mp4/sample-5s.mp4"
          },
          "target": {
            "title": "Target format",
            "enum": [
              "mp3",
              "wav",
              "wav16k",
              "flac",
              "ogg",
              "m4a",
              "mp4",
              "webm",
              "gif",
              "thumbnail"
            ],
            "type": "string",
            "description": "Output format, applied to `url` and to any `files` item without its own target. Default: mp3. Audio: mp3 (VBR ~190 kbps), wav (16-bit PCM, original rate), wav16k (mono, 16 000 Hz, 16-bit PCM - use this before Whisper/speech-to-text), flac (lossless), ogg (Vorbis), m4a (AAC 192 kbps). Video: mp4 (H.264 + AAC, web/faststart), webm (VP9 + Opus). Image: gif (animated, 8 fps, 360 px wide, no audio), thumbnail (single JPEG frame at startSeconds, default first frame). Audio targets need an input audio stream; video/gif/thumbnail need a video stream.",
            "default": "mp3"
          },
          "startSeconds": {
            "title": "Start at (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional trim start in whole seconds from the beginning of the input, e.g. 30. For target=thumbnail this is the frame time (default: first frame). Applies to `url` and acts as the default for every `files` item; a `files` item's own startSeconds overrides it (and may be fractional, e.g. 12.5)."
          },
          "durationSeconds": {
            "title": "Duration (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional length in whole seconds to keep from startSeconds, e.g. 600 for 10 minutes. Billing is per started minute of OUTPUT, so trimming lowers cost; also lets inputs longer than maxDurationSeconds be processed. Applies to `url` and is the default for every `files` item; per-item durationSeconds overrides it."
          },
          "files": {
            "title": "Batch of files",
            "type": "array",
            "description": "Optional batch, processed sequentially. Array of objects: {\"url\": string (required), \"target\": one of the target values (optional, falls back to top-level target), \"startSeconds\": number (optional, seconds from start to begin, e.g. 30; falls back to top-level startSeconds), \"durationSeconds\": number (optional, seconds to keep, e.g. 60; falls back to top-level durationSeconds)}. Example: [{\"url\":\"https://example.com/talk.mp4\",\"target\":\"wav16k\"},{\"url\":\"https://example.com/clip.mov\",\"target\":\"gif\",\"startSeconds\":5,\"durationSeconds\":4}]. Plain URL strings are also accepted. Failed items return status=error and are not charged."
          },
          "maxDurationSeconds": {
            "title": "Max input duration (s)",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap in seconds on input duration (default 10800 = 3 hours). Longer inputs are rejected with status=error (not charged) unless durationSeconds is set (top-level or on the item) to trim. Billing is per started minute of OUTPUT, so trimming also lowers cost.",
            "default": 10800
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}