Cloudflare Clairic: Document Extraction and API Costs
Cloudflare Clairic turns text, images and PDF pages into typed values, estimates and forecasts. The hosted family has a 27B Clairic model and a 9B Clairic-flash model. Workers AI charges for input tokens only. Both weight releases use Apache 2.0, so you can also evaluate self-hosting separately from the hosted API.
Content reviewed:
Try Clairic on Workers AI ↗
Use this model
See access details in the guide below.
What can Clairic extract or calculate?
- Read invoice fields, calculate totals and due dates, and return null for a purchase-order number that is not present.
- Extract values from scanned receipts, insurance documents, contracts and other records with defined fields.
- Return a typed estimate with an interval or forecast a bounded series when the input supports a range rather than an exact answer.
Ask for fields instead of a free-form summary
Send a state with a schema of fields. Each field names the answer type you need, such as text, number, date, list, estimate or forecast. The response returns a value for each field with confidence and validity information. Text fields can include source spans, and missing values can return null. Your application should still verify required totals and dates before writing them into a financial or customer record.
For an invoice, define the total as a USD number, the due date as a date derived from the invoice terms, and the purchase-order number as text. Use a compute field when arithmetic has to be explicit. A separate generative model is still needed when the result must include a narrative explanation or a customer-facing reply.
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clairic \
-H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "clairic",
"state": "Invoice INV-2291, issued 2026-09-02, net 30. Four items at $250 each and $80 shipping.",
"fields": {
"due_date": {"type": "date", "instructions": "Issue date plus payment terms"},
"total": {"type": "number", "decimals": 2, "unit": "USD", "instructions": "Include shipping"},
"purchase_order": {"type": "text", "instructions": "Purchase order number"}
}
}'Choose Clairic or Clairic-flash
Cloudflare hosts Clairic as a 27B model and Clairic-flash as a 9B model. The larger model is aimed at higher-quality extraction, while Flash is the smaller, faster option. Both hosted endpoints have a 65,536-token context window, accept images and PDFs, and return the same typed field structure. Both model weights are published under Apache 2.0.
Cloudflare’s launch evaluation gives a reason to test the endpoint again after the switch. On 336 fresh text fields, Clairic 27B matched 335, Clairic-flash matched 328, the original preview matched 295, and the D1.2 pipeline with Apple Vision OCR matched 304. On fresh image fields, the median full response from Cloudflare’s self-hosted test server was 453 ms for Clairic and 305 ms for Flash. Use the field scores to choose what to recheck and measure round-trip time from your own application before sizing a queue.
Try both variants on the same labeled records before routing a production workload. Include blurry phone photos, missing fields, tables, multiple pages and non-English documents only when those cases appear in your own inputs. Compare exact field accuracy, null handling, latency and the cost of additional passes. Parameter count alone does not establish which variant will be cheaper per accepted record.
| Workers AI model | Parameters | Promo through Nov 30 | From Dec 1 | Output tokens |
|---|---|---|---|---|
| Clairic | 27B | $0.10 / 1M input | $0.24 / 1M input | No charge |
| Clairic-flash | 9B | $0.10 / 1M input | $0.10 / 1M input | No charge |
Estimate a Workers AI extraction bill
Workers AI bills input tokens, including image tokens, and does not charge for output tokens. At 50,000 input tokens in one request, either variant costs $0.005 through November 30. From December 1, the same request costs $0.012 on Clairic or $0.005 on Clairic-flash. Use actual usage and pass counts from the response for your estimate.
The invoice response in the Workers AI docs shows three passes, 61 state tokens, 472 schema tokens and 655 total input tokens. In that example the sum is 61 × 3 + 472. Read the aggregate input_tokens for billing. The returned schema total already accounts for the request, and multiplying the full input total by the pass count would double-count usage. Measure the same document with and without additional fields to see how your schema affects the total.
The image endpoint accepts up to four images. It converts images into 32-by-32-pixel patches and charges those tokens at the model’s input rate. Rendered PDF pages and images share a four-page total. Workers AI caps each embedded file at 4 MiB, with an 8 MiB decoded limit across images and documents. Split larger batches before submitting them. The full state and images are included again on every additional pass, so a schema that triggers several passes can bill the same source repeatedly. Keep fields in one pass where possible and check the pass count before projecting a large batch.
| One request with 50,000 input tokens | Through Nov 30 | From Dec 1 |
|---|---|---|
| Clairic · 27B | $0.005 | $0.012 |
| Clairic-flash · 9B | $0.005 | $0.005 |
Read older Clairic tests with the model version in view
An independent GitHub test bench compared the earlier 9B Clairic preview with Claude Haiku 5.5 on 1,462 records from eight document sets on October 24, 2026. Results varied by task. Clairic scored 91.5% on CORD photographed receipts and 93.8% on image-based ACA health plans, while Haiku did better on six of the eight sets and Clairic reached 47.4% on SROIE scanned receipts. The author also found that Clairic often returned a value where a document left it unspecified.
In that test, the earlier Clairic preview cost $0.18 per thousand CORD receipts versus $0.43 for Haiku 5.5. For the longer Charity reports it cost $3.15 per thousand versus $2.04. Across all 1,462 tested documents, the estimated list-price totals were $1.94 and $1.74 respectively. Answers that Clairic scored at least 0.9 were at least 93.7% correct on each test set. To choose a review threshold, measure how many labeled fields fall below it as well as how often the accepted fields are right.
Cloudflare replaced the old preview endpoint with the updated 27B Clairic model and moved the 9B variant to Clairic-flash. Those October results do not evaluate the current 27B release or confirm the current Flash checkpoint. Use them to choose test cases, especially missing-value handling and scanned receipt layouts, then score the currently hosted variants on your own labeled records.
Self-host the open weights when documents must stay in-house
Cloudflare publishes the Clairic and Clairic-flash weights under Apache 2.0. Self-hosting removes Workers AI input-token charges, but shifts the budget to GPU time, memory, storage, setup, concurrency and maintenance. The model repository contains weight files and custom model code. Measure a complete extraction batch on the hardware and runtime you plan to keep, including image preprocessing and retries, before comparing it with the hosted per-record cost.
For organizations that can use hosted inference, the Workers AI endpoints are marked zero data retention. That setting and the account terms are specific to the hosted service. Review the model and platform terms that apply to your chosen deployment before sending private documents.
Before you use it
- Cloudflare limits a request to four total images or PDF pages. Split longer documents into batches and reconcile fields that span pages.
How to get started
Run both variants against labeled examples from your documents, verify missing-value behavior, and budget from the actual input-token and pass counts.
Sources
Sources (6)
- Cloudflare Clairic model and API documentation ↗
Source checked:
- Cloudflare Clairic-flash model and API documentation ↗
Source checked:
- Cloudflare model release and pricing announcement ↗
Source checked:
- Clairic open weights and license ↗
Source checked:
- Clairic-flash open weights and license ↗
Source checked:
- Independent Clairic document benchmark ↗
Source checked: