Skip to main content

Documentation 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.

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 of /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 when use_search: true is passed to /chat.
Clients authenticate by virtue of having access to the server URL. There are no 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

# Local development
http://localhost:8000

# Docker / Hugging Face Spaces
http://localhost:7860

Workflow

PDF Insight Pro is session-based. Every conversation is tied to a single uploaded document, and that document is identified by a session_id UUID that the server generates at upload time. The typical client flow is:
  1. Upload a PDFPOST /upload-pdf with your file and an optional model_name. The server saves the file, chunks and embeds the text, builds a FAISS index, and returns a session_id.
  2. Query the documentPOST /chat with the session_id and your question. The server retrieves relevant chunks, runs the agentic RAG pipeline, and returns an answer.
  3. Inspect or reset historyPOST /chat-history to retrieve the conversation so far, or POST /clear-history to wipe it.
  4. Clean upPOST /remove-pdf to delete the PDF file and free server resources when the session is no longer needed.

Endpoints

MethodPathDescription
GET/Redirect to web UI
POST/upload-pdfUpload and process a PDF
POST/chatQuery the document
POST/chat-historyRetrieve chat history
POST/clear-historyClear chat history
POST/remove-pdfRemove PDF and session
GET/modelsList 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.

Build docs developers (and LLMs) love