AssemblyAI pass-through
The /assemblyai route forwards AssemblyAI API paths, such as /v2/transcript and /v2/upload, to AssemblyAI unchanged. /eu.assemblyai does the same against the AssemblyAI EU region. Teams keep the AssemblyAI SDK while the gateway holds the AssemblyAI key, checks the virtual key and records each transcript with its cost.
A real-world scenario
A sales team transcribes recorded calls with AssemblyAI from a workflow tool that already uses the gateway for summaries. They point the AssemblyAI SDK at the gateway and reuse their virtual key. The AssemblyAI key stays on the gateway, EU customers' recordings go through /eu.assemblyai, and finance sees transcription minutes next to the summaries they feed.
Before you start
The gateway needs an AssemblyAI credential. It looks first for a model_list deployment of provider AssemblyAI with use_in_pass_through: true, then for the environment below.
| Variable | Purpose |
|---|---|
ASSEMBLYAI_API_KEY | The AssemblyAI key the gateway sends upstream. |
Steps
-
Give the gateway the credential. Open
/ui/models-and-endpoints, on the Add Model tab pick AssemblyAI under Provider, pick a model, open Advanced Settings, turn on Use in pass through routes and click Add Model. Or setASSEMBLYAI_API_KEYand restart the gateway. -
Issue a virtual key on
/ui/api-keyswith + Create New Key, then Create Key. -
Submit a transcript through the gateway. Use
/eu.assemblyaiinstead of/assemblyaifor the EU region.curl -X POST http://localhost:4000/assemblyai/v2/transcript \-H "Authorization: Bearer $SPANWAY_API_KEY" \-H "Content-Type: application/json" \-d '{"audio_url": "https://files.example.com/standup.mp3", "speaker_labels": true}' -
Poll
GET /assemblyai/v2/transcript/{id}with the same key untilstatusiscompleted. -
Open
/ui/logsand click the newest row to see the transcript request, the key and its cost.
Expected result
AssemblyAI's own response, with its status code and headers.
{"id": "5551212-aaaa-bbbb", "status": "queued", "audio_url": "https://files.example.com/standup.mp3", "speaker_labels": true}
When the transcript completes, the gateway reads the audio duration from the response and costs the job with the bundled AssemblyAI prices, so the spend log row carries the key, team, user and cost.
Errors
| Status | Message | What it means and how to fix it |
|---|---|---|
401 | Authentication Error, Invalid proxy server token passed | The virtual key is missing, wrong, expired or blocked. |
403 | Key/team denied access to passthrough route /assemblyai/... | The key or team lists the route in denied_passthrough_routes. The message goes on with Matched <pattern> in denied_passthrough_routes, naming the pattern to remove from the key or team. |
401 from AssemblyAI | Authentication error, API token missing/invalid | The gateway forwarded the call with no usable AssemblyAI key. Add a deployment with Use in pass through routes on, or set ASSEMBLYAI_API_KEY. |
| Any other | AssemblyAI's own error body | AssemblyAI refused the request. The message is returned unchanged. |
Related
Pass-through endpoints lists every built-in route. The unified audio transcription endpoint covers synchronous transcription with every provider. Amazon Transcribe pass-through and Azure AI Speech pass-through cover the other transcription services.