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

# Retrying chat requests

> How to retry a chat request safely without paying for the same work twice

The chat endpoints charge credits and can run for minutes, so a retried request is expensive if it runs twice. Send an `X-Request-ID` header and Base44 acts on only the first request that uses that value. A retry carrying the same value returns the app's current state without running the turn again or charging for it.

```bash theme={null}
api_key: YOUR_API_KEY
X-Request-ID: 8f2c1a9d-4b7e-4c3e-8a62-7b4d5e6f8a90
```

Use a fresh value for each action you intend to happen, and reuse a value only when retrying the same one. The header takes up to 64 characters of letters, digits, and hyphens. Anything else is ignored, and the request is treated as a new one.

A value is remembered for 10 minutes. After that, the same value runs again as a new request.

A message and the tool-call approvals that follow it are counted separately, so you can safely use the same value for both.

## Endpoints this applies to

* [Send chat message](/api-reference/send-chat-message)
* [Submit tool-call input](/api-reference/submit-tool-call-input)
* [Submit tool-call input (batch)](/api-reference/submit-tool-call-input-batch)
* [Edit and resend](/api-reference/edit-and-resend)

<Note>
  Treat this as a safeguard rather than a guarantee. On rare occasions Base44 cannot check whether it has seen a request ID before, and it runs the request instead of turning it away. A retry sent at that moment can still run twice.
</Note>
