Skip to content

[Bug] STT: Azure OpenAI (Whisper) transcription returns 404 due to missing api-version #171

@scotsman2k

Description

@scotsman2k

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

  1. 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)
  2. Set OPENAI_API_KEY to your Azure API key
  3. Send audio to POST /api/transcribe
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions