How to Use the PDF.ai Summarize API
Publish date
Oct 7, 2026
AI summary
The Summarize API lets you send a PDF docId and receive a one‑shot summary text without creating a chat thread; you must provide an API key, the docId, and optionally language, model, or GPT‑4 settings, then POST to https://pdf.ai/api/v1/summary. It returns the summary in a “content” field, does not store anything, and uses credits based on the model used. Errors include 401 for invalid keys and 400 for missing parameters. Use this endpoint for quick per‑document summaries, saving the result yourself, and refer to other APIs (Upload, Chat, Ask, Extract) when you need different functionality.
Language
People look up a Summarize API when they already have PDFs in their product and want one short summary per document — on upload, in a list view, or in a digest — without writing a chat prompt each time and without storing a chat thread they never asked for.
This page is the
docId → summary text path on the PDF.ai API v1 Summarize endpoint. It does not replace the API Hub (keys and plan live there). It does not re-rank the head term pdf api. To get a docId first, see How to Use the PDF.ai Upload API. For follow-up questions about the same file, see How to Use the PDF.ai Chat API.What Summarize is for
After a clean Summarize call on the PDF.ai API v1, three things should be true:
- You sent a
docIdfrom a v1 upload with yourX-API-Key
- The response includes a
contentstring with the summary
- Nothing was saved as a chat — the docs say the summary result is not saved as a Chat
Practical rule: Summarize is a one-shot read. If you want the summary to show up in the document's chat history, use Chat withsave_chatinstead, because Summarize does not save anything.
The request at a glance
From Summarize PDF:
Field | Required | What it does |
X-API-Key (header) | Yes | Your API key from the developer hub |
docId | Yes | Document ID returned when you uploaded the PDF |
language | No | Summary language, e.g. "french". Default is English |
use_gpt4 | No | Boolean. Get the response from a GPT-4 model (default model: gpt-4-turbo) |
model | No | Pick the GPT-4 model: "gpt-4o" or "gpt-4-turbo" (default) |
Endpoint:
POST https://pdf.ai/api/v1/summary. A successful response is JSON with one field, content.How to call Summarize
1. Have an API key
Open https://pdf.ai/developer, generate a key, and store it as a secret. Send it as the
X-API-Key header on every call.2. Get a docId
Summarize needs the
docId of a PDF you uploaded through v1. Upload by URL (POST https://pdf.ai/api/v1/upload/url) or by file (POST https://pdf.ai/api/v1/upload/file, 4.5 MB file limit) and keep the docId from the response. The full upload walkthrough is in How to Use the PDF.ai Upload API.If the PDF is a scan, make the text readable first: upload with
ocr on, or run the post-upload OCR endpoint (POST https://pdf.ai/api/v1/ocr). A summary can only be as good as the text the API can read.3. Example: summarize in English
import requests
url = "https://pdf.ai/api/v1/summary"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"docId": "YOUR_DOC_ID"
}
response = requests.post(url, headers=headers, json=data)
print(response.json()["content"])4. Example: summarize in another language with a chosen model
import requests
url = "https://pdf.ai/api/v1/summary"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"docId": "YOUR_DOC_ID",
"language": "french",
"use_gpt4": True,
"model": "gpt-4o"
}
response = requests.post(url, headers=headers, json=data)
print(response.json()) # {"content": "..."}The same call with cURL:
curl -X POST https://pdf.ai/api/v1/summary \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"docId": "YOUR_DOC_ID", "language": "french"}'5. Handle the documented errors
The Summarize page lists these responses:
- 200 —
{"content": "..."}with the summary
- 401 —
{"error": "Invalid API key"}: fix the key or header before you touch the request body
- 400 — e.g.
{"error": "No API key present"}: the API key ordocIdis missing
If the summary comes back empty or off-topic, check the document itself with
GET https://pdf.ai/api/v1/documents/{docId} (name, size, URL) before you retry. A wrong docId or a scan without OCR is a more likely cause than the model.Practical rule: store thecontentstring next to thedocIdin your own database. Summarize does not keep a copy in a chat thread, so a second call is a second request.
Credits and limits before you scale
The Summarize page does not list a separate credit line for summaries. What the docs do publish:
- Upload: 2 credits per file upload on the Dedicated API plan credit model (API limits)
- Messages by model on that same page: 1 credit per gpt-3.5-turbo or gpt-4o-mini message, 2 credits per gpt-4o message, 4 credits per gpt-4-turbo message
- Rate limit on the Dedicated API plan: 500 requests/minute
The current plan examples on credit usage are: Free $0/month for 200 credits/month (no credit card required), and paid $49 / 3,000, $99 / 10,000, $249 / 30,000, $599 / 100,000 credits per month. Run a few test summaries and check your usage on https://pdf.ai/developer before you summarize a whole library.
For the full credit picture across v1 and v2, see How to Understand PDF.ai API Credit Usage.
When Summarize is the wrong tool
- You want a summary of one specific part ("summarize the payment terms"). Use Chat with a precise
message(How to Use the PDF.ai Chat API). Chat also returns pagereferences; Summarize returns onlycontent.
- You want the summary saved to the document's history. Use Chat with
save_chat.
- You work on v2 parsed documents. Ask (
POST https://pdf.ai/api/v2/ask) takes apromptand one or more parseddocIds(How to Use the PDF.ai Ask API). Do not assume a v1 uploaddocIdworks there without checking.
- You need named fields as JSON, not prose. Use
POST /v2/extractwith a schema (How to Use the PDF.ai Extract API).
- You wanted a generic "pdf api" hub. Stay on https://pdf.ai/developer. This page is the Summarize how-to, not a replacement hub.
A short action plan
- Open https://pdf.ai/developer, create a key, store it once.
- Upload the PDF through v1 and keep the
docId(OCR first if it is a scan).
POST https://pdf.ai/api/v1/summarywithdocId, pluslanguageormodelif you need them.
- Save
contentin your own store, spot-check a few summaries against the source, then scale.
Sibling guides: How to Get Started with the PDF.ai API, How to Use the PDF.ai Upload API, How to Use the PDF.ai Chat API, How to Use the PDF.ai Ask API, How to Understand PDF.ai API Credit Usage.
If you want the rest of the PDF workflow, start at PDF.ai. Use the Summarize API when the next step is a stored summary per document in your product, not a one-off summary in a browser.