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.

The /upload-pdf endpoint is the entry point for every PDF Insight Pro conversation. It accepts a multipart/form-data POST request containing your PDF file, saves it to the server’s upload directory, extracts and chunks the text, embeds the chunks using BAAI/bge-large-en-v1.5, builds a FAISS index, and returns a session_id UUID that you must include in all subsequent /chat, /chat-history, /clear-history, and /remove-pdf requests.

Request

Method: POST
Path: /upload-pdf
Content-Type: multipart/form-data
file
file
required
The PDF file to upload and index. Must be a valid PDF document. Maximum file size is 50 MB.
model_name
string
default:"llama-3.1-8b-instant"
The Groq-hosted LLM model to associate with this session. This model is used for all /chat calls on this session unless overridden in the request. Use GET /models to retrieve the full list of accepted values.

curl example

curl -X POST http://localhost:8000/upload-pdf \
  -F "file=@/path/to/document.pdf" \
  -F "model_name=llama-3.1-8b-instant"

Response

Status: 200 OK
status
string
Always "success" on a successful upload.
session_id
string
A UUID v4 string that uniquely identifies the newly created session. Store this value — it is required for every subsequent API call on this document.
message
string
A human-readable confirmation string, e.g. "Processed document.pdf".
{
  "status": "success",
  "session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "message": "Processed document.pdf"
}

Errors

StatusDetail
500Error processing PDF: {error}
Save the returned session_id immediately. All subsequent /chat, /chat-history, /clear-history, and /remove-pdf calls require it. The server does not provide a way to recover a lost session ID.
The GROQ_API_KEY environment variable must be set on the server before you call this endpoint. If it is missing, the request will fail during API key validation before any file processing begins.

Build docs developers (and LLMs) love