{
  "openapi": "3.0.1",
  "info": {
    "title": "CremyX Media Tools",
    "description": "ffmpeg / ffprobe / yt-dlp / aria2c as a service: probe metadata, extract 16 kHz mono WAV, build 480p proxies, rough cuts, and YouTube downloads. Chainable through key-value store refs.",
    "version": "0.8",
    "x-build-id": "eP0hhEEy4wuK1vrla"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/andrew_babo~cremyx-media-tools/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-andrew_babo-cremyx-media-tools",
        "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/andrew_babo~cremyx-media-tools/runs": {
      "post": {
        "operationId": "runs-sync-andrew_babo-cremyx-media-tools",
        "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/andrew_babo~cremyx-media-tools/run-sync": {
      "post": {
        "operationId": "run-sync-andrew_babo-cremyx-media-tools",
        "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": {
          "op": {
            "title": "Operation",
            "enum": [
              "probe",
              "plan_shards",
              "audio16k",
              "proxy",
              "cut",
              "ytdlp",
              "resolve",
              "audio_shard",
              "video_window",
              "audio_full",
              "ingest",
              "remux",
              "capabilities"
            ],
            "type": "string",
            "description": "probe = ffprobe metadata. plan_shards = shard plan, returned both as meta.shards and top-level shards [{index,startSec,endSec,durationSec}]. audio16k = mono speech audio (wav|mp3|opus) with optional range. proxy = fast 480p analysis proxy. cut = trim segments. ytdlp = raw download by page URL. resolve = print the DIRECT media URLs (yt-dlp -g) with no download at all (options.want=audio|video|both, options.height, options.audio_format, options.video_format); ASR/vision actors range-read those URLs. ingest = download + guarantee h264/aac faststart mp4. remux = any container/codec to mp4 (stream-copy compatible streams, transcode only incompatible streams). capabilities = report ops/features/vcpus of this build and does not need source. audio_shard = resolve + range-read + encode ONE audio window straight from a PAGE URL in a single run (options.start_sec/duration_sec/format/bitrate) — same exit IP as the resolve, so signed URLs stay valid and a client can fan out N shards without hosting the full track. video_window = resolve + range-read + cut ONE full-res video window straight from a PAGE URL in a single run (options.start_sec/duration_sec/height/crf/preset/with_audio); the output timeline starts at 0 and meta.offset_sec says where it came from, so a client never waits for a hosted copy of the whole video. audio_full = download the WHOLE audio track ONCE and host it as mono 16 kHz mp3/wav/opus (options.format/bitrate/sample_rate) so every ASR shard range-reads that KV URL instead of hitting YouTube per shard.",
            "default": "probe"
          },
          "source": {
            "title": "Source",
            "type": "string",
            "description": "https:// URL, or kv:<storeId>/<key> to read a record produced by an earlier run. For op=ytdlp this is the page URL. Required for every op except capabilities."
          },
          "options": {
            "title": "Options",
            "type": "object",
            "description": "Per-op options. plan_shards: shard_sec (default 120), overlap_sec (default 1). audio16k: sample_rate, format (wav|mp3|opus; default wav), bitrate (e.g. \"64k\"), start/dur (or start_sec/duration_sec) to cut one window. proxy: height, fps, crf, audio (default true — op=asd needs it). cut: segments[{start_sec,end_sec,name}], reencode, crf. ytdlp: format, aria2c, cookies (Netscape file content), cookies_url, proxy (proxy URL), apify_proxy {groups:[\"RESIDENTIAL\"],country}, player_client (default \"android,web_safari\"). ingest/remux: max_height, crf, preset, audio_kbps, copy_only, transcode_audio, kv_key. Failures always return {ok:false, reason: OOM_LIMIT|TIMEOUT|UPSTREAM_BLOCKED|BAD_INPUT|INTERNAL} — never SUCCEEDED with zero items."
          },
          "output": {
            "title": "Output",
            "type": "object",
            "description": "{ signed_upload_url } to PUT a single artifact straight to your own storage — keeps heavy files off Apify entirely."
          },
          "cleanup": {
            "title": "Cleanup policy",
            "enum": [
              "on_success",
              "always",
              "off"
            ],
            "type": "string",
            "description": "on_success = keep only the result artifacts in the run's key-value store (Apify expires them). always = also drop the artifact from the store after it was pushed to signed_upload_url. off = keep everything for debugging.",
            "default": "on_success"
          },
          "callback": {
            "title": "Completion webhook",
            "type": "object",
            "description": "{ url, secret_header: { name, value } } — POSTed with the result JSON when the run finishes."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}