New AssemblyAI-STT-3.7: Next-generation transcription models. Learn more about AssemblyAI-STT-3.7
Insights & Use Cases

Summarize audio with LLMs in Node.js

Transcribe audio with AssemblyAI-STT-3.7 and summarize it through LLM Gateway in Node.js, with Sync API clips, structured JSON, fallbacks and EU residency.

Abstract green sphere illustration

Written by

Niels Swimberghe

Published on

15 September 2026

Summarizing audio is a two-step job: convert speech to text, then pass that text to an LLM. In Node.js you can do both with one API key. AssemblyAI’s speech-to-text API handles the transcription with AssemblyAI-STT-3.7, and LLM Gateway routes the transcript to Claude, Gemini, GPT or an open model hosted by AssemblyAI without a second provider account. This guide builds a working script, then covers the parts that matter in production: picking a model for your audio length, handling short clips with the Sync API, logging for support, and keeping data in a specific region.

All the code is in the companion repo, kelsey-aai/summarize-audio-nodejs.

What is audio summarization?

Audio summarization is the process of producing a short, structured description of what was said in a recording. It is almost never a single model call. The standard pipeline is transcription followed by summarization: a speech recognition model converts the audio to text, and a language model compresses that text into a paragraph, a bullet list, action items or a JSON object.

That two-stage shape matters because the two stages fail differently. The LLM stage fails visibly: you get a summary that misses the point, and you fix the prompt. The transcription stage fails invisibly. The LLM receives a clean, fluent, confidently wrong sentence and summarizes it faithfully.

How accurate is automated audio summarization?

Summary quality is bounded by transcript quality. An LLM can’t recover a name it never received. If the transcript renders a customer as “Anita Deshpande” when she said “Anita Deshmukh,” every summary downstream carries the wrong name, and no amount of prompt engineering fixes it. The same holds for figures, product names and speaker attribution: if the transcript assigns a commitment to the wrong speaker, the action-item list assigns it to the wrong person.

So the useful accuracy question is how much error enters the pipeline before the LLM ever runs. Two things decide it. The first is word accuracy on realistic audio, especially names, numbers and code-switched speech, where models are most likely to substitute a plausible-sounding wrong word. The second is speaker diarization: any summary that says “who agreed to what” depends on it. AssemblyAI-STT-3.7 is the flagship pre-recorded model for both jobs, with 32 languages, native code switching, contextual prompting and a new speaker diarization model. Methodology and results for current models are on the benchmarks page.

Researchers score summarization itself with ROUGE against human-written references, and that is worth knowing about, but it is the wrong lever to pull first. Swapping summarization models moves quality at the margin. Cutting upstream transcription error moves it structurally.

Set up your environment

You need Node.js 20 or later and an AssemblyAI API key. Create a project:

mkdir summarize-audio-nodejs
cd summarize-audio-nodejs
npm init -y

Turn on ES modules so you can use import and top-level await:

npm pkg set type=module

Install the AssemblyAI Node.js SDK. The code in this guide was checked against version 4.42.1:

npm install assemblyai

Set your API key as an environment variable:

# macOS / Linux
export ASSEMBLYAI_API_KEY=<YOUR_KEY>

# Windows (PowerShell)
$env:ASSEMBLYAI_API_KEY="<YOUR_KEY>"

Every script in this guide shares one small module, client.js. It creates the SDK client, picks US or EU endpoints from an environment variable, and wraps the LLM Gateway chat completions endpoint with plain fetch:

import { AssemblyAI } from 'assemblyai';

const apiKey = process.env.ASSEMBLYAI_API_KEY;
if (!apiKey) {
  console.error('Set ASSEMBLYAI_API_KEY before running this script.');
  process.exit(1);
}

// ASSEMBLYAI_REGION=eu keeps transcription, Sync and LLM Gateway traffic in the EU.
const eu = process.env.ASSEMBLYAI_REGION === 'eu';

export const client = new AssemblyAI({
  apiKey,
  baseUrl: eu ? 'https://api.eu.assemblyai.com' : 'https://api.assemblyai.com',
  syncBaseUrl: eu ? 'https://sync.eu.assemblyai.com' : 'https://sync.assemblyai.com'
});

const GATEWAY_URL = eu
  ? 'https://llm-gateway.eu.assemblyai.com/v1/chat/completions'
  : 'https://llm-gateway.assemblyai.com/v1/chat/completions';

