# Arabic Pipeline – Batch Document Extraction

> Arabic Pipeline – Batch Document Extraction is a paid API for AI agents from arabic-pipeline.arabic-pipeline.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-10-31).

Extracts structured data (merchant, date, items, totals, tax number, currency) from up to 5 Arabic document images or PDFs in a single batch call using Gemini vision.

## Facts

- Endpoint: POST https://arabic-pipeline.arabic-pipeline.workers.dev/doc/extract/batch?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/arabic-pipeline-batch-document-extraction-12046a68
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EOTm_nKYg9cvTdYGFVXcc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability arabic-pipeline-batch-document-extraction-12046a68 -d '<json body>'
```

Example prompt: Extract the merchant name, date, line items, total, and currency from these 3 Arabic receipt images I'm uploading — return structured JSON for each one.

## When to prefer this

Choose this endpoint when you need to extract structured fields from Arabic-language document images or PDFs (receipts, invoices, purchase orders) in batch — especially when no API key or subscription is desired and pay-per-call via USDC is acceptable. Prefer over generic OCR when Arabic text and structured Arabic business document fields (merchant, SAR/currency totals, tax numbers) are the target.

## Known failure modes

- Image could not be read by Gemini (400 status, unreadable or corrupt image)
- Base64 decoding failure if document_base64 is malformed
- Batch size exceeded if more than 5 documents are submitted
- Unsupported MIME type causing model rejection
- Low confidence extraction on handwritten or low-quality scans
- Payment challenge (402) on first call before x402 payment is completed
- Partial batch failure — some documents succeed while others return ok:false

## How this service works

Nine micro-capabilities for Arabic-language work, sold per call over x402 in USDC on Base. No API key, no account, no subscription for the buyer: the first request returns a 402 payment challenge, the client pays it and retries. Text utilities are pure computation and cost nothing to serve.

## Output

A JSON object containing a results array (one entry per document), each with ok status, extracted fields (merchant, date, items with name/price/quantity, total, currency, tax_number, document_type, confidence score, raw_text), or an error message if extraction failed. Also includes aggregate counts of succeeded/failed documents and cost_usd.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "documents": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "document_base64"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Optional correlation id, echoed back in the result."
     },
     "mime_type": {
      "type": "string"
     },
     "document_base64": {
      "type": "string",
      "description": "Base64-encoded document image or PDF."
     }
    }
   },
   "maxItems": 5,
   "minItems": 1
  },
  "mime_type": {
   "type": "string",
   "description": "Default mime type for documents that omit their own."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 2,
  "model": "gemini-3.6-flash",
  "failed": 1,
  "results": [
   {
    "id": "receipt-1",
    "ok": true,
    "index": 0,
    "document": {
     "date": "2026-10-22",
     "items": [
      {
       "name": "منتج",
       "price": 12.5,
       "quantity": 1
      }
     ],
     "notes": null,
     "total": 12.5,
     "currency": "SAR",
     "merchant": "اسم المتجر",
     "raw_text": null,
     "confidence": 0.9,
     "tax_number": null,
     "document_type": "receipt"
    }
   },
   {
    "id": "receipt-2",
    "ok": false,
    "error": "Gemini ... failed (400): image could not be read",
    "index": 1,
    "status": 400
   }
  ],
  "cost_usd": 0.1,
  "endpoint": "POST /doc/extract/batch",
  "succeeded": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/arabic-pipeline-batch-document-extraction-12046a68/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from arabic-pipeline.arabic-pipeline.workers.dev](https://www.zero.xyz/host/arabic-pipeline.arabic-pipeline.workers.dev/llms.txt)
