---
title: "Admin Audio Cache Sweep Empty"
method: POST
path: "/v1/admin/audio-cache/sweep-empty"
---

# Admin Audio Cache Sweep Empty

`POST /v1/admin/audio-cache/sweep-empty`

## Request

- Base URL: `https://api.storyflo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.storyflo.com/v1/admin/audio-cache/sweep-empty`
- Auth: none declared

Sweep R2 audio-cache for poisoned (sub-``min_bytes``) WAVs.

Background: a concurrency=8 era produced thousands of 0-byte / sub-1s
WAVs that now cause workers to claim a job, hit cache, fail audio_qa
with ``empty_or_unreadable_audio``, and stall the render queue. This
endpoint enumerates audio cache entries and deletes the poisoned ones
so the next render call re-runs Piper end-to-end. Scoped strictly to
``.wav`` objects via :meth:`R2Backend.list_audio_objects`; non-audio
caches (images at ``img/``, etc.) are never touched.

Auth: admin token (X-Storyflo-Email-Token). DEFAULT is dry-run; set
``dry_run=false`` to actually delete.

## Headers

- `x-storyflo-email-token` string, nullable

## Request body

- AudioCacheSweepBody: Body for the audio-cache sweep-empty endpoint. ``min_bytes`` defaults to 5000 — anything below that cannot be a valid >1s WAV at 48kHz mono 16-bit (header + ~1s of PCM = 96kB; we use 5kB as a conservative floor that catches truncated streams without risking any legit short chunk).
  - `dry_run` boolean
  - `min_bytes` integer
  - `deep` boolean
  - `deep_min_duration_s` number
  - `limit` integer
  - `start_after` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/storyflo/apis/storyflo-inference-router.md) · [All operations](https://skmtc.dev/storyflo/apis/storyflo-inference-router/llms.txt) · [OpenAPI document](https://skmtc.dev/storyflo/apis/storyflo-inference-router/revisions/c3a1a735ac7a?raw)
