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

# Idempotency

> Retry safely without paying twice.

Send an `Idempotency-Key` header on `POST` requests that cost credits. If the network drops and you retry with the same key and the same body, you get the first result back and are charged once.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://api.gainflow.ai/v1/scrape \
  -H "Authorization: Bearer $GAINFLOW_API_KEY" \
  -H "Idempotency-Key: 6f1c2f0e-retry-safe" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'
```

* Keys last **24 hours**.
* Keys can be up to 128 characters. A UUID works well.
* Reusing a key with a **different body** returns `409` with the code `CONFLICT`.


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