analysis

Extract structured fields from an uploaded document

Upload a document (.pdf, .docx, .pptx, .odt, .txt, .md, .html or .htm, up to 30MB) and extract caller-named fields from its text exactly like /api/v1/extract. Options ride the jsonParams part. Text past the first 10,000 characters is not read; the response document object reports truncated. Billed like /api/v1/extract on the characters used. Unbilled (trial and public) keys also answer 429 with Retry-After when their per-minute generation budget is spent.

post/api/v1/file-extract

Request

  • Base URL: https://api.sapling.ai
  • URL: https://api.sapling.ai/api/v1/file-extract
  • Auth: one of:
    • HTTP bearer
    • none

Query parameters

return_usageboolean

When true, a successful JSON-object response additionally carries "usage": {"characters": <n>} — the billable character count this request submitted (0 for unbilled requests; the 2.5x adjustment for logographic languages is included, so CJK requests report more than their raw length). Repeat texts inside the billing deduplication window are still counted here even though they are not re-charged, so the number is an upper bound on the final charge. Responses whose body is not a JSON object (e.g. bare-array response formats) cannot carry the field. An existing usage field (such as account/status or completion token usage) is preserved unchanged.

keystring

Sapling API key, as an alternative to the "Authorization: Bearer <key>" header.

Response

Same shape as a single /api/v1/extract response, plus document.

dataobject
fieldsobject[]
missingstring[]

Changes

No recorded changes to this operation across all 1 revision of this API.