Each chapter contains the following:

  • Summary
  • One-line gist
  • Headline
  • Start and end timestamps

Auto Chapters and Summarization

You can only enable one of the Auto Chapters and Summarization models in the same transcription.

Quickstart

Enable Auto Chapters by setting auto_chapters to true in the transcription config. punctuate must be enabled to use Auto Chapters (punctuate is enabled by default).

import assemblyai as aai

aai.settings.api_key = "YOUR_API_KEY"

# audio_file = "./local_file.mp3"
audio_file = "https://assembly.ai/wildfires.mp3"

config = aai.TranscriptionConfig(auto_chapters=True)

transcript = aai.Transcriber().transcribe(audio_file, config)

for chapter in transcript.chapters:
  print(f"{chapter.start}-{chapter.end}: {chapter.headline}")

Example output

250-28840: Smoke from hundreds of wildfires in Canada is triggering air quality alerts across US
29610-280340: High particulate matter in wildfire smoke can lead to serious health problems

API reference

Request

curl https://api.assemblyai.com/v2/transcript \
--header "Authorization: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "audio_url": "YOUR_AUDIO_URL",
  "auto_chapters": true
}'
KeyTypeDescription
auto_chaptersbooleanEnable Auto Chapters.

Response

{
  "chapters": [
    {
      "gist": "...",
      "headline": "...",
      "summary": "...",
      "start": 0,
      "end": 0
    }
  ]
}
KeyTypeDescription
chaptersarrayAn array of temporally sequential chapters for the audio file.
chapters[i].giststringAn short summary in a few words of the content spoken in the i-th chapter.
chapters[i].headlinestringA single sentence summary of the content spoken during the i-th chapter.
chapters[i].summarystringA one paragraph summary of the content spoken during the i-th chapter.
chapters[i].startnumberThe starting time, in milliseconds, for the i-th chapter.
chapters[i].endnumberThe ending time, in milliseconds, for the i-th chapter.

The response also includes the request parameters used to generate the transcript.

Frequently asked questions

Troubleshooting