Open in the interactive docs · markdown for agents: https://neuraldeep.tech/docs/drift-files.md

Drift · files + sandbox preview

Drift has its own workspace in MinIO (per-user, isolated) and, under the hood, a Docker sandbox with preinstalled openpyxl / pandas / pdfplumber / pypdf / python-docx / Pillow / chardet / bs4 / lxml. Upload a file — it lands both in MinIO and immediately in the sandbox; the model sees a preview of the first pages/rows in the init prompt without extra tool-calls.

curl -X POST https://drift.neuraldeep.tech/v1/files/upload \
  -H "Authorization: Bearer dft_xxxxxxxx" \
  -F file=@./report.pdf
# → {"uploaded":[{"name":"report.pdf","path":"report.pdf","size":48863,
#                 "preview":"...first 2 pages of the PDF..."}]}
import httpx
TOKEN = "dft_xxxxxxxx"
BASE  = "https://drift.neuraldeep.tech/v1"

# 1) upload
with open("report.pdf","rb") as f:
    up = httpx.post(f"{BASE}/files/upload",
                    headers={"Authorization": f"Bearer {TOKEN}"},
                    files={"file": ("report.pdf", f, "application/pdf")}).json()
print("preview:", up["uploaded"][0]["preview"][:200])

# 2) ask agent — it already sees the preview in the init prompt
r = httpx.post(f"{BASE}/chat/completions",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={"model":"qwen3.6-35b-a3b","messages":[
        {"role":"user","content":"Summarize report.pdf"}
    ]}).json()
print(r["choices"][0]["message"]["content"])

Preview formats: PDF → 2 pages (pdfplumber), XLSX → first sheet, 20 rows (openpyxl), CSV/TXT/JSON/MD → 6000 characters, DOCX → 6000 characters. For everything else — preview null, and the model will call read_file or python in the sandbox itself.

Limits: 20 MB per file, 8 files per request. Sandbox UTF-8, Cyrillic in filenames works. analyze_image works only on raster images (.png/.jpg/.webp/...). Read PDFs via preview or pdfplumber.

Reference sections (markdown for agents)