Skip to main content
A timeout does not tell you whether a prediction finished. Keep the original request and its Idempotency-Key, then send both again to recover the recorded result.

Keep the operation together

Create one key per logical prediction and save it alongside the request body. Use the key for every attempt to retrieve that prediction’s outcome.
For the support example, rerun just the curl command after a timeout. Keep prediction.json and D1_OPERATION_KEY unchanged.

Handle the result

An accepted terminal failure replays as the same uncharged failure. A deliberate new attempt needs a new key. A validation or insufficient-credit rejection before acceptance does not consume the key.

Know the replay window

Completed results are available for 24 hours by default. After that, a tombstone prevents the same key from starting new work until 30 days from acceptance. Never recycle keys: once a tombstone expires, an old key can be accepted as a new operation. See API behavior for deadlines, retention, and error handling.