Tasks

Destroy the stored content of a finished task

Removes the task's generated media objects, its result payload, and the stored request text including the prompt.

Billing evidence is never touched. The ledger, the charged amount, the model identifier, the state, the timestamps and the request_id all remain, so the task stays fully auditable in billing. What is destroyed is the content, not the spend record; the response repeats this as billingRetained.

Only a finished task can be destroyed; a task that is still queued or running returns 400. Its outputs have not landed yet, and removing half of them is worse than removing none. An accepted generation task cannot be stopped, so the only thing to do is wait for it to reach a terminal state and call this endpoint then.

The call is idempotent by taskId: destroying an already destroyed task returns 200 with the original purgedAt, so a client may safely retry after a timeout. This endpoint does not read an Idempotency-Key header; the taskId itself is the idempotency key.

Media objects are removed by a background sweep within about a minute, so mediaDeletionPending can be true while contentState is already purged. Deleting them inline would let one undeletable object block the whole request.

post/api/v1/jobs/purge

Request

  • Base URL: https://api.spicyapi.ai
  • URL: https://api.spicyapi.ai/api/v1/jobs/purge
  • Auth: HTTP bearer

Request body

taskIdstring required

Response

Content destroyed, or already destroyed by an earlier call.

code200 required
msg'success' required
request_idstring required

Correlation identifier. Include it in support requests.

Changes

No recorded changes to this operation across all 1 revision of this API.