export async function chatCompletion(body) {
  const response = await fetch(GATEWAY_URL, {
    method: 'POST',
    headers: { authorization: apiKey, 'content-type': 'application/json' },
    body: JSON.stringify(body)
  });

  const result = await response.json().catch(() => ({}));
  if (!response.ok) {
    throw new Error(
      `LLM Gateway error ${response.status} (request_id: ${result.request_id ?? 'n/a'}): ` +
        JSON.stringify(result)
    );
  }

  // Log both on every call: request_id is what support asks for, and the
  // model field shows which model answered when a fallback fired.
  console.error(`request_id=${result.request_id} model=${result.model ?? result.request?.model}`);
  return result;
}

The helper stops with a clear message when ASSEMBLYAI_API_KEY is missing, throws on any non-2xx Gateway response with the status and request_id in the message, and logs request_id and the answering model on every success. The error-handling section below explains why both matter.

Transcribe and summarize audio with LLMs

The workflow is two calls. The SDK uploads and transcribes the audio, then you send the resulting transcript ID to LLM Gateway. You never move the transcript text through your own process.

Transcribe the audio with AssemblyAI-STT-3.7

Create summarize.js:

import { client, chatCompletion } from './client.js';

const audio = process.argv[2] ?? 'https://assembly.ai/sports_injuries.mp3';

const transcript = await client.transcripts.transcribe({
  audio,
  // AssemblyAI-STT-3.7 covers 32 languages; Universal-2 picks up the rest of the 99.
  speech_models: ['assemblyai-stt-3-7', 'universal-2'],
  language_detection: true
});

if (transcript.status === 'error') {
  console.error(`Transcription failed: ${transcript.error}`);
  process.exit(1);
}
console.error(`transcript_id=${transcript.id}`);

speech_models is an array on the pre-recorded API, and AssemblyAI-STT-3.7 takes priority wherever it appears in the list. It is the flagship (assemblyai-stt-3-7) at $0.21/hr and covers 32 languages with native code switching. Adding universal-2 after it extends coverage to 99 languages, and with language_detection on, audio in a language 3.7 doesn’t support falls back to Universal-2. Current rates are on the pricing page, and the model selection docs describe the fallback rules. Universal-3.5 Pro, the previous pre-recorded model, was deprecated on November 17, 2026. From December 8, 2026, existing accounts that don’t set speech_models move to AssemblyAI-STT-3.7 automatically.

A failed transcription doesn’t throw. The promise resolves with status set to error and a message in transcript.error, so check it before you spend LLM tokens.

Summarize the transcript with LLM Gateway

Add the summarization call to the end of summarize.js. Pass transcript_id and put the {{ transcript }} tag in your prompt. The Gateway swaps in the transcript text server-side, so you aren’t shipping the full text back up the wire:

const result = await chatCompletion({
  model: process.env.SUMMARY_MODEL ?? 'claude-sonnet-4-6',
  messages: [
    {
      role: 'user',
      content: 'Summarize this transcript in one short paragraph.\n\n{{ transcript }}'
    }
  ],
  transcript_id: transcript.id,
  max_tokens: 1000,
  fallbacks: [{ model: 'gemini-3.7-flash' }, { model: 'claude-haiku-4-5-20251001' }],
  fallback_config: { depth: 2 }
});

console.log(result.choices[0].message.content);

The tag must be exactly {{ transcript }}, with the spaces. Only its first occurrence, in the first message that contains it, is replaced, and it carries the transcript’s plain text only, without speaker labels. If the transcript ID doesn’t exist or belongs to another account, the Gateway returns 404. The apply LLMs to audio files guide and the chat completions reference cover the full request.

The fallbacks array and fallback_config are covered under error handling below. SUMMARY_MODEL lets you switch models without editing code.

Run the script

node summarize.js                 # a public sample file
node summarize.js ./meeting.mp3   # any local file or URL

The summary prints to stdout. The transcript ID, request_id and model go to stderr, so you can pipe the summary into another tool and still keep the IDs in your logs.

Build this on your own audio

One API key covers transcription and summarization. Get free credits and run the script above against your own files in a few minutes.

Sign up free

Summarize short audio with the Sync API

If your audio is a short clip, such as a voice note, a voicemail or a push-to-talk message, you don’t need the upload-and-poll flow. The Sync API takes the audio in one request and returns the transcript in the response, with no job to track. It runs on Universal-3.6 Pro (universal-3-6-pro); AssemblyAI-STT-3.7 is a pre-recorded model and isn’t offered on Sync.

