Skip to content

Add OpenAI-compatible /v1/audio/translations api to AIGateway - #1347

Merged
Rader merged 3 commits into
OpenCSGs:mainfrom
apapi:add_openai_audio_translations_api
Aug 10, 2026
Merged

Add OpenAI-compatible /v1/audio/translations api to AIGateway#1347
Rader merged 3 commits into
OpenCSGs:mainfrom
apapi:add_openai_audio_translations_api

Conversation

@apapi

@apapi apapi commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Add POST /v1/audio/translations to AIGateway by reusing the audio STT proxy path and rewriting upstream endpoints from /audio/transcriptions to /audio/translations. Extend the FunASR inference server with the same route for multilingual Whisper (non-turbo) models via FunASR DecodingOptions, returning 501 for unsupported architectures.
  • Strip caller Authorization before applying upstream auth headers. Empty AuthHead previously left the client's Bearer token on the proxied request, so public upstreams (e.g. Whisper spaces) rejected it with AUTH-ERR-5.

@apapi apapi closed this Aug 5, 2026
@apapi apapi reopened this Aug 5, 2026
@apapi

apapi commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

I tested the new code, the output is as expected.
The input audio file: dream.mp3

The output of test:
image

…uth headers

Empty AuthHead previously left the client's Bearer token on the proxied request,
so public upstreams (e.g. Whisper spaces) rejected it with AUTH-ERR-5.
@CementZhang

Copy link
Copy Markdown
Collaborator

LGTM

@luojun96

luojun96 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

lgtm

@Rader Rader left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two edge cases in the FunASR translation capability handling that should be addressed before merge.

Comment thread docker/inference/funasr/server.py
Comment thread docker/inference/funasr/server.py
@Rader
Rader merged commit c8ec066 into OpenCSGs:main Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants