Skip to main content
An idempotency key identifies one request. Send it with the first attempt and reuse it if you need to retry, so Sail can return the existing request instead of starting another generation or batch.

Supported endpoints

For example:

Using a key

  • Generate a unique key, such as a UUID, for each new request.
  • Keys must be at most 255 bytes. A UUID fits within this limit.
  • Keep the same key, body, endpoint, and Sail API key for every retry.
  • Reusing a key with a different body returns HTTP 400.
  • Keys are scoped to your organization and API key. Switching API keys does not reuse the original submission.
A completed result is returned again when it is still available. A request without an available completion can return HTTP 409 with Retry-After. Wait before retrying with the same key. Using a new key would submit new work. For background requests, save the response ID and poll it for completion. See Retrying requests for retry delays, timeouts, and streaming errors.

Expiration

  • Keys last 24 hours. After that, reusing a key starts new work, which is billed again.
  • A result can expire 10 minutes after Sail first returns it, or 24 hours after the request if it is never read. Reading it again does not extend this.
  • An expired result returns HTTP 404 from both GET and a retry with the same key. The retry does not start new work.
Read each result once and save it.