kriyam.aistudioAPI reference
Kriyam Docwise

Start a document processing session

POSThttps://studioapi.kriyam.ai/models/docwise/v2

Content type multipart/form-data

Uploads a set of documents and starts reading them. It returns once the documents are stored and their pages rendered, before any of them have been read — results arrive at your webhook. Affordability is checked against the whole pipeline first, so a session you can't pay for never starts.

Request

curl -X POST "https://studioapi.kriyam.ai/models/docwise/v2" \
  -H "X-API-Key: $KRIYAM_API_KEY" \
  -F "files=@invoice.pdf" \
  -F "capability=extract" \
  -F "processing_mode=fast" \
  --form-string 'extraction_schema={"type": "object", "properties": {"invoice_number": {"type": "string", "description": "The invoice number printed by the seller"}, "invoice_date": {"type": "string", "description": "Date of issue, as YYYY-MM-DD"}, "seller_gstin": {"type": "string", "description": "GSTIN of the seller, not the buyer"}, "total_amount": {"type": "number", "description": "Grand total payable including tax"}, "line_items": {"type": "array", "description": "One entry per billed line", "items": {"type": "object", "properties": {"description": {"type": "string", "description": "What was billed"}, "amount": {"type": "number", "description": "Line total before tax"}}}}}}'

Response

{2 items
"session_id":"e3a91b47-0c25-4d6f-9b8a-71f4c2..."
"documents":[1 item
0:{4 items
"id":"1d7c4f92-8b3a-4e50-a6c1-9f28b5..."
"original_filename":"invoice.pdf"
"status":"uploaded"
"sequence":1
}
]
}

Authentication

Send your key in the X-API-Key header. See Authentication.

Request

Body

NameTypeRequiredDescription
filesfile[]Required

The documents — repeat the field once per file, up to 5. PDFs and images.

capabilitystringRequired

A step to run, repeated once per step: parse reads the text and layout, classify identifies what each document is, extract pulls structured fields out of it.

processing_modestringOptional

fast or accurate. Accurate costs more per page and is worth it on poor scans.

Default fast

fastaccurate

extraction_schemaobjectOptional

The fields extract should fill, as a JSON Schema object sent as JSON text. Every field needs a description saying what goes in it. Requires extract among the capabilities. Omit it to have Docwise generate a schema from the documents. At most 200 fields in all, nested 5 levels deep, 64 KB.

Response

200 OK

FieldTypeDescription
session_iduuid

The session. Everything else is read or reported by it.

documents[]object[]

The documents as stored, in the order you sent them. None of them have been read yet.

documents[].iduuid

One document within the session.

documents[].original_filenamestring

The filename you uploaded.

documents[].sequenceinteger

Its 1-based position in the session, which is how documents are ordered — files uploaded together share a timestamp, so that can't order them.

documents[].statusstring

Where this document has got to on its own.

Errors

StatusCodeWhen
400—

No file was sent, more than 5 were, no step was requested, or a requested step is unknown or not currently available. Also when extraction_schema is sent without extract, isn't a JSON Schema object, or has a field with no description — the message names the field.

Every keyed call can also get401402403404429— see Errors.