Skip to content
Neutree Documentation

Calling an endpoint when using a FunASR model catalog

After creating an endpoint by using a FunASR model catalog, you can call the endpoint’s OpenAI-compatible API or FunASR native API through the model gateway.

Prerequisites

Precaution

  • All calls access the endpoint through the model gateway. The address format is http://<gateway>/workspace/<workspace>/endpoint/<endpoint>.
  • The request header must include Authorization: Bearer <api_key>, where <api_key> is the API key.
  • When creating an endpoint by using a FunASR model catalog, the model registry and model name are still required, but they do not take effect for the FunASR image. You can select any valid values to pass validation. The selected values do not affect the deployment result.
  • When deploying FunASR on Turing-architecture GPUs such as NVIDIA T4, set dtype=float32 in the engine variables. The corresponding startup parameter is --dtype float32. The default half precision cannot be used on this GPU architecture.

Run the following commands to initiate a speech recognition request through the OpenAI-compatible API:

Terminal window
curl -sL -o en.mp3 https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/blob/main/example/en.mp3
curl -X POST <API_URL>/v1/audio/transcriptions \
-H "Authorization: Bearer <api_key>" \
-F file=@en.mp3

Run the following commands to initiate a speech recognition request through the FunASR native API:

Terminal window
curl -sL -o en.mp3 https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/blob/main/example/en.mp3
curl -X POST <API_URL>/asr \
-H "Authorization: Bearer <api_key>" \
-F file=@en.mp3

After the request succeeds, the API returns the speech recognition result with segments, timestamps, and real-time factor (RTF).