Skip to Content
Launching the open-source gateway

AssemblyAI

AssemblyAI  is an applied AI company offering models for audio transcription, content moderation, summarization, topic detection, and more. Route AssemblyAI calls through the Respan gateway to get full observability over every transcription request.

Set up Respan

Create an account at platform.respan.ai  and grab an API key . For gateway, also add credits  or a provider key .

AssemblyAI is a gateway-only integration. The endpoint is https://api.respan.ai/api/assemblyai/.

Paste this into your coding agent:

Help me set up Respan tracing with the AssemblyAI integration. Follow https://www.respan.ai/docs/integrations/assemblyai.md

Setup

Set environment variables

Terminal
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY" export ASSEMBLYAI_API_KEY="YOUR_ASSEMBLYAI_API_KEY"

Wrap the AssemblyAI client to point at Respan

Python
import os import json from base64 import b64encode from assemblyai import Transcriber, Client, Settings, TranscriptStatus BASE_URL = "https://api.respan.ai/api/assemblyai/" class RespanAssemblyAIClient(Client): """AssemblyAI client wrapper that routes through the Respan gateway.""" def __init__(self, respan_api_key: str, headers: dict): settings = Settings(api_key=respan_api_key, base_url=BASE_URL) super().__init__(settings=settings) self._http_client.headers.update(headers) respan_params = { "metadata": {"paid_user": "true"}, # other respan parameters... } respan_headers = { "X-Assemblyai-Api-Key": os.environ["ASSEMBLYAI_API_KEY"], "X-Data-Respan-Params": b64encode(json.dumps(respan_params).encode()).decode(), } client = RespanAssemblyAIClient( respan_api_key=os.environ["RESPAN_API_KEY"], headers=respan_headers, ) transcriber = Transcriber(client=client) transcript = transcriber.transcribe("https://assembly.ai/wildfires.mp3") if transcript.status == TranscriptStatus.error: print(transcript.error) else: print(transcript.text)

View your trace

Open the Traces page  to see transcription requests with audio, output, and timing.

Respan params

Pass any Respan params & metadata in the respan_params dict (base64-encoded into X-Data-Respan-Params).

ParameterDescription
customer_identifierIdentifies the end user.
thread_identifierGroups related messages into a conversation.
metadataCustom key-value pairs.