# Invoice OCR API

Read an invoice image as itemized JSON.

Send an invoice image or PDF as a base64 data URI. Sats4AI returns the text it read and structured quantities, prices, tax and total.



Provider in the worked example: Sats4AI.

Price shown for this route: 1.4602¢ for one tested request.



## What it can do

### Extract line items and reconcile invoice TF-025.

Send an invoice image or PDF as a base64 data URI. Sats4AI returns the text it read and structured quantities, prices, tax and total.

Price: 1.4602¢ per tested request.


## A real example

Tested on 2026-11-25 through Sats4AI.

One paid call from our own test run.

Your agent asked: Extract line items and reconcile invoice TF-025.

Returned in this test:

- Source invoice: [TF-025](/examples/invoice-tf-025.png)
- Line items: 2 notebooks at $6 and 1 pen at $3
- Subtotal and tax: $15.00 plus $1.50
- Invoice total: $16.50 USD

Charged in this test: $0.014602.

One clean, single-page sample. The invoice omits a merchant and issue date; both fields came back empty.




## Try the API request

Use your TaskFuel API key as TASKFUEL_API_KEY in your terminal or server. Keep it out of browser code.

### 1. Check the price

This request checks the price without paying. Replace REPLACE_WITH_BASE64_IMAGE_BYTES with the base64 contents of the sample PNG or your own invoice.

```sh
curl --fail-with-body https://app.taskfuel.ai/v1/call \
  -H "Authorization: Bearer $TASKFUEL_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'TASKFUEL_REQUEST'
{
  "url": "https://sats4ai.com/api/l402/extract-receipt",
  "method": "POST",
  "body": {
    "document": "data:image/png;base64,REPLACE_WITH_BASE64_IMAGE_BYTES"
  },
  "dryRun": true
}
TASKFUEL_REQUEST
```

### 2. Run the request

Review amount_usd in the quote. To pay and run, change dryRun to false and add maxAmountUsd with that approved amount inside the same JSON object. Keep the inputs unchanged; this limit applies to one call.

### 3. Read the result

Read structured.items, structured.subtotal, structured.tax and structured.total. The sample totals reconcile to $16.50.



[Setup and API reference](https://taskfuel.ai/docs/) · [Job polling and timeout recovery](https://app.taskfuel.ai/using.md)


## Connect your agent

Read the [setup guide](https://taskfuel.ai/docs/setup/) and choose the connection your agent supports.

Use one TaskFuel account and prepaid balance. Inspect the provider and request quote before a paid call, then review the returned response and recorded charge.



## When to use it

### Recover quantities and unit prices.

The extractor read two notebooks at $6 each and one pen at $3. Each line included its own total.

### Compare the reported total with the line items.

The lines add to $15. With the $1.50 tax the sum matches the printed $16.50.




## Questions

### Does receipt OCR return a value for every field?

The response includes rawText alongside structured fields. The sample had no merchant name or date. Both returned null, while invoiceNumber matched TF-025.

### How much did this request cost?

The Sats4AI request cost $0.014602 on 25 November 2026. Your agent shows the price for your own request before it pays.

## Related tool guides

- [Pdf to markdown api](https://taskfuel.ai/tools/pdf-to-markdown-api/)
- [Extract webpage](https://taskfuel.ai/tools/extract-webpage/)


## Reference

- [Read this guide on the website](https://taskfuel.ai/tools/invoice-ocr-api/).
- [Browse providers and capabilities](https://taskfuel.ai/catalog/).
- [Pricing](https://taskfuel.ai/pricing/).
- [Agent instructions](https://taskfuel.ai/llms.txt).
