# Quickstart

[HTML](https://pdfcraft.ai/en/docs/getting-started/quickstart/) · [Site index](https://pdfcraft.ai/llms.txt)

Submit a PDF conversion task and retrieve the result in a few minutes.


This guide uses cURL and the PDF-to-Markdown endpoint. The same submit-and-poll pattern applies to EPUB conversion.

## 1. Create an API key

Create an API key in the [OOMOL Console](https://console.oomol.com/api-key). Keep it on your server or in a secret manager; never include it in a browser bundle or public client application.

## 2. Submit a conversion task

Replace the sample key and PDF URL, then send a request to the submit endpoint.

```bash
curl --request POST "https://fusion-api.oomol.com/v1/pdf-transform-markdown/submit" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "pdfURL": "https://pdfcraft.ai/examples/api-quickstart.pdf",
    "model": "gundam"
  }'
```

The response contains `sessionID`, which is the task ID. Store it with your own job record and use it in place of `TASK_ID` below so that retries and downloads remain traceable.

## 3. Poll for the result

Request the result endpoint until the status is `completed` or `failed`, or until your maximum attempt count or deadline is reached. Treat any non-2xx response as an error and stop polling if `state` is unknown. Begin with a short delay and back off between attempts for longer documents.

```bash
curl --request GET "https://fusion-api.oomol.com/v1/pdf-transform-markdown/result/TASK_ID" \
  --header "Authorization: Bearer YOUR_API_KEY"
```

Read the task state from `state`. When it is `completed`, download the generated file from `data.downloadURL`; when it is `failed`, record and handle the returned failure reason.

## Next steps

- Review the [API overview](https://pdfcraft.ai/en/docs/api/overview/) for authentication, task states, and retries.
- Use the [API Reference](https://pdfcraft.ai/en/api/) when you need field-level request and response details.

## A public input for your first call

The [one-page sample](https://pdfcraft.ai/examples/api-quickstart.pdf) is an integration-test input. Check the downloaded output for `Paper to structured text.`. This sample is not an OCR benchmark or a recorded conversion result. Requests use your own credential and may consume credits; see [pricing](https://pdfcraft.ai/en/pricing/).

For credential setup, failure recovery and the separate OOMOL Connector MCP service, read the [agent access guide](https://pdfcraft.ai/auth.md).

## Run the complete example

Download and inspect the [Python 3 example](https://pdfcraft.ai/examples/api-quickstart.py). It reads `PDF_CRAFT_API_KEY` from your environment, submits one billed conversion, saves the task ID, polls with a deadline, and verifies the downloaded sample output. Resume the same task after an interruption; do not submit it again.

```bash
python3 api-quickstart.py
python3 api-quickstart.py --resume pdf-craft-task.json
```