import { SyncTranscriptError } from 'assemblyai';
import { client, chatCompletion } from './client.js';

const audioPath = process.argv[2] ?? './sample.wav'; // WAV or raw PCM, up to 120 seconds

let text;
try {
  await client.sync.warm(); // open the connection before the audio is ready
  const result = await client.sync.transcribe(audioPath, { model: 'universal-3-6-pro' });
  console.error(`session_id=${result.session_id}`);
  text = result.text;
} catch (error) {
  if (error instanceof SyncTranscriptError) {
    console.error(`Sync transcription failed (${error.status}/${error.errorCode}): ${error.message}`);
    process.exit(1);
  }
  throw error;
}

// There is no async transcript to reference, so send the text itself.
const summary = await chatCompletion({
  model: process.env.SUMMARY_MODEL ?? 'claude-haiku-4-5-20251001',
  messages: [
    { role: 'user', content: `Summarize this voice note in two sentences.\n\n${text}` }
  ],
  max_tokens: 300,
  fallbacks: [{ model: 'gemini-3.7-flash' }]
});

console.log(summary.choices[0].message.content);

Summarizing is the same Gateway call. The difference is that you pass the text directly instead of a transcript_id, because there is no async transcript object to reference. warm() opens the HTTPS connection ahead of time, so call it as soon as you know a clip is coming.

Plan around three constraints. The SDK’s transcribe() takes WAV or raw PCM up to 120 seconds; posting to the HTTP endpoint directly takes up to 20 minutes and compressed formats such as MP3. Sync doesn’t ingest URLs, so download remote files first. And it’s built for finished clips: for long recordings, use the pre-recorded flow above instead of chunking. Setup details are in the Sync API getting-started guide, and the dictation app tutorial shows Sync in a full app.

Handle different audio formats and sources

The pre-recorded SDK accepts a URL, a local path, a Buffer or a readable stream. It detects which one you passed and uploads local data for you:

import { createReadStream } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { client } from './client.js';

const params = { speech_models: ['assemblyai-stt-3-7', 'universal-2'], language_detection: true };

// A public URL: AssemblyAI fetches the file itself.
const fromUrl = await client.transcripts.transcribe({ ...params, audio: 'https://assembly.ai/sports_injuries.mp3' });

// A local path: the SDK uploads the file first.
const fromPath = await client.transcripts.transcribe({ ...params, audio: './meeting.mp3' });

// A Buffer you already hold in memory.
const fromBuffer = await client.transcripts.transcribe({ ...params, audio: await readFile('./meeting.mp3') });

// A readable stream, e.g. from an upload handler.
const fromStream = await client.transcripts.transcribe({ ...params, audio: createReadStream('./meeting.mp3') });

for (const t of [fromUrl, fromPath, fromBuffer, fromStream]) console.log(t.id, t.status);

Streams are the right choice when the audio is already moving through your application, such as an upload handler or a queue consumer, and you’d rather not buffer the whole file in memory first. The Node.js speech-to-text guide covers more transcription options.

Summarize a meeting recording

Generic prompts produce generic summaries. Giving the model the context it can’t infer from the audio (what the meeting was, who was in it, what you intend to do with the output) changes the result more than switching models does. For multi-speaker recordings, also turn on speaker_labels so the model can attribute statements:

import { client, chatCompletion } from './client.js';

const audio = process.argv[2] ?? './meeting.mp3';

const transcript = await client.transcripts.transcribe({
  audio,
  speech_models: ['assemblyai-stt-3-7', 'universal-2'],
  language_detection: true,
  speaker_labels: true
});

if (transcript.status === 'error') {
  console.error(`Transcription failed: ${transcript.error}`);
  process.exit(1);
}

// {{ transcript }} injects plain text only, so build the speaker-labeled version yourself.
const dialogue = (transcript.utterances ?? [])
  .map((u) => `Speaker ${u.speaker}: ${u.text}`)
  .join('\n');

const result = await chatCompletion({
  model: process.env.SUMMARY_MODEL ?? 'claude-sonnet-4-6',
  messages: [
    {
      role: 'system',
      content:
        'You summarize internal product meetings for engineers who missed the call. ' +
        'Be specific about names, numbers, and dates. Never invent an owner or a deadline.'
    },
    {
      role: 'user',
      content:
        'This is a weekly product sync. Write:\n' +
        '1. A two-sentence summary.\n' +
        '2. Decisions made.\n' +
        '3. Action items as "Speaker X: task (deadline if stated)".\n\n' +
        dialogue
    }
  ],
  max_tokens: 1500,
  fallbacks: [{ model: 'gemini-3.7-flash' }]
});

