Skip to main content

Install

createOkra(...) returns an OkraClient. Use it when you want workflow defaults or middleware-style options. Use new OkraClient(...) when you want the direct class.

Upload and ask

sessions.create(...) accepts local file paths in Node, URLs, Blob, ArrayBuffer, or Uint8Array. Use sessions.from(documentId) to attach to an existing document.

Read pages and entities

Structured output

Streaming

Passive file assets

Use files.upload(...) when you want to store a PDF first and decide later whether to parse, host, or run a workflow.

Host and URL building

The SDK exports a deterministic URL builder for document-derived assets:
For clean hosted PDF deployments, call the REST Host API or upload through files.upload(...) and publish with /v1/host.

Invoice extraction workflow

Dynamic agent workflows

The stable SDK surface currently exposes built-in workflows such as invoice extraction. Custom workflow authoring lives in the MCP and REST workflow surfaces:
  • Use MCP when an agent should draft, run, and inspect a workflow.
  • Use POST /v1/workflows and POST /v1/runs when your app wants to create and run a workflow directly.

Collections

API surface