Idempotency keys
An idempotency key is a stable name for a unit of work. Same key = same operation. You own the key and idem0 uses it verbatim — it never generates one for you. Good keys come from something already stable in your system:- a job id from your queue
- a step id in an agent run
- a hash of the inputs that define the work
Replay
The first call for a key runs for real and idem0 stores the response (encrypted). Every later call with that key replays — idem0 returns the stored response byte-for-byte and tags it:Same key, different request
A key is a promise that the request is the same. If you send the same key with a different body, idem0 rejects it with422 Unprocessable rather than return the wrong cached answer. Send a key only for the request it belongs to.
If two identical calls race — the same key arrives while the first is still running — the second gets 409 Conflict. Retry it once the first finishes and you’ll get the replay.
BYOK
idem0 is bring-your-own-key. Your provider token lives in your provider SDK and travels on its normal auth header (x-api-key for Anthropic, Authorization: Bearer for OpenAI). idem0 forwards it upstream untouched and never stores or logs it. The only credential idem0 owns is your x-idem0-key.
Streaming works too
Streaming responses are idempotent the same way: the first stream is captured as it flows, and a replay re-emits the same stream, taggedidem0-idempotent-replayed: true. Use the same key you’d use for a non-streaming call.