> ## Documentation Index
> Fetch the complete documentation index at: https://developer.revise.io/llms.txt
> Use this file to discover all available pages before exploring further.

# File conversions

> Convert documents without writing a prompt.

[`POST /v1/convert`](/revise-api/reference/create-conversion) accepts an uploaded `file_id` and an output format. It returns a queued conversion receipt. Unlike prompt targets, conversion inputs cannot be artifact IDs; download and reupload an artifact when converting a previous result.

## Formats

Output formats are `docx`, `pdf`, `md`, `html`, and `txt`. Inputs include DOCX, Markdown, HTML, plain text, PDF, and images (JPEG, PNG, WebP, GIF). `.markdown` and `.htm` are recognized aliases. The server validates support; same-format conversion is rejected.

DOCX/Markdown/HTML/text conversion is deterministic. PDF and image inputs use semantic scanning. Inference settings are only accepted for scanning; sending them for a deterministic conversion returns `unsupported_option`. Scanning currently requires the OpenAI provider and a supported model. Use [`GET /v1/models`](/revise-api/reference/list-models) for available models rather than hard-coding one.

```bash theme={null}
curl --fail-with-body 'https://revise.io/api/v1/convert' \
  -H "Authorization: Bearer $REVISE_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: export-42' \
  -d '{"input":{"file_id":"file_REPLACE_ME"},"output":{"format":"pdf"}}'
```

Poll the receipt until it stops running, then read `output.artifact`. The receipt also contains conversion mode, input/output formats, output-word count, usage, and any error. After content deletion, some format fields become empty strings; the remaining record is a receipt, not a downloadable file.

Conversion charges and minimum fees are reported by the API. Use the settled `usage.cost` and account pricing data; preserve USD decimal strings rather than rounding them in your client.

## TypeScript: convert a previous edit

```ts theme={null}
import { ReviseClient, Source } from "@reviseio/api";

const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const edited = await revise.edit(
  Source.fromUrl("https://example.com/contract.docx"),
  "Change the payment term to 30 days.",
);
const pdf = await revise.convert(edited, "pdf");
const bytes = await pdf.bytes();
```

The client performs the intermediate download and reupload. `revise.conversions.create(body)` and `revise.conversions.run(body)` are available when you already hold an uploaded file ID.
