kriyam.aistudioAPI reference
API reference

Kriyam Docwise

Async

Read a set of documents end to end — parse, classify and extract.

Overview

Post up to five documents with the steps you want run over them, and Docwise processes them as one session. Unlike the single-purpose tools, a session is a pipeline: each step you ask for pulls in whatever it depends on, and the work continues long after the response returns.

  • Register a webhook on the key before calling this. You're told when the session reaches a terminal state; reading the session is a reconciliation backstop, not the normal path.
  • capability is repeated once per step. Dependencies are resolved for you — asking for extract alone also runs parse, because it can't extract from a document it hasn't read. You are charged for the steps that actually ran.
  • A session is charged per capability as each one delivers, not up front. A session that parses and then fails to classify pays for the parse and nothing else, so there is no refund path to reason about.
  • The steps on offer are configurable, and one that isn't currently active is refused at creation rather than accepted and skipped. parse, classify and extract are the steps that run today.
  • Send extraction_schema to decide what extract pulls out. Without it, Docwise works out a schema from the documents themselves, which suits exploring, but the fields can differ from one session to the next. With it, extraction runs straight against your fields and the result comes back in exactly the shape you asked for, every time.
  • extraction_schema is a JSON Schema object, sent as one form field holding its JSON text. Every field needs a description — at every level, including the columns of an array of objects — because the description is what tells the model which value belongs in the field: amount alone could be any figure on an invoice, while "Grand total payable including tax" can only be one. type is optional; use it (string, number, integer, boolean, object, array, null, or a list of them) when the shape matters to you.

Endpoints