console.log(result.choices[0].message.content);

Because {{ transcript }} injects plain text only, this script builds a “Speaker A: …” version from transcript.utterances and sends that instead. Owners in an action-item list are only as reliable as the diarization underneath them; the speaker diarization in JavaScript tutorial goes deeper on labels and speaker counts.

Customize summary type

The output shape is a prompt decision. These are the common types:

Summary type Best for Output format
Paragraph summary Quick overviews, email digests One to two paragraphs of prose
Bulleted key topics Meeting notes, content indexing Bullet list of main points
Headline summary Search snippets, push notifications One sentence
Action items and decisions Business meetings, project syncs Structured list with owners
Structured JSON API integrations, data pipelines Schema-constrained object

Keep the prompts for each type in one place, prompts.js:

export const PROMPTS = {
  paragraph: 'Summarize this transcript in one or two short paragraphs.',
  bullets: 'List the main topics discussed as bullets. One bullet per topic, no preamble.',
  headline: 'Write a single-sentence headline that captures the main point of this transcript.',
  actions: 'List every decision and action item. For each action item, name the owner if the transcript states one.',
  gist: 'Describe what this recording is about in five words or fewer.'
};

A finished transcript stays available by ID, so you can re-summarize it in a different shape without transcribing the audio again:

import { chatCompletion } from './client.js';
import { PROMPTS } from './prompts.js';

// Reuse a finished transcript: no need to transcribe the audio again.
const [transcriptId, type = 'bullets'] = process.argv.slice(2);
if (!transcriptId || !PROMPTS[type]) {
  console.error(`Usage: node summary-types.js <transcript_id> [${Object.keys(PROMPTS).join('|')}]`);
  process.exit(1);
}

const result = await chatCompletion({
  model: process.env.SUMMARY_MODEL ?? 'claude-sonnet-4-6',
  messages: [{ role: 'user', content: `${PROMPTS[type]}\n\n{{ transcript }}` }],
  transcript_id: transcriptId,
  max_tokens: 1000
});

console.log(result.choices[0].message.content);
node summary-types.js <transcript_id> actions

For anything a downstream system will parse, don’t ask for JSON in prose and hope. Use Structured Outputs with a response_format JSON schema so the response is constrained to the shape your code expects:

import { chatCompletion } from './client.js';

const transcriptId = process.argv[2];
if (!transcriptId) {
  console.error('Usage: node structured-summary.js <transcript_id>');
  process.exit(1);
}

const result = await chatCompletion({
  model: process.env.SUMMARY_MODEL ?? 'claude-sonnet-4-6',
  messages: [{ role: 'user', content: 'Summarize this transcript.\n\n{{ transcript }}' }],
  transcript_id: transcriptId,
  max_tokens: 1000,
  response_format: {
    type: 'json_schema',
    json_schema: {
      name: 'audio_summary',
      schema: {
        type: 'object',
        properties: {
          topic: { type: 'string' },
          key_points: { type: 'array', items: { type: 'string' } },
          action_items: { type: 'array', items: { type: 'string' } },
          conclusion: { type: 'string' }
        },
        required: ['topic', 'key_points', 'action_items', 'conclusion'],
        additionalProperties: false
      },
      strict: true
    }
  }
});

const summary = JSON.parse(result.choices[0].message.content);
console.log(summary.topic);
console.log(summary.action_items);

Structured outputs work on Claude 4.5 and later, Gemini, OpenAI GPT-4.1 and GPT-5.x, Qwen and Kimi models, but not on gpt-oss. Check the supported parameters for your model on the Models page before you send response_format.

Choose the right model for summarization

LLM Gateway exposes 55+ models from Anthropic, Google, OpenAI and other providers, plus open models AssemblyAI hosts directly, all behind one API key and one bill. For summarization the choice comes down to how long the audio is, how much nuance the summary has to preserve, and where the data has to stay.

