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. 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.
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.
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 for authentication, task states, and retries.
- Use the API Reference when you need field-level request and response details.
A public input for your first call
The one-page sample 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.
For credential setup, failure recovery and the separate OOMOL Connector MCP service, read the agent access guide.
Run the complete example
Download and inspect the Python 3 example. 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.
python3 api-quickstart.pypython3 api-quickstart.py --resume pdf-craft-task.json