API Documentation
Integrate AskPDF's AI features into your applications with our REST API.
Note: PDF operations (merge, compress, split, convert) run entirely client-side in the browser and are not available via API. The API provides access to AI-powered features: Chat and Summarize.
Authentication
All API requests require an API key passed in the Authorization header as a Bearer token. Get your API key from the API plan.
Authorization: Bearer YOUR_API_KEY
Endpoints
POST
/api/chatChat with a PDF document using AI
{ "documentText": "...", "messages": [{"role": "user", "content": "..."}] }POST
/api/summarizeGenerate an AI summary of a PDF
{ "documentText": "...", "length": "brief" | "standard" | "detailed" }Code Examples
curl -X POST https://your-domain.com/api/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documentText": "Your extracted PDF text...",
"messages": [
{"role": "user", "content": "What is this document about?"}
]
}'Rate Limits
| Plan | Requests/min | Monthly Limit |
|---|---|---|
| Free | 10 | 150 requests |
| Pro | 60 | Unlimited |
| API | 120 | 10,000 requests |