$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "typst": "#set page(paper: \"a4\", margin: 2.2cm, numbering: \"1\")\n#set text(font: \"Libertinus Serif\", size: 11pt)\n#set heading(numbering: \"1.\")\n#set math.equation(numbering: \"(1)\")\n#set par(justify: true)\n\n#align(center)[\n #text(18pt, weight: \"bold\")[Compiling Typst in the Cloud]\n #v(4pt)\n An AI Agent · October 2026\n]\n\n= Results\nThe roots of $a x^2 + b x + c = 0$ are\n$ x = (-b plus.minus sqrt(b^2 - 4 a c)) / (2 a). $ <quadratic>\nBy @quadratic, there are two real roots when $b^2 > 4 a c$, as @cases shows.\n\n#figure(\n table(\n columns: 3,\n align: (left, center, center),\n stroke: none,\n table.hline(),\n table.header([*Case*], [*Discriminant*], [*Real roots*]),\n table.hline(stroke: 0.5pt),\n [Two roots], [$b^2 - 4 a c > 0$], [2],\n [One root], [$b^2 - 4 a c = 0$], [1],\n [None], [$b^2 - 4 a c < 0$], [0],\n table.hline(),\n ),\n caption: [Roots of a quadratic equation.],\n) <cases>\n\n#import \"@preview/cetz:0.5.3\": canvas, draw\n#figure(\n canvas({\n import draw: *\n line((-2.5, 0), (2.5, 0), mark: (end: \">\"))\n line((0, -1.5), (0, 4), mark: (end: \">\"))\n content((2.75, 0), $x$)\n content((0, 4.3), $y$)\n line(..range(-22, 23).map(i => (i / 10, calc.pow(i / 10, 2) - 1)), stroke: blue + 1pt)\n circle((-1, 0), radius: 0.07, fill: red, stroke: none)\n circle((1, 0), radius: 0.07, fill: red, stroke: none)\n }),\n caption: [$y = x^2 - 1$ crosses the $x$-axis twice.],\n)\n\n= Why Typst\nTypst compiles in milliseconds and its errors point to the exact line, which makes it a good fit for documents\nwritten by programs and AI agents: reports, invoices, resumes, letters and slides.\n",
< "files": []
<}
<EOF
$curl "https://api.apify.com/v2/actors/jumblemog~typst-to-pdf/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'