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

# Billing

> Understand billed detections and your sample document allowance.

Detections are billable by default. Sample runs are available for development,
testing, and demonstrations, with a **fixed sample document allowance per end
customer**. They are not unlimited.

Confirm your contract details with your Trelent contact before using sample
runs, including the number of sample documents allowed per end customer and
any applicable allowance period. Your contract defines the allowance and
billing terms.

## Mark a sample run

Send `X-Sample-Run: true` when you
[start a detection](/document-verification/api-reference/start-a-detection).
Your token must include `DocumentVerification:detections:create_sample`,
either directly or through a granted wildcard scope. See
[Authentication](/document-verification/authentication#scopes).

```bash theme={null}
curl -X POST "$TRELENT_API_URL/v1/detection" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-Sample-Run: true" \
  -d '{
    "source_url": "https://files.example.com/id-card.pdf",
    "doc_type": "id_card",
    "region": "BR",
    "submitted_by": "customer_123"
  }'
```

Replace the example URL with a reachable document URL. Use `submitted_by` for
your end customer's identifier.

The header marks the detection as non-billable; it does not increase your
contractual sample allowance. The response confirms the billing flag:

```json theme={null}
{ "id": "detection-...", "status": "QUEUED", "billable": false }
```

Sample runs perform the same analysis as billed runs. For production use,
omit `X-Sample-Run`; the detection is billable. If your token lacks the sample
scope, the sample request returns `403`.
