Skip to main content

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.

VariablePurpose
ASSEMBLYAI_API_KEYThe AssemblyAI key the gateway sends upstream.

Steps​

  1. 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 set ASSEMBLYAI_API_KEY and restart the gateway.

  2. Issue a virtual key on /ui/api-keys with + Create New Key, then Create Key.

  3. Submit a transcript through the gateway. Use /eu.assemblyai instead of /assemblyai for 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}'
  4. Poll GET /assemblyai/v2/transcript/{id} with the same key until status is completed.

  5. Open /ui/logs and 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​

StatusMessageWhat it means and how to fix it
401Authentication Error, Invalid proxy server token passedThe virtual key is missing, wrong, expired or blocked.
403Key/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 AssemblyAIAuthentication error, API token missing/invalidThe 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 otherAssemblyAI's own error bodyAssemblyAI refused the request. The message is returned unchanged.

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.