Documents

PDF Document Parsing

Submit a PDF as multipart form data. The Gemini provider can interpret text and visual content; the endpoint returns Gemini's response as document text, along with chunk and usage metadata.

Endpoint

POST https://aiservice.prabisha.com/documents/parse

Multipart Request

Use file as a file field. Do not manually set the multipart Content-Type; let the HTTP client add the boundary.

curl -X POST https://aiservice.prabisha.com/documents/parse \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@./report.pdf;type=application/pdf" \
  -F "prompt=Summarize the document and identify its main sections"

Form Fields

FieldTypeDetails
fileFile, requiredPDF file with MIME type application/pdf.
promptstringOptional instruction. When omitted, requests complete document content.
modelstringOptional enabled Gemini text model ID. The configured default is used when omitted.

Response

{
  "success": true,
  "pages": [{ "page": 1, "content": "Model response text..." }],
  "chunks": [{
    "page": 0,
    "content": "Model response text...",
    "chunkIndex": 0,
    "totalChunksOnPage": 1,
    "totalPages": 1
  }],
  "fullText": "Model response text...",
  "metadata": {
    "pageCount": 1,
    "wordCount": 3,
    "extractedAt": "2026-10-01T12:00:00.000Z",
    "fileType": "application/pdf",
    "chunkCount": 1,
    "extractionMethod": "gemini-interactions"
  },
  "model": "gemini-3.6-flash",
  "providerName": "GEMINI",
  "usage": {
    "promptTokens": 100,
    "completionTokens": 20,
    "totalTokens": 120
  },
  "latency": 1200
}

Note: Gemini's complete response is returned as a single page entry; chunking splits that text for downstream use. The model's response format follows your prompt.