BETA

alRetrieval

Ingest documents and query them with natural-language semantic retrieval. Supports PDF, DOCX, PPTX, TXT, and Markdown files.

Path
/v1/alRetrieval
Key scope
alretrieval

Supported file formats

PDF, DOCX, PPTX, TXT, MD

PDFs are processed via OCR; DOCX, PPTX, TXT, and MD have text extracted directly — no OCR cost

Scope Required: All alRetrieval endpoints require an API key with the alretrieval scope. Pass it as a Bearer token in the Authorization header.

GET / HEADGet the original file

Returns the original uploaded file, or the file downloaded from url, unchanged. Send the same API key in the Authorization header. You can open it before the document is ready; the link stays valid until deletion. HEAD returns the status and headers without a body.

GET /v1/alRetrieval/collections/{collection_id}/documents/{document_id}/file
HEAD /v1/alRetrieval/collections/{collection_id}/documents/{document_id}/file
FileContent-TypeContent-Disposition
PDFapplication/pdfinline
TXTtext/plain; charset=utf-8inline
MDtext/markdown; charset=utf-8inline
DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentattachment
PPTXapplication/vnd.openxmlformats-officedocument.presentationml.presentationattachment

The response includes Content-Length and both filename and UTF-8 filename* for Arabic names. A single byte range is supported per request; multiple ranges return 416 invalid_range. In your app, fetch the file from your server and serve it to the signed-in user.

Code Examples:

import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}
# doc is the document object from an upload, get or list response.
with requests.get(doc["view_url"], headers=headers, stream=True) as r:
    r.raise_for_status()
    with open("original.pdf", "wb") as f:
        for chunk in r.iter_content(65536):
            f.write(chunk)
404 document_not_foundThe document does not exist in this collection, or was deleted.
404 file_not_availableThe document was uploaded as JSON pages, or its original bytes were not retained.
416 invalid_rangeSend one byte range in a single Range header.

Ready to Get Started?

Generate an API key from your dashboard and start building

Activate account?

Activate this account?