{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok & YouTube Shorts Script Generator",
    "description": "Transform RSS feeds and raw notes into publish-ready TikTok and Shorts scripts. Includes optional ElevenLabs voiceovers and a built-in AI worker so you can start generating immediately or connect your own model.",
    "version": "0.1",
    "x-build-id": "OoORNLW4cSuUynUNx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/optirefine~short-form-script-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-optirefine-short-form-script-generator",
        "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/optirefine~short-form-script-generator/runs": {
      "post": {
        "operationId": "runs-sync-optirefine-short-form-script-generator",
        "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/optirefine~short-form-script-generator/run-sync": {
      "post": {
        "operationId": "run-sync-optirefine-short-form-script-generator",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Source mode",
            "enum": [
              "rss",
              "direct"
            ],
            "type": "string",
            "description": "Where source material comes from. Fields for the other mode are ignored.",
            "default": "rss"
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "RSS mode only. Which niches to pull articles for.",
            "items": {
              "type": "string",
              "enum": [
                "tech",
                "trends",
                "beauty",
                "fashion",
                "sports",
                "gaming",
                "news",
                "learning",
                "kid friendly",
                "music",
                "general"
              ]
            },
            "default": [
              "tech"
            ]
          },
          "feedOverrides": {
            "title": "Feed overrides",
            "type": "object",
            "description": "RSS mode only. Replace the built-in feeds for a category, e.g. {\"tech\": [\"https://example.com/feed.xml\"]}."
          },
          "items": {
            "title": "Items",
            "type": "array",
            "description": "Direct mode only. One object per script: {\"category\": \"tech\", \"topic\": \"...\", \"data\": \"...\"}."
          },
          "maxItems": {
            "title": "Max scripts",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Hard cap on scripts generated per run. Start another run if you need more.",
            "default": 10
          },
          "duration": {
            "title": "Target duration",
            "enum": [
              "15 seconds",
              "30 seconds",
              "40 seconds",
              "60 seconds",
              "90 seconds"
            ],
            "type": "string",
            "description": "Drives the script's timestamps.",
            "default": "40 seconds"
          },
          "platform": {
            "title": "Platform",
            "type": "string",
            "description": "Which platform the script is written for. Shapes tone and pacing.",
            "default": "TikTok/YouTube Shorts"
          },
          "elevenLabsApiKey": {
            "title": "ElevenLabs API key",
            "type": "string",
            "description": "Optional. Leave empty for scripts only. Supply a key and each segment is also voiced. Characters are billed to your ElevenLabs account."
          },
          "voiceId": {
            "title": "Voice ID",
            "type": "string",
            "description": "ElevenLabs voice ID. Only used when an ElevenLabs API key is supplied.",
            "default": "21m00Tcm4TlvDq8ikWAM"
          },
          "ttsModelId": {
            "title": "ElevenLabs model",
            "type": "string",
            "description": "ElevenLabs model. Only used when an ElevenLabs API key is supplied.",
            "default": "eleven_turbo_v2_5"
          },
          "generationConcurrency": {
            "title": "Generation concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many scripts to generate at once. The default is tuned for the built-in generator; raise it only when running against your own worker.",
            "default": 5
          },
          "ttsConcurrency": {
            "title": "Voiceover concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Keep low. ElevenLabs allows as few as 2 simultaneous requests on the free tier.",
            "default": 2
          },
          "runDeadlineSeconds": {
            "title": "Run deadline (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop starting new items after this many seconds. Keeps the run inside Apify's five-minute window; remaining items are reported as skipped, not failed.",
            "default": 210
          },
          "itemTimeoutSeconds": {
            "title": "Per-item timeout (seconds)",
            "minimum": 10,
            "maximum": 290,
            "type": "integer",
            "description": "Give up on a single item after this long. Bounds work already in flight when the run deadline hits. Must stay below the Actor's own timeout; the default leaves 20 seconds of headroom inside Apify's five-minute window.",
            "default": 280
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}