{
  "openapi": "3.0.1",
  "info": {
    "title": "Typst to PDF, PNG & SVG API: Compile Typst Documents Online",
    "description": "Compile Typst to PDF, PNG or SVG: reports, resumes, invoices, letters, slides and whole projects from the Typst web app or GitHub. Typst Universe packages, fonts and template inputs work out of the box. Errors give the file, line, column and Typst's hints, so people and AI agents can fix them.",
    "version": "0.1",
    "x-build-id": "8bofQBAaw3sgaDyaS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~typst-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-typst-to-pdf",
        "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/jumblemog~typst-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-typst-to-pdf",
        "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/jumblemog~typst-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-typst-to-pdf",
        "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": {
          "typst": {
            "title": "Typst document",
            "type": "string",
            "description": "A complete Typst document. Packages from Typst Universe (#import \"@preview/name:version\") are downloaded automatically, and the popular ones are already in the Actor."
          },
          "projectUrls": {
            "title": "Links to Typst projects",
            "type": "array",
            "description": "ZIP files of whole projects (for example downloaded from the Typst web app with File > Download all), GitHub repository or folder links, links to single .typ files, or Google Drive and Dropbox share links. The main file is found automatically, or set it in Main file.",
            "items": {
              "type": "string"
            }
          },
          "uploads": {
            "title": "Upload projects",
            "type": "array",
            "description": "Upload a project ZIP or a .typ file from your computer, or pick files you already stored in an Apify key-value store."
          },
          "files": {
            "title": "Extra files",
            "type": "array",
            "description": "Files the documents need, such as images, fonts, .bib bibliographies or data files (JSON, CSV, YAML). Each entry has a \"name\" (a relative path like \"images/logo.png\" or \"data.json\") and either a \"url\" or, for text files, the \"content\"."
          },
          "inputs": {
            "title": "Template inputs (sys.inputs)",
            "type": "object",
            "description": "Values passed to the documents, read in Typst with sys.inputs, for example {\"customer\": \"Acme\", \"total\": \"$1,200\"} and #sys.inputs.at(\"customer\"). Values that aren't strings (lists, objects, numbers) are passed as JSON text: read one with json(bytes(sys.inputs.at(\"rows\"))). Documents in the batch list can add their own inputs."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "pdf",
              "png",
              "svg"
            ],
            "type": "string",
            "description": "PDF (one file per document), or PNG or SVG with one image per page, for previews, social images and thumbnails.",
            "default": "pdf"
          },
          "ppi": {
            "title": "PNG resolution (pixels per inch)",
            "minimum": 36,
            "maximum": 600,
            "type": "integer",
            "description": "Resolution of PNG images. 144 is sharp on screens; use 300 for print.",
            "default": 144
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Only these pages, for example 1 or 1,3-5. Empty: all pages."
          },
          "mainFile": {
            "title": "Main file",
            "type": "string",
            "description": "The main .typ file inside projects, such as thesis.typ or src/main.typ. Empty: main.typ, else the template entry point in typst.toml, else the .typ file nearest the top of the project."
          },
          "documents": {
            "title": "More documents (batch)",
            "type": "array",
            "description": "A list of documents to compile in the same run. Each entry is a Typst string, or an object with \"typst\" or \"url\" and optional \"name\", \"mainFile\", \"files\" and \"inputs\". One template with different inputs per entry makes a batch of invoices, certificates or letters."
          },
          "compileTimeoutSecs": {
            "title": "Time limit per document (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Stop compiling a document after this many seconds. Most documents take well under a second.",
            "default": 60
          },
          "maxDocuments": {
            "title": "Maximum documents",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many documents, so the cost of a run stays predictable.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}