OpenAI-compatible transcription proxy for Whisper services.
- OpenAI
/v1/audio/transcriptionsAPI compatibility - Docker support with multi-service orchestration
- Configurable upstream Whisper backend
- File size limits and input validation
docker build -t whisper-bridge .
docker run -p 9100:9100 whisper-bridge# Modern syntax (Docker 2.23+)
docker compose up -d
# Legacy syntax (older Docker versions)
docker-compose up -d| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /v1/audio/transcriptions |
Transcribe audio file |
Form Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
file |
file (required) | - | Audio file to transcribe |
model |
string | "whisper-1" |
Model identifier |
language |
string | null | null |
Language code (e.g., "en", "no") |
response_format |
string | "json" |
Output format: json, text, srt, verbose_json, vtt |
temperature |
float | 0.0 |
Sampling temperature |
Example:
curl -X POST http://localhost:9100/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=whisper-1" \
-F "language=en" \
-F "response_format=json"Response:
{
"text": "Transcribed text here",
"model": "whisper-1",
"language": "en"
}Environment variables:
| Variable | Default | Description |
|---|---|---|
WHISPER_URL |
http://whisper:9000/asr |
Upstream Whisper service URL |
MAX_FILE_SIZE |
104857600 (100 MB) |
Maximum upload size in bytes |
REQUEST_TIMEOUT |
300 |
Request timeout in seconds |
LOG_LEVEL |
INFO |
Python logging level (DEBUG, INFO, WARNING, ERROR) |
- Python 3.11+
- Docker (optional, for containerized deployment)
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 9100 --reloadwhisper-bridge/
├── .dockerignore # Docker build exclusions
├── .gitignore # Git exclusions
├── app.py # FastAPI application
├── docker-compose.yml # Service orchestration
├── Dockerfile # Container definition
├── README.md # This file
└── requirements.txt # Python dependencies
MIT