{
  "openapi": "3.0.1",
  "info": {
    "title": "Post Engineer: AI video generator and social scheduler",
    "description": "Turn a hook, body and call to action into a short video with an AI persona (or faceless), then publish it to YouTube, Instagram, LinkedIn, Threads or Bluesky.",
    "version": "0.1",
    "x-build-id": "jULVeKoWB31X29Kvw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/made_by_ryan~post-engineer-video/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-made_by_ryan-post-engineer-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/made_by_ryan~post-engineer-video/runs": {
      "post": {
        "operationId": "runs-sync-made_by_ryan-post-engineer-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/made_by_ryan~post-engineer-video/run-sync": {
      "post": {
        "operationId": "run-sync-made_by_ryan-post-engineer-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": [
          "title",
          "hook",
          "body",
          "cta",
          "providers"
        ],
        "properties": {
          "apiKey": {
            "title": "Post Engineer API key",
            "type": "string",
            "description": "Create one at https://post-engineer.com/api-keys (starts with pe_live_). Without a key the run is a dry run: it validates the input and shows the request it would send, with nothing generated, published or charged. With a key, generating a video spends tokens from that account."
          },
          "title": {
            "title": "Video title",
            "type": "string",
            "description": "Label of the scheduled post."
          },
          "hook": {
            "title": "Hook",
            "type": "string",
            "description": "Opening line. Hook, body and CTA together must be 60 to 200 words; the script is validated before any token is spent."
          },
          "body": {
            "title": "Body",
            "type": "string",
            "description": "Main script."
          },
          "cta": {
            "title": "Call to action",
            "type": "string",
            "description": "Closing line."
          },
          "providers": {
            "title": "Publish to",
            "type": "array",
            "description": "One or more of: youtube, instagram, linkedin, bluesky, threads. Connect the accounts first at https://post-engineer.com.",
            "items": {
              "type": "string"
            }
          },
          "personaId": {
            "title": "Persona ID",
            "type": "string",
            "description": "AI persona that presents the video (lip-sync on the hook). Leave empty for a faceless video."
          },
          "voiceId": {
            "title": "Voice ID",
            "type": "string",
            "description": "Narration voice: an id from GET /api/persona/voices. Required without a persona; with a persona it overrides the persona's voice."
          },
          "faceless": {
            "title": "Faceless video",
            "type": "boolean",
            "description": "No face on screen, only b-roll or animated svg (cheapest). Defaults to true when no persona is set."
          },
          "facelessMaterial": {
            "title": "Faceless material",
            "enum": [
              "broll",
              "svg"
            ],
            "type": "string",
            "description": "What fills a faceless video: stock b-roll or animated svg scenes."
          },
          "fullLipsync": {
            "title": "Full lip-sync",
            "type": "boolean",
            "description": "The persona talks for the whole video instead of only the hook (most expensive). Needs a persona; not with faceless."
          },
          "accounts": {
            "title": "Account IDs per provider",
            "type": "object",
            "description": "Optional, e.g. {\"youtube\": [\"<account id>\"]}. Defaults to the persona's publishing accounts."
          },
          "mode": {
            "title": "When to publish",
            "enum": [
              "asap",
              "scheduled"
            ],
            "type": "string",
            "description": "asap publishes as soon as the video is ready; scheduled uses the schedule below.",
            "default": "asap"
          },
          "schedule": {
            "title": "Schedule",
            "type": "object",
            "description": "Only for mode scheduled: {\"startAt\": \"2026-12-01T09:00:00Z\", \"times\": [\"18:00\"], \"timezone\": \"America/Sao_Paulo\"}. startAt is an ISO datetime; slots must be 3 hours to 30 days ahead."
          },
          "waitForCompletion": {
            "title": "Wait for the video",
            "type": "boolean",
            "description": "Keep the run open until the video is generated (or fails) and return its status.",
            "default": true
          },
          "timeoutMinutes": {
            "title": "Wait timeout (minutes)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How long to wait for the video before returning status timeout.",
            "default": 30
          },
          "apiUrl": {
            "title": "API base URL",
            "type": "string",
            "description": "Only for self-hosted Post Engineer. Must be https (http is allowed only for localhost)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}