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

# Idempotency and quotes

> Retry safely, and lock a price before you spend.

## Idempotency-Key

Every generation request needs an `Idempotency-Key` header: any unique string up to 255 characters, such as a UUID.

* Retry with the **same key and body** to get the original generation back. It is never sent or charged twice, even after a timeout or a dropped connection.
* Reuse a key with a **different body** and you get `409 idempotency_conflict`.
* Keys are scoped to your organization and the route.

## Quotes

`POST /quotes` validates a request exactly as its route would, then prices it. It generates nothing and holds no money.

```bash theme={null}
curl https://studio.superscore.ai/api/v1/quotes \
  -H "Authorization: Bearer $STUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"route": "/generations", "body": {"type": "video", "prompt": "A slow push in", "duration": 5}}'
```

To bind that price, send the quote's `id` as a `Quote-Id` header within ten minutes. If the body or route differs, or Studio changed its rates (the quote's `rate_version`) since the quote was made, the request returns `409 quote_mismatch`; request a new quote. If the quote is older than ten minutes, it returns `409 quote_expired`. Both happen before anything is held or sent. After a quote expires, a retry with the same Idempotency-Key and the same body still gets the original generation, but only if the first attempt went through. If it didn't, there is nothing to return: get a new quote and submit again. A changed body with the same key is not a replay: it gets `409 idempotency_conflict`.


## Related topics

- [Errors](https://docs.superscore.ai/errors.md)
- [Generate with Studio defaults](https://docs.superscore.ai/api-reference/generate-with-studio-defaults.md)
- [Generate a video with Wan 3.0's parameters](https://docs.superscore.ai/api-reference/generate-a-video-with-wan-30s-parameters.md)
- [Generate an image with Qwen Image 2.1's parameters](https://docs.superscore.ai/api-reference/generate-an-image-with-qwen-image-21s-parameters.md)
- [Price a request](https://docs.superscore.ai/api-reference/price-a-request.md)


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