> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch extraction

> The same fields from many documents in one call.

`POST /v1/extract/batch` takes up to 64 `contents` and one `extract`. `results` follows the order of `contents`.

## Request

```bash theme={"theme":"github-light"}
curl -s https://api.levanto.ai/v1/extract/batch \
  -H "Authorization: Bearer $LEVANTO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "contents": [
    "Two oat lattes and a croissant, pickup at 8:15 for Dana.",
    "One flat white for Marco, pickup at 9:30.",
    "Is the café open on Sunday?"
  ],
  "extract": {
    "customer": "the name of the customer",
    "pickup_time": {"type": "time"},
    "items": ["an item ordered"]
  }
}'
```

## Response

```json theme={"theme":"github-light"}
{
  "results": [
    {"ok": true, "values": {"customer": "Dana", "pickup_time": "08:15", "items": ["Two oat lattes", "a croissant"]}, "results": { ... }, "error": null},
    {"ok": true, "values": {"customer": "Marco", "pickup_time": "09:30", "items": ["One flat white"]}, "results": { ... }, "error": null},
    {"ok": true, "values": {"customer": null, "pickup_time": null, "items": []}, "results": { ... }, "error": null}
  ],
  "meta": {"model": "levanto-sage-2", "mode": "fast", "usage": {"input_tokens": 581, "output_tokens": 628}, "latency_ms": 215.4}
}
```

A document that fails (for example, too long) comes back as `{"ok": false, "error": "..."}`. The rest still answer, and the failed one isn't charged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.