Skip to main content
This example converts Markdown to PDF with cURL. It costs $0.005. Create an API key and set REVISE_API_KEY in your shell. Your account needs a positive credit balance. Each response returns the ID for the next request. Replace the example IDs with your own.

1. Upload a document

Send the Markdown directly from standard input. The multipart filename tells Revise which format to parse.
Save the returned id, such as file_…. Uploads are ephemeral by default and can be claimed by one job. Use a new idempotency key for a different input document.

2. Request a PDF

The response is HTTP 202 with a queued conversion receipt. Save its id. A replayed request can return a completed receipt, so check the status.

3. Wait for completion

Repeat while status is queued or running. Wait at least one second between polls, and honor Retry-After when present. Stop on succeeded, failed, or cancelled. Inspect error on failure. On success, the downloadable metadata is in output.artifact.

4. Download the artifact

Verify the downloaded byte count and SHA-256 against output.artifact.bytes and output.artifact.sha256 before using the file. The API endpoint requires the same account’s bearer key and may redirect to a signed storage URL. --location follows that redirect; cURL drops Authorization when the destination origin changes. Do not use --location-trusted. See files and artifacts.

TypeScript

The helper uploads, submits, and polls. save() downloads, verifies integrity, and writes the result. Use bytes() instead to send the output in a response or store it elsewhere. Results expire 24 hours after completion. To edit documents instead, see prompts.