invoice_numbertext0.990.01Playground
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.
INVOICE INV-2291From: Northwind SupplyTo: Contoso LtdIssued: 2026-09-02Total due: 1080.00
{ "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." }}These two examples differ by one detail. The result changes with them.
What changedComplete invoice → amount missing
invoice_numbertext0.990.01amountnumber0.960.02Set SYSTEM_ONE_API_KEY. The snippet uses a published catalog model id.
{"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 "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."}}}'// 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;