Idempotency

Retry safely without making a video twice.

Send Idempotency-Key: <uuid> on every POST that spends credits: /videos, /slideshows, /slideshows/batch, /ai/lines and /ai/captions. Other POSTs do not take one; to start an upload of a file safely twice, send its fingerprint (see Uploading footage).

  • Same key, same body: the API does the work once. A replay answers 200 with the first result and Idempotent-Replayed: true.
  • Same key, different body: 409 idempotency_conflict (/videos). An AI write sent again with the same key answers its first text and is not charged again; sent again while the first is still writing, it answers 409 request_in_progress (retry in a few seconds). Kept answers are deleted after a day.
  • No key: a retry may make a duplicate (and charge for it).

For a batch, one key covers the whole request: each video gets its own key derived from it (uuidv5(key, index)), so a retried batch never makes twins, even if it stopped half way.

The key must be a UUID. Make a new one for every new request:

const res = await fetch('https://getuser.app/api/v1/videos', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GETUSER_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({ drafts }),
});