API docs
Endpoints, authentication, credits, and error codes.
Authentication
- API key: for external clients. Send it as Authorization: Bearer bnd_live_…
- Supabase JWT: for signed-in browser requests. The frontend sends your access token as Authorization: Bearer …
POST /v1/analyze
Endpoint: https://api.boundly.askantis.ch/v1/analyze (multipart/form-data with a file field named "file")
curl example
curl -X POST "https://api.boundly.askantis.ch/v1/analyze" \ -H "Authorization: Bearer bnd_live_YOUR_API_KEY" \ -F "file=@./document.pdf"
JavaScript example
const res = await fetch("https://api.boundly.askantis.ch/v1/analyze", {
method: "POST",
headers: { Authorization: "Bearer bnd_live_YOUR_API_KEY" },
body: (() => {
const form = new FormData()
form.append("file", file) // File (PDF)
return form
})(),
})
if (!res.ok) throw new Error(await res.text())
const data = await res.json()Response: JSON with extracted text structure and coordinates (see the playground output for a live example).
Credits
- 1 credit = 1 page analysed.
- If you do not have enough credits, the API returns 402.
Anonymous demo limits
- Anonymous demo is limited to 5 analyses per day and 5 pages per upload.
POST /v1/analyze/stream (progress)
Same auth and multipart body as /v1/analyze. Response is Server-Sent Events (text/event-stream).
Events: progress (stage, page, total_pages, percent), result (full JSON payload), error (code, message).
Stages: started → profiling (when document profiling runs) → page (per page) → finalizing → done.
curl stream example
curl -N -X POST "https://api.boundly.askantis.ch/v1/analyze/stream" \ -H "Authorization: Bearer bnd_live_YOUR_API_KEY" \ -H "Accept: text/event-stream" \ -F "file=@./document.pdf"
Error codes (summary)
- 401 unauthorized: missing/invalid token.
- 402 payment required: insufficient credits.
- 413 payload too large: file exceeds server limits (or page cap for the request).
- 429 too many requests: anonymous demo limit reached.
- 409 conflict: too many active API keys (revoke one first).