Model Use it for Notes (from the Models page, Nov 17, 2026)
claude-sonnet-4-6 Long or nuanced meetings where the summary carries weight Default in this guide. $3 / $15 per 1M input / output tokens. Structured outputs. EU endpoint.
gemini-3.7-flash Mid-length recordings at a lower per-token rate $0.75 / $3.75 per 1M tokens. Structured outputs. EU endpoint.
claude-haiku-4-5-20251001 Short clips and fallback chains $1 / $5 per 1M tokens. EU endpoint.
qwen3.5-4b-32k-fast High-volume plain-text summaries of short audio Hosted by AssemblyAI. 32,768-token context. $0.10 / $0.50 per 1M tokens. No response_format; not on the EU endpoint.
deepseek-v4.1-flash Hour-long meetings Top score for 1-hour meeting summaries in the Oct 29, 2026 Choose a model run. Runs on opt-in providers: turn it on in Data Controls first.
claude-opus-5-5 Short calls where summary quality matters most Top score for 2-minute call summaries in the same run. $4 / $20 per 1M tokens.

The Choose a model page scores every Gateway model on summaries, action-item extraction and transcript clean-up at four audio lengths, with cost and latency for each, using the open-source Voice Standard Bench. Treat it as a shortlist of models to test on your own transcripts, since scores drop as transcripts get longer and a model that leads on 2-minute calls can be a poor pick for hour-long meetings. The model catalog lists the full lineup.

Switching models is one environment variable:

SUMMARY_MODEL=gemini-3.7-flash node summarize.js ./meeting.mp3
Compare summarization models on your own audio

Run the same transcript through Claude, Gemini and an AssemblyAI-hosted open model side by side in the browser before you wire anything up.

Try playground

Error handling and performance optimization

Log the request_id for every LLM call

Every Gateway response carries a request_id. Log it on success as well as failure, since it’s what support asks for and you can’t recover it after the fact. The chatCompletion helper in client.js writes request_id and the model to stderr on every call and puts the request_id in the error message when the Gateway returns a non-2xx status. Log the model alongside it: when a fallback fires, that field tells you which model produced the summary. On the Sync API, the equivalent ID is session_id, which sync-summarize.js logs the same way.

Add fallback models for resilience

A fallback chain reroutes the request when the primary model fails, without your code catching anything. summarize.js sends two fallbacks and sets fallback_config.depth to 2, the maximum, so the Gateway tries gemini-3.7-flash and then claude-haiku-4-5-20251001. With the default depth of 1, only the first fallback is tried. Without any fallbacks, the Gateway still retries the request once after 500 ms, which fallback_config.retry controls. You’re billed only for the model that answered.

Each fallback entry can also override fields such as messages, temperature or max_tokens for that model. Order the chain by how much quality you can give up in a degraded summary, then by price, and keep every model in the chain available in the region you call.

Use the EU endpoints for data residency

Set ASSEMBLYAI_REGION=eu and client.js points all three services at their EU hosts: api.eu.assemblyai.com for pre-recorded transcription, sync.eu.assemblyai.com for Sync, and llm-gateway.eu.assemblyai.com for summarization:

ASSEMBLYAI_REGION=eu node summarize.js ./meeting.mp3

Three things to factor into that decision. The EU Gateway endpoint serves Anthropic Claude and Google Gemini models only, which is why every default and fallback in this guide is a Claude or Gemini model. In-region Gateway requests cost 10% more, a pass-through of provider pricing. And residency has to be set on both hops: an EU summarization call in front of a US transcription call doesn’t give you EU residency. Details are in the Gateway data residency docs. On retention, the Gateway providers that are on by default operate under zero data retention, and no Gateway provider trains on your data; the providers page lists each one.

Process multiple files in parallel

Transcription jobs are independent, so submit them together instead of one after another:

import { client, chatCompletion } from './client.js';

const files = process.argv.slice(2);
if (files.length === 0) {
  console.error('Usage: node batch-summarize.js <audio> [<audio> ...]');
  process.exit(1);
}

// Stage 1: transcribe every file at once.
const transcripts = await Promise.all(
  files.map((audio) =>
    client.transcripts.transcribe({
      audio,
      speech_models: ['assemblyai-stt-3-7', 'universal-2'],
      language_detection: true
    })
  )
);

// A failed job still resolves, so drop it before spending LLM tokens on it.
for (const t of transcripts.filter((t) => t.status !== 'completed')) {
  console.error(`Skipping ${t.id}: ${t.error}`);
}
const completed = transcripts.filter((t) => t.status === 'completed');

