{
  "openapi": "3.0.1",
  "info": {
    "title": "Add Audio to Video: Replace or Mix Soundtrack, Music, Voice",
    "description": "Replace or mix a soundtrack into videos from direct file URLs: add music or a voice-over, set volumes, duck music under speech, loop short tracks, fade and delay. Video is copied, not re-encoded. mp4 out with signed links. No YouTube. Free when a video fails.",
    "version": "0.1",
    "x-build-id": "CbDGY8VuK1kUEM3jx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~add-audio-to-video/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-add-audio-to-video",
        "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/data-done-right~add-audio-to-video/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-add-audio-to-video",
        "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/data-done-right~add-audio-to-video/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-add-audio-to-video",
        "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": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "Direct links to video files (mp4, mov, webm, mkv, avi). Example: https://example.com/clip.mp4. Every video gets the audio given in 'Audio file URL', unless its entry in 'Videos with their own audio' says otherwise. YouTube, Vimeo, TikTok and other streaming-page links are rejected, with no charge.",
            "items": {
              "type": "string"
            }
          },
          "audioUrl": {
            "title": "Audio file URL",
            "type": "string",
            "description": "Direct link to the new soundtrack: an mp3, wav, m4a, aac, flac or ogg file (a video file works too: its audio is used). Example: https://example.com/music.mp3. Used for every video without its own audio. Max 200 MB by default."
          },
          "videos": {
            "title": "Videos with their own audio",
            "type": "array",
            "description": "One audio file per video: [{\"url\": \"https://example.com/a.mp4\", \"audioUrl\": \"https://example.com/a.mp3\", \"name\": \"intro\", \"audioVolume\": 0.3}]. An entry can also set mode, audioVolume, originalVolume, duck, loop, delaySeconds, fadeInSeconds and fadeOutSeconds for that video only. Videos listed here are added to 'Video URLs'."
          },
          "mode": {
            "title": "Audio mode",
            "enum": [
              "replace",
              "mix"
            ],
            "type": "string",
            "description": "Replace removes the original audio and uses the new one. Mix keeps the original audio and plays the new one with it (a video with no audio just gets the new audio).",
            "default": "replace"
          },
          "audioVolume": {
            "title": "New audio volume",
            "minimum": 0,
            "maximum": 4,
            "type": "number",
            "description": "Loudness of the new audio: 1 = unchanged, 0.3 = quiet background music, 2 = twice as loud (peaks are limited in mix mode). Example: 0.3.",
            "default": 1
          },
          "originalVolume": {
            "title": "Original audio volume",
            "minimum": 0,
            "maximum": 4,
            "type": "number",
            "description": "Mix mode only: loudness of the video's own audio. 1 = unchanged, 0.5 = half. Ignored in replace mode.",
            "default": 1
          },
          "duck": {
            "title": "Duck new audio under the original",
            "type": "boolean",
            "description": "Mix mode only: automatically lower the new audio (music) while the original audio (speech) is loud, and bring it back in the pauses. It reacts to loudness, so loud background noise in the original also lowers the music.",
            "default": false
          },
          "loop": {
            "title": "Loop short audio",
            "type": "boolean",
            "description": "When the audio is shorter than the video, repeat it until the video ends (a hard cut at each repeat). Off = the rest of the video is silent (replace mode) or has only the original audio (mix mode). Audio that is longer than the video is always cut at the end of the video.",
            "default": true
          },
          "delaySeconds": {
            "title": "Start audio at (seconds)",
            "minimum": 0,
            "maximum": 36000,
            "type": "number",
            "description": "Start the new audio this many seconds into the video. 0 = from the first frame. Example: 2.5.",
            "default": 0
          },
          "fadeInSeconds": {
            "title": "Fade in (seconds)",
            "minimum": 0,
            "maximum": 600,
            "type": "number",
            "description": "Fade the new audio in over this many seconds from where it starts. 0 = no fade. Example: 1.5.",
            "default": 0
          },
          "fadeOutSeconds": {
            "title": "Fade out (seconds)",
            "minimum": 0,
            "maximum": 600,
            "type": "number",
            "description": "Fade the new audio out over the last seconds of the video. 0 = no fade. Example: 3.",
            "default": 0
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate (kbps)",
            "minimum": 64,
            "maximum": 320,
            "type": "integer",
            "description": "AAC bitrate of the result's audio track. 192 is high quality for music, 128 is fine for speech.",
            "default": 192
          },
          "crf": {
            "title": "Video quality (CRF)",
            "minimum": 16,
            "maximum": 35,
            "type": "integer",
            "description": "Only used when the video has to be re-encoded (a codec that does not fit an mp4). Lower = better quality and bigger files: 18 is near-lossless, 23 is the default, 28 is small. Videos that can be copied are never re-encoded.",
            "default": 23
          },
          "outputStoreName": {
            "title": "Save videos in a named store",
            "type": "string",
            "description": "Optional key-value store name. Named stores are kept until you delete them, while the store of a run expires after your plan's retention period. Example: my-soundtracked-videos."
          },
          "maxVideosPerRun": {
            "title": "Max videos per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on videos processed in one run (and so on what you can be charged). Further videos are listed as skipped.",
            "default": 50
          },
          "maxVideoSizeMb": {
            "title": "Max video file size (MB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Source videos above this size are rejected before the download finishes, without charge.",
            "default": 500
          },
          "maxAudioSizeMb": {
            "title": "Max audio file size (MB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Audio files above this size are rejected before the download finishes, without charge.",
            "default": 200
          },
          "maxDurationMinutes": {
            "title": "Max video duration (minutes)",
            "minimum": 0.1,
            "type": "number",
            "description": "Longer videos are rejected without charge. Example: 60 = one hour.",
            "default": 60
          },
          "videoTimeoutSecs": {
            "title": "Timeout per video (seconds)",
            "minimum": 10,
            "maximum": 7200,
            "type": "integer",
            "description": "Applies separately to each download and to the ffmpeg job of each video. Example: 900 = 15 minutes.",
            "default": 900
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}