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 optionally extract, split, or ask) 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)
Practical rule: start on /developer for 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
Playgrounds (no article needed to try the shape): parser, extract, split.

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 docIds you 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 successful parse on 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/parse
Content type: multipart/form-data.
Useful parameters (from Parse):
  • file or url (or docId when you already have a cached document id)
  • quality: standard (default, OCR path) or advanced (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

Ask (needs a prior parse): POST https://pdf.ai/api/v2/ask with JSON prompt + docIds. See Ask.
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 success and that pageCount matches the file you sent
  • For parse: search the markdown for 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 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.

A short action plan

  1. Open https://pdf.ai/developer, create a key, store it once.
  1. Check credit usage against your page count.
  1. POST https://pdf.ai/api/v2/parse with quality=standard on a short PDF.
  1. Save docId. Optionally call Ask or Extract next.
  1. Verify text or answers against the source PDF before you wire production.
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.