Skip to main content
This guide will demonstrate how to use AssemblyAI’s LLM Gateway to process an audio file and find the best quotes via the chat completions endpoint.

Quickstart

Getting Started

Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for an AssemblyAI account and get your API key from your dashboard.

Step-by-Step Instructions

Step 1: Install dependencies

Install the required library:

Step 2: Set up your API key and headers

Step 3: Transcribe the audio file

Next, we’ll use AssemblyAI to transcribe a file and save our transcript for later use. We’ll enable speaker_labels to get utterances grouped by speaker.

Step 4: Extract utterances with timestamps

Then we’ll take the timestamped utterances array from our transcript and format it as structured data. Utterances are grouped by speaker and include continuous speech segments.

Step 5: Use LLM Gateway to extract engaging quotes

Finally, we’ll provide the timestamped utterances to the LLM Gateway chat completions endpoint to extract the most engaging quotes from this transcript with their associated timestamps in a structured JSON format.

Example Response