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 AI gateway.

Prerequisites

Precaution

  • All calls access the endpoint through the AI 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.
  • Endpoints for the FunASR model catalog do not require a platform model to be configured. During creation, the model fields are handled by the model catalog and engine configuration. You do not need to enter arbitrary model repository or model name values to pass validation. If the creation form does not display model fields, create the instance directly according to the configuration provided by the model catalog.
  • 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).