1. Create the tasks every day
daily.mjs
- The
Idempotency-Keynames the day, the prompt and the model. If the job runs twice, or you rerun it after an error, no task is charged twice. metadatacomes back on the task and in the webhook. Use it to file each result under its prompt set and day.
2. Store each result
ThewebhookUrl gets task.completed for each task. Verify the signature, then save what you need: the result is readable for 7 days only.
verifyWebhook is in Verify webhook signatures.
3. Watch for failures
A failed task is refunded, and its webhook istask.failed. To find the failures of a day, list them:
Idempotency-Key, for example with -retry1 at the end.
Next: Compare brands across models.