Idempotency-Key header, which makes any call exactly-once safe regardless of how many times you send it.
Sending an idempotency key
Add theIdempotency-Key header to any request. Use a unique value per logical operation — a UUID is the best choice:
Retry behaviour
The outcome when you resend a request with the same key depends on the state of the original call:Original succeeded
fetchbean returns the original result immediately. You are not charged again — no second reserve, no second settle.
Original in flight
fetchbean returns a
request_in_progress response instead of dispatching a second call. Wait and retry.Original failed
The key is spent. Use a new key for your next attempt — the failed call is not replayed.
No key sent
fetchbean generates a unique key for you automatically. Every call without a key is treated as a distinct operation.
Billing protection
Idempotency and billing are tightly coupled in fetchbean. A call that reserves credits upfront only ever settles once — a same-key retry never triggers a second reservation or a second charge. This means you can safely retry on timeouts, connection drops, or any network error without worrying about being billed multiple times for a single logical operation.If you omit the
Idempotency-Key header entirely, fetchbean assigns a generated key automatically. This means every headerless call is treated as a unique request — no deduplication occurs.
