{
  "openapi": "3.0.1",
  "info": {
    "title": "Audio and Video Convert — extract audio, transcode, trim, GIF",
    "description": "One media file URL and an operation in, one file out: extract the audio track (MP3, WAV, M4A, OGG), convert audio, transcode video to MP4 or WebM, trim, compress to a size, or make a GIF. Pay per minute.",
    "version": "1.0",
    "x-build-id": "LtEvyGhSc99d2DhfJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hermeskd~audio-video-convert/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hermeskd-audio-video-convert",
        "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/hermeskd~audio-video-convert/runs": {
      "post": {
        "operationId": "runs-sync-hermeskd-audio-video-convert",
        "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/hermeskd~audio-video-convert/run-sync": {
      "post": {
        "operationId": "run-sync-hermeskd-audio-video-convert",
        "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",
        "required": [
          "url",
          "operation"
        ],
        "properties": {
          "url": {
            "title": "Media file URL",
            "pattern": "^https?://[^\\s/@]+([/?#]\\S*)?$",
            "type": "string",
            "description": "One audio or video file URL, http or https, up to 1 GB (MP4, MOV, MKV, WebM, AVI, FLV, MPEG-TS, MP3, WAV, M4A, AAC, OGG, FLAC and other single-file formats; not a playlist)."
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "extract_audio",
              "convert_audio",
              "transcode_video",
              "trim",
              "compress_video",
              "gif"
            ],
            "type": "string",
            "description": "extract_audio: the audio track as audioFormat. convert_audio: an audio file to audioFormat. transcode_video: to videoFormat (MP4 = H.264 + AAC, WebM = VP9 + Opus). trim: the start–end range, re-encoded frame-accurately. compress_video: to targetSizeMb. gif: an animated GIF of the start–end range."
          },
          "audioFormat": {
            "title": "Audio format",
            "enum": [
              "mp3",
              "wav",
              "m4a",
              "ogg"
            ],
            "type": "string",
            "description": "For audio outputs (extract_audio, convert_audio, trim of an audio file): mp3 (VBR about 165 kbps), wav (16-bit PCM), m4a (AAC 160 kbps) or ogg (Vorbis).",
            "default": "mp3"
          },
          "sampleRate": {
            "title": "Sample rate (Hz)",
            "minimum": 8000,
            "maximum": 48000,
            "type": "integer",
            "description": "Resample audio outputs to this rate, e.g. 16000 for speech models: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100 or 48000. Empty keeps the source rate."
          },
          "channels": {
            "title": "Channels",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Audio channels of the output: 1 (mono, e.g. for speech models) or 2 (stereo). Empty keeps the source's, with more than two mixed down to stereo."
          },
          "videoFormat": {
            "title": "Video format",
            "enum": [
              "mp4",
              "webm"
            ],
            "type": "string",
            "description": "For video outputs (transcode_video, compress_video, trim of a video): mp4 (H.264 + AAC) or webm (VP9 + Opus).",
            "default": "mp4"
          },
          "start": {
            "title": "Start (s)",
            "minimum": 0,
            "maximum": 86400,
            "type": "integer",
            "description": "For trim and gif only: where the range starts, in whole seconds from the beginning (0–86,400). Default 0."
          },
          "end": {
            "title": "End (s)",
            "minimum": 1,
            "maximum": 86400,
            "type": "integer",
            "description": "For trim and gif only: where the range ends, in whole seconds (1–86,400); after start, inside the media. Empty means the end of the media. A GIF covers at most 60 seconds."
          },
          "targetSizeMb": {
            "title": "Target size (MB)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "For compress_video (required there): the largest output size in megabytes of 1,000,000 bytes (1–1,000). The bitrate is set from it and the file's duration."
          },
          "maxWidth": {
            "title": "Maximum width (px)",
            "minimum": 16,
            "maximum": 7680,
            "type": "integer",
            "description": "Scale video and GIF outputs down to this width, keeping the aspect ratio (16–7,680). Empty keeps the source width; a GIF defaults to 480 px when the source is wider."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}