PDF Insight Pro exposes a FastAPI-powered REST API that lets you upload PDF documents, query them with natural-language questions, and manage chat sessions programmatically. The server listens on port 8000 when running locally and on port 7860 when deployed via Docker or Hugging Face Spaces. All endpoints accept and return JSON, with the single exception ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jatin-Mehra119/PDF-Insight-Beta/llms.txt
Use this file to discover all available pages before exploring further.
/upload-pdf, which takes a multipart/form-data request body.
Authentication
PDF Insight Pro uses server-side authentication rather than per-request API keys. The server reads two environment variables at startup:GROQ_API_KEY— required for all LLM inference via Groq-hosted models.TAVILY_API_KEY— required only whenuse_search: trueis passed to/chat.
Authorization headers or tokens to include in requests. CORS is configured to allow all origins (*) by default, so any web client can reach a running server without additional configuration.
Base URL
Workflow
PDF Insight Pro is session-based. Every conversation is tied to a single uploaded document, and that document is identified by asession_id UUID that the server generates at upload time. The typical client flow is:
- Upload a PDF —
POST /upload-pdfwith your file and an optionalmodel_name. The server saves the file, chunks and embeds the text, builds a FAISS index, and returns asession_id. - Query the document —
POST /chatwith thesession_idand your question. The server retrieves relevant chunks, runs the agentic RAG pipeline, and returns an answer. - Inspect or reset history —
POST /chat-historyto retrieve the conversation so far, orPOST /clear-historyto wipe it. - Clean up —
POST /remove-pdfto delete the PDF file and free server resources when the session is no longer needed.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | / | Redirect to web UI |
| POST | /upload-pdf | Upload and process a PDF |
| POST | /chat | Query the document |
| POST | /chat-history | Retrieve chat history |
| POST | /clear-history | Clear chat history |
| POST | /remove-pdf | Remove PDF and session |
| GET | /models | List available LLM models |
Explore the API
POST /upload-pdf
Upload a PDF and receive a session ID to use in all subsequent requests.
POST /chat
Ask natural-language questions against your uploaded document.
Sessions
Retrieve, clear, or permanently remove a session and its associated PDF.
GET /models
List available Groq-hosted LLM models you can select at upload time.