Lumen API

A small HTTP API for extracting text from documents, translating it, and producing short summaries. JSON in, JSON out, one endpoint per job.

Base URL https://docs.153213.top/v1 — all requests must use TLS and carry a bearer key.

Quickstart

Send a document reference and get text back. The first call after a cold start may take a few seconds while the model warms up.

curl -s https://docs.153213.top/v1/extract \
  -H "Authorization: Bearer $LUMEN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source":{"url":"https://example.com/invoice.pdf"},"lang":"auto"}'

Response:

{
  "id": "ex_8f2c1a",
  "status": "ok",
  "pages": 3,
  "text": "Invoice #1042 ...",
  "confidence": 0.97,
  "usage": { "pages": 3, "credits": 3 }
}

Endpoints

MethodPathPurposeLatency (p50)
POST/v1/extractText + layout from PDF, DOCX, images0.9 s / page
POST/v1/translateTranslate extracted text between 40 languages0.3 s / 1k chars
POST/v1/summarizeSummary, key points, or a single-paragraph abstract0.6 s / job
POST/v1/ocrPlain-text OCR for scans and photos1.2 s / page
GET/v1/jobs/{id}Poll a long-running job—
GET/v1/usageCredits consumed this month—

Job lifecycle

Anything under ten pages returns inline. Larger payloads switch to asynchronous mode: pass "async": true and you get a job id plus a Location header, then poll /v1/jobs/{id} until status is done or failed.

{"id":"jb_77d0e4","status":"queued","eta_seconds":14}

Pagination

List endpoints return at most 100 rows and accept ?limit=&cursor=. The response carries next_cursor; stop when it is null. Cursors are opaque — do not construct them.

Versioning

The version is part of the path. Breaking changes ship as /v2 and the previous version keeps working for twelve months. Additive fields can appear at any time; clients should ignore unknown keys.