NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+1 view

What does it mean to use idempotency, and at which level (client or backend) is the idempotency key created?

Practice

AI answer

Idempotency means that repeating the same request does not cause the side effect to happen again: for example, repeating a payment does not create a second charge. Usually, the client creates a key for a specific logical operation and reuses it for network retries. The backend stores the key in durable storage with a defined scope (for example, user and operation type), atomically associates it with the result, and returns the stored response on retries. It is also useful to check that the same key has not been sent with a different request body. For internal operations, the backend can create the key.