Aiter AI World
EnglishSign inGet started
Loading…

Caching and idempotency

Free exact-match replays, native prompt caching rates and safe retries.

Base URL for this deployment: https://www.aiteraiworld.com/api/v1

Exact-match response cache

Opt in with the X-AiterAI-Cache: 1 header or provider.cache set to true. An identical request from the same account within five minutes is answered from the cache at zero cost, with X-AiterAI-Cached: true and a new generation record marked cached.

Native prompt caching

When a provider reports cached prompt tokens, those tokens are billed at the model's cached rate instead of the input rate. The usage object exposes them under prompt_tokens_details.cached_tokens.

Idempotency keys

Send an Idempotency-Key header to make retries safe. The same key with an identical body replays the stored response for 24 hours without charging again. The same key with a different body is rejected with 409.

bash
curl https://www.aiteraiworld.com/api/v1/chat/completions \
  -H "Authorization: Bearer $AITER_API_KEY" \
  -H "Idempotency-Key: order-1234-summary" \
  -H "Content-Type: application/json" \
  -d '{"model": "author/model", "messages": [{"role": "user", "content": "Summarise order 1234"}]}'