// Stage 2: summarize the completed transcripts in parallel.
const summaries = await Promise.allSettled(
  completed.map((t) =>
    chatCompletion({
      model: process.env.SUMMARY_MODEL ?? 'claude-sonnet-4-6',
      messages: [{ role: 'user', content: 'Summarize this transcript in three bullets.\n\n{{ transcript }}' }],
      transcript_id: t.id,
      max_tokens: 500,
      fallbacks: [{ model: 'gemini-3.7-flash' }]
    })
  )
);

summaries.forEach((s, i) => {
  const id = completed[i].id;
  if (s.status === 'fulfilled') console.log(`\n## ${id}\n${s.value.choices[0].message.content}`);
  else console.error(`Summary failed for ${id}: ${s.reason.message}`);
});

Filter on status === ‘completed’ before summarizing. A failed transcript still resolves its promise, and summarizing an empty transcript burns tokens to produce nothing. Promise.allSettled in the second stage keeps one failed summary from discarding the rest.

What this looks like in production

Media, meeting and support products lean on this pipeline hardest, because summaries are what make a library of recordings navigable. Notetakers turn each call into a recap and an action-item list, video tools generate descriptions and chapter titles, and contact centers write a structured wrap-up for every call. The transcription and summarization layers are infrastructure; the product is what you build on the structured output. For the Python version of this pipeline, see automatic summarization with LLMs in Python, and for how LLM Gateway compares with other routers, see LLM Gateway vs OpenRouter vs llmgateway.io.

Next steps

You now have the full path: transcribe with AssemblyAI-STT-3.7, summarize through LLM Gateway by transcript ID, constrain the output with a JSON schema, and send short clips through the Sync API. Two decisions are worth revisiting as you scale. Model selection is the first: most teams over-buy on the LLM and under-invest in transcription accuracy, and the Choose a model data makes that trade-off measurable. Data residency is the second, and it’s easier to get right before launch than after.

From here, look at Speech Understanding for entity detection, sentiment and other analysis alongside the summary.

Start summarizing your audio today

Transcription and LLM summarization behind a single API key, with free credits to start. No separate provider accounts to set up.

Sign up free

Frequently Asked Questions (FAQs)

How do I summarize a local audio file instead of a URL in Node.js?

Pass the file path to the audio parameter of client.transcripts.transcribe(), and the AssemblyAI Node.js SDK uploads it for you. It also accepts a Buffer or a readable stream, which helps when the audio is already flowing through your application. The rest of the pipeline is unchanged: you get back a transcript object and pass its id to LLM Gateway as transcript_id.

Can I change the format of the summary?

Yes. The output shape is controlled by your prompt, so a headline, a bullet list or an action-item breakdown is a one-line change, and you can re-summarize an existing transcript by ID without transcribing again. When a downstream system has to parse the result, use Structured Outputs with a response_format JSON schema so the model is constrained to your schema.

Which LLM should I use to summarize audio?

It depends on audio length, how much nuance the summary must keep, and your region. claude-sonnet-4-6 is a solid default for long or multi-speaker recordings, gemini-3.7-flash and claude-haiku-4-5-20251001 suit shorter clips, and qwen3.5-4b-32k-fast, hosted by AssemblyAI, handles high-volume plain-text summaries at $0.10 / $0.50 per 1M tokens. The Choose a model page in the LLM Gateway docs scores every model on summaries at four audio lengths, with cost and latency.

How do I summarize short audio quickly?

Use the Sync API, which returns the transcript in the same HTTP response with no upload step or polling. The Node.js SDK’s client.sync.transcribe() takes WAV or raw PCM clips up to 120 seconds on universal-3-6-pro, and the HTTP endpoint takes up to 20 minutes. Send the returned text to LLM Gateway with a fast model such as claude-haiku-4-5-20251001.

Which speech-to-text model should I use before summarizing?

For recorded audio, use AssemblyAI-STT-3.7 by setting speech_models to ["assemblyai-stt-3-7", "universal-2"]. It is the flagship pre-recorded model, with 32 languages and native code switching, and Universal-2 extends coverage to 99 languages. Universal-3.5 Pro, the previous model, was deprecated on November 17, 2026.

What is the best way to handle errors during transcription or summarization?

Check transcript.status before summarizing, because a failed transcript resolves normally with an error field instead of throwing. Check response.ok on the Gateway call, log request_id and the model from every response, and add a fallbacks chain so a failing model reroutes automatically. On the Sync API, catch SyncTranscriptError and log session_id.