Appearance
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see For full documentation content, see For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at
Auto Chapters
Automatically segment your audio into chapters with summaries using LLM Gateway
For the complete documentation index, see llms.txt
cURL quickstart — Auto Chapters (via LLM Gateway)
bash
# Step 1: Submit transcription
curl \
--header "Authorization: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"audio_url": "",
"speech_models": ["universal-3-pro", "universal-2"],
"language_detection": true
}'
# Step 2: Poll for result (replace TRANSCRIPT_ID)
curl \
--header "Authorization: YOUR_API_KEY"
# Step 3: Get paragraphs
curl \
--header "Authorization: YOUR_API_KEY"
# Step 4: Generate chapter summaries with LLM Gateway
curl \
--header "Authorization: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Provide a brief summary, gist, and headline for this section.
Text: YOUR_PARAGRAPH_TEXT"}
],
"max_tokens": 500
}'US & EU
Generate chapter summaries from your audio transcripts using LLM Gateway. This approach gives you full control over how chapters are created and summarized.
The auto_chapters parameter on the transcription API is deprecated. Use LLM Gateway as shown below for more flexible and powerful chapter summaries.
Quickstart
python
import requests
import time
base_url = ""
headers = {"authorization": "<YOUR_API_KEY>"}
# Step 1: Transcribe your audio file
audio_url = ""
data = {
"audio_url": audio_url,
"speech_models": ["universal-3-pro", "universal-2"],
"language_detection": True
}
response = requests.post(base_url + "/v2/transcript", json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id
while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
if transcription_result['status'] == 'completed':
break
elif transcription_result['status'] == 'error':
raise RuntimeError(f"Transcription failed: {transcription_result['error']}")
else:
time.sleep(3)
# Step 2: Get paragraphs from the transcript
paragraphs = requests.get(polling_endpoint + '/paragraphs', headers=headers).json()['paragraphs']
# Step 3: Combine paragraphs into groups for chapter summaries
combined_paragraphs = []
step = 2 # Adjust to control chapter length
for i in range(0, len(paragraphs), step):
paragraph_group = paragraphs[i : i + step]
start = paragraph_group[0]['start']
end = paragraph_group[-1]['end']
text = " ".join(p['text'] for p in paragraph_group)
combined_paragraphs.append({"text": text, "start": start, "end": end})
# Step 4: Generate chapter summaries with LLM Gateway
for chapter in combined_paragraphs:
llm_gateway_data = {
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": f"Provide a brief one-paragraph summary, a one-line gist, and a headline for this section of a transcript.\n\nText: {chapter['text']}"}
],
"max_tokens": 500
}
response = requests.post(
"",
headers=headers,
json=llm_gateway_data
)
result = response.json()["choices"][0]["message"]["content"]
print(f"{chapter['start']}-{chapter['end']}: {result}\n")javascript
const baseUrl = "";
const headers = {
authorization: "<YOUR_API_KEY>",
"content-type": "application/json",
};
// Step 1: Transcribe your audio file
const audioUrl = "";
const data = {
audio_url: audioUrl,
speech_models: ["universal-3-pro", "universal-2"],
language_detection: true,
};
const response = await fetch(`${baseUrl}/v2/transcript`, {
method: "POST",
headers,
body: JSON.stringify(data),
});
const { id: transcriptId } = await response.json();
const pollingEndpoint = `${baseUrl}/v2/transcript/${transcriptId}`;
let transcriptionResult;
while (true) {
const pollingResponse = await fetch(pollingEndpoint, { headers });
transcriptionResult = await pollingResponse.json();
if (transcriptionResult.status === "completed") {
break;
} else if (transcriptionResult.status === "error") {
throw new Error(`Transcription failed: ${transcriptionResult.error}`);
} else {
await new Promise((resolve) => setTimeout(resolve, 3000));
}
}
// Step 2: Get paragraphs from the transcript
const paragraphsResponse = await fetch(`${pollingEndpoint}/paragraphs`, {
headers,
});
const { paragraphs } = await paragraphsResponse.json();
// Step 3: Combine paragraphs into groups for chapter summaries
const step = 2; // Adjust to control chapter length
const combinedParagraphs = [];
for (let i = 0; i < paragraphs.length; i += step) {
const group = paragraphs.slice(i, i + step);
combinedParagraphs.push({
text: group.map((p) => p.text).join(" "),
start: group[0].start,
end: group[group.length - 1].end,
});
}
// Step 4: Generate chapter summaries with LLM Gateway
for (const chapter of combinedParagraphs) {
const llmGatewayData = {
model: "claude-sonnet-4-6",
messages: [
{
role: "user",
content: `Provide a brief one-paragraph summary, a one-line gist, and a headline for this section of a transcript.\n\nText: ${chapter.text}`,
},
],
max_tokens: 500,
};
const result = await fetch(
"",
{
method: "POST",
headers,
body: JSON.stringify(llmGatewayData),
}
);
const resultData = await result.json();
console.log(
`${chapter.start}-${chapter.end}: ${resultData.choices[0].message.content}\n`
);
}Example output
plain
240-60890:
Headline: Canadian Wildfire Smoke Triggers Air Quality Alerts Across the US
Gist: Wildfire smoke affects US air quality
Summary: Smoke from hundreds of wildfires in Canada is causing hazy conditions and air quality alerts in multiple states. Peter DeCarlo, an environmental health expert from Johns Hopkins University, explains that dry conditions and specific weather patterns are channeling the smoke southward, affecting the mid-Atlantic and Northeast regions.
62270-113214:
Headline: Baltimore Air Quality Reaches Unhealthy Levels Due to Particulate Matter
Gist: Dangerous particulate matter levels in Baltimore
Summary: The air quality in Baltimore has reached unhealthy levels due to high concentrations of particulate matter. These microscopic particles can affect respiratory, cardiovascular, and neurological systems, measuring 150 micrograms per cubic meter—10 times higher than the annual average.Customize your chapters
You can adjust the chapter generation by modifying the step variable to control how many paragraphs are grouped into each chapter, and by customizing the prompt.
Structured chapter output
For a more structured output, use Structured Outputs or specify a JSON format in your prompt:
python
prompt = """For this section of a transcript, provide the following in JSON format:
{
"headline": "A single sentence headline",
"gist": "A few words summarizing the section",
"summary": "A one paragraph summary"
}
Text: """ + chapter['text']API reference
Step 1: Transcribe audio
bash
curl \
--header "Authorization: <YOUR_API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"audio_url": "YOUR_AUDIO_URL"
}'Step 2: Get paragraphs
Once the transcript is complete, fetch the paragraphs:
bash
curl \
--header "Authorization: <YOUR_API_KEY>"Step 3: Generate chapter summaries with LLM Gateway
bash
curl \
--header "Authorization: <YOUR_API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Provide a brief summary, gist, and headline for this section.\n\nText: YOUR_PARAGRAPH_TEXT"}
],
"max_tokens": 500
}'| Key | Type | Description |
|---|---|---|
model | string | The LLM model to use. See available models. |
messages | array | The messages to send to the model, including your prompt and paragraph text. |
max_tokens | number | Maximum number of tokens in the response. |
Next steps
- LLM Gateway Overview - Learn more about available models and features
- Apply LLM Gateway to pre-recorded audio - General guide for using LLM Gateway with transcripts
- Structured Outputs - Constrain responses to a specific JSON schema