Guide

Files and uploads

Send source files as base64-encoded entries in the uploads array.

There is no separate upload step and no multipart form. You put the bytes in the request, in an uploads array of { fileBase64, fileName } objects. This keeps MCP and REST identical, since an MCP tool call cannot carry a multipart body.

#Limits

FlowWhat the file isMax sizeAccepted
deckOne deck to redesign. Set options.mode to make it an enhance50 MB.pdf .pptx
recording-editThe recording to cut. Required500 MB.mp4 .webm .mov .mkv .avi
demo-videoOptional assets the agent turns into a slideshow50 MB each.pdf .png .jpg .jpeg .webp
Sizes are measured after decoding. Base64 is about a third larger than the raw file, so a 500 MB video is roughly a 667 MB request body. The type is read from the extension in fileName, not from the bytes.

#Sending a file

bash
curl -X POST https://api.trypitch.co/v1/projects \
  -H "Authorization: Bearer pk_your_key" \
  -H "Content-Type: application/json" \
  -d "$(jq -n \
    --arg f "$(base64 -w0 deck.pdf)" \
    '{ prompt: "Modernise it, keep the story",
       options: { mode: "recreate" },
       uploads: [{ fileBase64: $f, fileName: "deck.pdf" }] }')"
javascript
import { readFile } from "node:fs/promises"

const file = await readFile("recording.mp4")

const res = await fetch("https://api.trypitch.co/v1/projects", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PITCH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "Cut the dead air at the start. Add intro and outro cards.",
    options: { productName: "Acme", productUrl: "https://acme.com" },
    uploads: [{ fileBase64: file.toString("base64"), fileName: "recording.mp4" }],
  }),
})

When you send an upload, prompt may be empty. Otherwise it is required.

#What happens to your file

We decode it to a temp file, check the extension and size, upload it to object storage, and delete the temp copy. The stored copy is what the agent reads into the project workspace. Output files live in the same bucket and are served over HTTPS.

#Assets for a demo video

For demo-video, uploads are optional extras: PDFs or images the agent prepares into a slideshow and cuts between the live browser and the slides. Mention in the prompt what they are for.

json
{
  "prompt": "https://trypitch.co — open with the pricing one-pager, then show sign-up.",
  "uploads": [{ "fileBase64": "...", "fileName": "pricing.pdf" }]
}

#Errors

StatusCodeCause
413payload_too_largeThe decoded file is over the limit for its media type
415unsupported_media_typeThe extension is not in the accepted media list
400invalid_requestThe base64 decoded to nothing