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

# Idempotency

> Retry requests without starting or paying for a job twice.

Send an `Idempotency-Key` header on `POST` requests:

```bash theme={null}
curl -X POST https://anythingmd.com/api/v1/jobs \
  -H "Authorization: Bearer $ANYTHINGMD_API_KEY" \
  -H "Idempotency-Key: invoice-8841" \
  -H "Content-Type: application/json" \
  -d '{ "source": { "type": "external", "fileUrl": "https://example.com/invoice.pdf" } }'
```

Retrying with the same key returns the original result (`200` instead of `201`) instead of starting and charging for a second job. Use a value that identifies the work, such as your own document ID.

Idempotency applies to creating jobs, creating uploads and canceling jobs.
