Description
When OPENAI_BASE_URL is set to an Azure OpenAI endpoint, the transcription request fails with 404 Not Found because Azure requires an api-version query parameter that Nerve does not append.
Steps to Reproduce
- Set
STT_PROVIDER=openai and OPENAI_BASE_URL to an Azure OpenAI Whisper deployment URL (e.g. https://<resource>.cognitiveservices.azure.com/openai/deployments/whisper)
- Set
OPENAI_API_KEY to your Azure API key
- Send audio to
POST /api/transcribe
- Response:
{"error":{"code":"404","message":"Resource not found"}}
Expected Behavior
Transcription succeeds. When targeting Azure OpenAI, the api-version query parameter (e.g. 2024-06-01) should be appended to the request URL.
Actual Behavior
server/services/openai-whisper.ts constructs the URL as ${OPENAI_BASE_URL}/audio/transcriptions with no query params. Azure requires ?api-version=<version> -- without it, the endpoint returns 404.
Suggested Fix
Introduce an AZURE_OPENAI_API_VERSION (or OPENAI_API_VERSION) env var. If set, append ?api-version=${value} to the transcription URL in openai-whisper.ts. No change needed for standard OpenAI usage.
Screenshots / Logs
POST /api/transcribe
← 404 {"error":{"code":"404","message":"Resource not found"}}
Environment
- Nerve version: 1.5.1
- STT provider: openai (Azure-compatible endpoint)
Description
When
OPENAI_BASE_URLis set to an Azure OpenAI endpoint, the transcription request fails with404 Not Foundbecause Azure requires anapi-versionquery parameter that Nerve does not append.Steps to Reproduce
STT_PROVIDER=openaiandOPENAI_BASE_URLto an Azure OpenAI Whisper deployment URL (e.g.https://<resource>.cognitiveservices.azure.com/openai/deployments/whisper)OPENAI_API_KEYto your Azure API keyPOST /api/transcribe{"error":{"code":"404","message":"Resource not found"}}Expected Behavior
Transcription succeeds. When targeting Azure OpenAI, the
api-versionquery parameter (e.g.2024-06-01) should be appended to the request URL.Actual Behavior
server/services/openai-whisper.tsconstructs the URL as${OPENAI_BASE_URL}/audio/transcriptionswith no query params. Azure requires?api-version=<version>-- without it, the endpoint returns 404.Suggested Fix
Introduce an
AZURE_OPENAI_API_VERSION(orOPENAI_API_VERSION) env var. If set, append?api-version=${value}to the transcription URL inopenai-whisper.ts. No change needed for standard OpenAI usage.Screenshots / Logs
Environment