Guide · LiteLLM
Saidwire speech-to-text with LiteLLM
LiteLLM routes calls to many providers through one OpenAI-style interface. Saidwire plugs in as an OpenAI-compatible transcription provider: the openai/ model prefix plus api_base. That works in the Python SDK and in the LiteLLM proxy (AI gateway).
| you need | |
|---|---|
| LiteLLM | pip install litellm (SDK) or pip install 'litellm[proxy]' (proxy). Checked with 1.83. |
| Saidwire API key | sk_live_... from saidwire.com/dev (120 free hours, no card) |
Python SDK
# pip install litellm
import os
import litellm
with open("meeting.mp3", "rb") as f:
r = litellm.transcription(
model="openai/saidwire-en", # openai/ = OpenAI-compatible provider
file=f,
api_base="https://api.saidwire.com/v1",
api_key=os.environ["SAIDWIRE_API_KEY"],
)
print(r.text)
response_format, timestamp_granularities and language are passed through to Saidwire unchanged, for example response_format="verbose_json", timestamp_granularities=["word"].
Proxy: config.yaml
Add a model entry with mode: audio_transcription:
model_list:
- model_name: saidwire-en
litellm_params:
model: openai/saidwire-en
api_base: https://api.saidwire.com/v1
api_key: os.environ/SAIDWIRE_API_KEY
model_info:
mode: audio_transcription
general_settings:
master_key: os.environ/LITELLM_MASTER_KEY # optional: keys for your own users
export SAIDWIRE_API_KEY=sk_live_xxxxxxxx.yyyyyyyyyyyyyyyy export LITELLM_MASTER_KEY=sk-change-me litellm --config config.yaml # listens on http://0.0.0.0:4000
api_base must end in /v1. Without it, requests return 404 Not Found.
Call the proxy
curl -s http://localhost:4000/v1/audio/transcriptions \ -H "Authorization: Bearer $LITELLM_MASTER_KEY" \ -F model=saidwire-en \ -F file=@meeting.mp3
from openai import OpenAI
client = OpenAI(base_url="http://localhost:4000/v1", api_key="sk-change-me") # your LiteLLM key
with open("meeting.mp3", "rb") as f:
print(client.audio.transcriptions.create(model="saidwire-en", file=f).text)
Clients send the LiteLLM key. Only the proxy holds the Saidwire key. LiteLLM's own budgets, rate limits and spend logs apply to these calls like any other model.
Response formats
json(default) andverbose_jsoncome back as LiteLLM transcription objects, withtextand, forverbose_json,segmentsandwords.- For
text,srtandvtt, the proxy puts the returned text or subtitle file in thetextfield of a JSON reply. To get a raw.srtfile, call Saidwire directly (see the API docs).
Troubleshooting
| you see | fix |
|---|---|
404 Not Found | api_base must be https://api.saidwire.com/v1. |
AuthenticationError ... Incorrect API key provided | The proxy's SAIDWIRE_API_KEY is wrong or unset. LiteLLM reports Saidwire's 401 as an OpenAIException, because the provider type is openai. |
BadRequestError ... language | Saidwire transcribes English only. Send en or no language. |
RateLimitError | Too many files at once for your Saidwire key (trial keys allow 4), or your free hours are used up. |
| Model not found on the proxy | The client's model must match model_name in config.yaml (saidwire-en above). |
Good to know
- This is the file-upload API. For live audio, Saidwire's streaming WebSocket returns words while someone is still speaking.
- Saidwire processes the audio in memory and does not store it.
- $0.30 per audio hour after the free hours, billed per second.
Stuck? Email support@saidwire.com with the x-request-id from the failed call.
OpenAI is a trademark of OpenAI. Open WebUI, n8n, LiteLLM, Dify, Flowise, Vercel and the AI SDK belong to their respective owners. Saidwire is not affiliated with OpenAI or with these projects.