Docs
Contact Dashboard

AudreyTranscribe files

Transcribe files

Send a recording and get its transcript back in one response.

POSThttps://api.p99lab.com/v1/transcribe

Send a file

Send the audio file as the raw request body, with the options in the query string, or as a multipart form with the audio in a part named file and the options as form fields.

curl
# The file as the request body
curl https://api.p99lab.com/v1/transcribe \
  -H "Authorization: Bearer $P99LAB_API_KEY" \
  --data-binary @call.wav

# Or as a multipart form, with options as fields
curl https://api.p99lab.com/v1/transcribe \
  -H "Authorization: Bearer $P99LAB_API_KEY" \
  -F file=@call.wav \
  -F language=en \
  -F format=true
Python
import os

import requests

with open("call.wav", "rb") as f:
    r = requests.post(
        "https://api.p99lab.com/v1/transcribe",
        headers={"Authorization": f"Bearer {os.environ['P99LAB_API_KEY']}"},
        files={"file": f},
        data={"language": "en", "format": "true"},
        timeout=900,
    )
body = r.json()
if not r.ok:
    detail = body["detail"]
    raise SystemExit(detail if isinstance(detail, str) else detail["message"])
print(body["text"])
Node.js
import { readFile } from "node:fs/promises";

const form = new FormData();
form.append("file", new Blob([await readFile("call.wav")]), "call.wav");
form.append("language", "en");
form.append("format", "true");

const res = await fetch("https://api.p99lab.com/v1/transcribe", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.P99LAB_API_KEY}` },
  body: form,
});
const body = await res.json();
if (!res.ok) {
  throw new Error(typeof body.detail === "string" ? body.detail : body.detail.message);
}
console.log(body.text);

Options

languagestringdefault en

Language of the speech. Audrey serves English: send en or leave it out.

formatbooleandefault true

Write numbers, amounts, times and similar as people write them. false (also 0, no, off or raw) returns plain words. See written forms.

promptstringoptional

Context for the recording, up to 500 characters. In a multipart request send it as a form field; with a raw body, in the query string.

Response

{
  "text": "Thanks for calling. How can I help you today?",
  "audio_seconds": 12.84,
  "model": "audrey-0.7",
  "formatted": true
}

text is the whole transcript. audio_seconds is the length of the audio, which is what usage is charged on. formatted says whether written forms were applied. Audio with no speech returns empty text.

Long recordings

Files up to 4 hours are fine (2 hours on self-serve accounts). Audrey cuts long audio at quiet points, transcribes the pieces in parallel and joins the text, so a long call returns in one response.

Context prompt

prompt gives the model up to 500 characters of context along with the audio: what the recording is about, and the words you expect in it, such as people's names, product names and account terms. Longer text is cut at 500 characters.

curl https://api.p99lab.com/v1/transcribe \
  -H "Authorization: Bearer $P99LAB_API_KEY" \
  -F file=@call.wav \
  -F prompt="Support call for Lumen Dental. Agents: Priya Raman, Tomasz Wiśniewski."

Retries

A 4xx error means the request needs to change; retrying it as it is will not help. On a 5xx, retry with backoff: wait 1 s, then 2 s, then 4 s. See errors and limits.

↑↓ to move↵ to open