How to Get Started with the PDF.ai API
Publish date
Sep 10, 2026
AI summary
The guide explains how to get started with the PDF.ai API by creating an API key, making a first parse request (with optional OCR), checking credits, and then using additional endpoints like extract, split, and ask, while emphasizing best practices such as verifying responses, managing costs, and using the developer hub for key and plan management.
Language
People look up a PDF API when a browser upload is not enough. They need parse, extract, split, or ask inside their own app — with a key, credits, and a first successful response.
This page is the first-request path on PDF.ai. It does not replace the API Hub (manage keys and plan there). It does not re-rank the head term pdf api. For OCR specifically in code, see PDF OCR API: Run OCR from Your Code. For chat in the web app (not the API), see How to Chat with a PDF.
What this getting-started path is for
After a clean first integration on PDF.ai API v2, three things should be true:
- You have an API key stored as a secret (shown only once when generated)
- You can call at least one endpoint (
parse, then optionallyextract,split, orask) and get JSON back
- You know how credits work before you scale a batch
Core v2 endpoints (from the live docs):
- Parse — PDF → markdown / structured contents (OCR via
quality=standard)
- Extract — structured fields from a schema, with citations
- Split — divide a large PDF into smaller docs
- Ask — question a previously parsed
docId(or several)
Docs hub: https://api.pdf.ai. Quick start: https://api.pdf.ai/quick-start.
Practical rule: start on/developerfor the key and plan. Use this guide for the first HTTP call. Keep the hub page for account and billing.
Browser product vs API
Path | Best when | What you get |
Web app / free tools | One file, no code | A result in the browser (chat, OCR tool, extract UI) |
API v2 | Automation, your product, batches | JSON over HTTP with an X-API-Key |
Credits to check before you scale
From the live credit usage docs (examples):
- Parse Standard (OCR): 1 credit/page; Advanced (VLM): 2 credits/page (extra may apply if image LLM is enabled)
- Extract: 2 credits/page (≤5 schema fields) or 4 credits/page (>5 fields), plus parse credits if the doc is not already cached
- Split: 2 credits/page (parse credits if not cached)
- Ask: 3 credits × total page count across the
docIdsyou query (documents must be parsed first)
- Delete: no cost
- Cached parse with the same settings: 0 credits
API plan examples on that page:
- Free: $0/month for 200 credits/month, no credit card required
- Paid examples: $49 / 3,000, $99 / 10,000, $249 / 30,000, $599 / 100,000 credits per month
Generate the key and manage the plan on https://pdf.ai/developer. The docs say the key is shown only once when generated.
Practical rule: one successfulparseon a short PDF proves the key. Do not burn a large batch until credit math matches your page counts.
How to make the first request
1. Create an API key
Open the developer page, generate a key, store it as a secret. Send it as the
X-API-Key header on every call.2. Parse a PDF (recommended first call)
Endpoint from the docs:
POST https://pdf.ai/api/v2/parseContent type:
multipart/form-data.Useful parameters (from Parse):
fileorurl(ordocIdwhen you already have a cached document id)
quality:standard(default, OCR path) oradvanced(VLM)
lang_list: languages for standard OCR (default["en"])
llm: optional image LLM processing (default false)
Example shape (Python), matching the docs sample:
import requests
url = "https://pdf.ai/api/v2/parse"
headers = {"X-API-Key": "YOUR_API_KEY"}
with open("/path/to/document.pdf", "rb") as f:
files = {"file": f}
data = {
"quality": "standard",
"lang_list": '["en"]'
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())A successful response includes fields such as
success, markdown, contents, images, pageCount, and docId. Keep the docId — extract, split, and ask can reuse a cached parse.3. Optional next calls
Extract (schema → fields + citations):
POST https://pdf.ai/api/v2/extract. See Extract. For the reader-side extract job (not the API), see Extract Data from PDF: Get Fields and Tables Out.Split:
POST https://pdf.ai/api/v2/split when you need smaller PDFs, not a chat answer.4. Check the output before you trust it
- Confirm
successand thatpageCountmatches the file you sent
- For parse: search the
markdownfor a word from page 1 and a later page you care about
- For ask: open the section the answer claims to use before you ship it downstream
- If you get
Invalid API key/No API key present, fix the header before you change the PDF
Practical rule: a non-empty JSON body is not a verified document. Read the lines you will use.
When this path is the wrong tool
- You only need one chat answer in a browser. Use the web app path in How to Chat with a PDF. No API key required for that job.
- You only need one searchable PDF. Use https://pdf.ai/tools/ocr-pdf, then prove search works.
- You wanted a generic “pdf api” category hub. Stay on https://pdf.ai/developer. This page is the first-request how-to, not a replacement hub.
- You need OCR-in-code detail only. Prefer PDF OCR API: Run OCR from Your Code (
quality=standardon Parse).
A short action plan
- Open https://pdf.ai/developer, create a key, store it once.
- Check credit usage against your page count.
POST https://pdf.ai/api/v2/parsewithquality=standardon a short PDF.
- Save
docId. Optionally call Ask or Extract next.
- Verify text or answers against the source PDF before you wire production.
Sibling guides: PDF OCR API: Run OCR from Your Code, How to Parse a PDF, Extract Data from PDF: Get Fields and Tables Out, How to Chat with a PDF.
If you want the rest of the PDF workflow after the first response is clean, start at PDF.ai. Use the API when the next step is your code, not a single upload box.