Skip to content

Playground

Invoice extraction: what is the invoice number and amount?

What is the invoice number and amount? Clairic extracts both from invoice text. When the total due says "to be confirmed", the amount comes back null, because Clairic returns null when the input doesn't determine a value; the invoice number is still extracted.

Sample results do not change with the selected model.

How Clairic is billed: each 4KB of request content counts as one block, and anything under 4KB counts as one block; each block costs 2 credits. You're charged once per request, no matter how many fields you extract.

Request

state
text/plain
INVOICE INV-2291From: Northwind SupplyTo: Contoso LtdIssued: 2026-09-02Total due: 1080.00

Fields

fields
application/json
{  "invoice_number": {    "type": "text",    "instructions": "The invoice id printed on the document."  },  "amount": {    "type": "number",    "instructions": "The total amount due. Do not invent a currency symbol."  }}

Results

Sample data
Compare two examples

These two examples differ by one detail. The result changes with them.

What changedComplete invoice → amount missing

These results are sample data, not a live model run. Sign in to try them with your own content.
invoice_number: INV-4402 → INV-2291 amount: null → 1080
invoice_numbertext
INV-2291Value
Provider confidence0.99
Chance it's missing0.01
amountnumber
1080Value
Provider confidence0.96
Chance it's missing0.02

Copy the code

Set SYSTEM_ONE_API_KEY. The snippet uses a published catalog model id.

Request JSON
application/json
{"model":"clairic","state":"INVOICE INV-2291\nFrom: Northwind Supply\nTo: Contoso Ltd\nIssued: 2026-09-02\nTotal due: 1080.00","fields":{"invoice_number":{"type":"text","instructions":"The invoice id printed on the document."},"amount":{"type":"number","instructions":"The total amount due. Do not invent a currency symbol."}}}
cURL · POST /v1/systemone
sh
curl "https://system-one.dev/v1/systemone" \  -H "Authorization: Bearer $SYSTEM_ONE_API_KEY" \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: saved-operation-id' \  --data '{"model":"clairic","state":"INVOICE INV-2291\nFrom: Northwind Supply\nTo: Contoso Ltd\nIssued: 2026-09-02\nTotal due: 1080.00","fields":{"invoice_number":{"type":"text","instructions":"The invoice id printed on the document."},"amount":{"type":"number","instructions":"The total amount due. Do not invent a currency symbol."}}}'
TypeScript
TypeScript
// npm install @system-one-ai/core@0.8.0 @system-one-ai/adapter-system-one@0.7.0 @system-one-ai/transport-fetch@0.8.0import { createSystemOne } from '@system-one-ai/core';import { systemOneAdapter } from '@system-one-ai/adapter-system-one';import { createFetchTransport } from '@system-one-ai/transport-fetch';const client = createSystemOne({  baseURL: "https://system-one.dev/v1",  apiKey: process.env.SYSTEM_ONE_API_KEY!,  model: "clairic",  adapter: systemOneAdapter,  transport: createFetchTransport(),  timeoutMs: 30_000,  maxRetries: 0,});const result = await client.extract({  model: "clairic",  state: "INVOICE INV-2291\nFrom: Northwind Supply\nTo: Contoso Ltd\nIssued: 2026-09-02\nTotal due: 1080.00",  fields: {    "invoice_number": {      "type": "text",      "instructions": "The invoice id printed on the document."    },    "amount": {      "type": "number",      "instructions": "The total amount due. Do not invent a currency symbol."    }  },}, { headers: { 'Idempotency-Key': crypto.randomUUID() } });result.answers.invoice_number.valueresult.answers.amount.valueresult.response.requestId;