Loading...
REST API with Python and JavaScript SDKs. The same API that powers pdfworkspace.in — yours to call directly.
Quickstart
curl -X POST https://api.pdfworkspace.in/v1/ai/chat \
-H "Authorization: Bearer $PDFWORKSPACE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_ids": ["file_01hkxy..."],
"message": "Summarize the key risk clauses"
}'from pdfworkspace import PDFWorkspace
pm = PDFWorkspace(api_key="sk_live_...")
uploaded = pm.files.upload("contract.pdf")
response = pm.chat(
file_ids=[uploaded.id],
message="Summarize the key risk clauses"
)
print(response.answer)
for cite in response.citations:
print(f" page {cite.page}: {cite.quote}")import PDFWorkspace from '@pdfworkspace/sdk'
const pm = new PDFWorkspace({ apiKey: process.env.PDFWORKSPACE_API_KEY })
const file = await pm.files.upload('contract.pdf')
const response = await pm.chat({
fileIds: [file.id],
message: 'Summarize the key risk clauses',
})
console.log(response.answer)Endpoints
/v1/files/uploadUpload a PDF or document/v1/ai/chatChat with a document (RAG + citations)/v1/tools/mergeMerge multiple PDFs/v1/tools/splitSplit a PDF by page ranges/v1/tools/ocrRun OCR on a scanned PDF/v1/ai/redact-smartAI-powered PII redaction/v1/ai/agentRun an agent workflow from a prompt/v1/jobs/{id}Poll status of an async jobLong-running operations return a job ID immediately — poll GET /v1/jobs/{id} for status and the output file once processing completes.