Managing history
Successful text-to-speech requests are recorded in history with input text, voice, status, timestamp, and audio. Async text-to-speech jobs use the same id for generation_job_id and history_item_id, so they appear in history while they move from active to ready or failed.
Listing recent requests
python
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
items = client.history.list()
for item in items["history"]:
print(item["history_item_id"], item["text"])
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
const items = await client.history.list();
for (const item of items.history) {
console.log(item.historyItemId, item.text);
}
curl
curl https://api.breeze.blue/v1/history \
-H "xi-api-key: $BREEZE_API_KEY"
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
items = client.history.list()
for item in items["history"]:
print(item["history_item_id"], item["text"])Downloading audio
Pull the original audio for a recorded request and save it locally. The logs page also offers inline playback and a direct download link. For async jobs, use the generation jobs audio endpoint; active jobs return GENERATION_NOT_READY with Retry-After.
python
import os
from pathlib import Path
from breeze_blue import BreezeBlue, save
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
audio = client.history.download_audio(
history_item_id="hist_01haudio",
)
save(audio, Path("history.mp3"))
async_audio = client.generation_jobs.download_audio("job_01hasync")
save(async_audio, Path("async.mp3"))
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
import { save } from "@breeze.blue/sdk/node";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
const audio = await client.history.downloadAudio("hist_01haudio");
await save(audio, "history.mp3");
const asyncAudio = await client.generationJobs.downloadAudio("job_01hasync");
await save(asyncAudio, "async.mp3");
curl
curl https://api.breeze.blue/v1/history/$HISTORY_ITEM_ID/audio \
-H "xi-api-key: $BREEZE_API_KEY" \
--output history.mp3
curl https://api.breeze.blue/v1/generation-jobs/$GENERATION_JOB_ID/audio \
-H "xi-api-key: $BREEZE_API_KEY" \
--output async.mp3
import os
from pathlib import Path
from breeze_blue import BreezeBlue, save
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
audio = client.history.download_audio(
history_item_id="hist_01haudio",
)
save(audio, Path("history.mp3"))
async_audio = client.generation_jobs.download_audio("job_01hasync")
save(async_audio, Path("async.mp3"))Deleting items
Purge test runs before sharing logs, or clean up old generations. The SDK exposes history.delete; the HTTP equivalent is DELETE /v1/history/{history_item_id}.
python
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
client.history.delete("hist_01haudio")
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
await client.history.delete("hist_01haudio");
curl
curl -X DELETE https://api.breeze.blue/v1/history/$HISTORY_ITEM_ID \
-H "xi-api-key: $BREEZE_API_KEY"
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
client.history.delete("hist_01haudio")