OpenAPI Spec for the FunASR OpenAI-Compatible API

May 25, 2026 · View on GitHub

(English|简体中文)

Use openapi.json when you want to inspect, mock, document, or import the FunASR speech API before wiring it into an application, API gateway, workflow engine, or SDK generator.

The running FastAPI server also exposes live docs at /docs and a generated schema at /openapi.json. This checked-in spec is a portable reference for the example server in this directory.

Import options

ToolHow to use it
Swagger Editor or RedocImport openapi.json to inspect /health, /v1/models, and /v1/audio/transcriptions.
PostmanImport openapi.json if you prefer schema-driven collections, or use the ready-made Postman collection.
Dify, n8n, or internal workflow toolsUse the multipart request shape in the spec together with the workflow recipes.
API gateway or internal developer portalPublish the spec and point the server URL to your reachable FunASR API endpoint.
Client generationGenerate a small internal client, then keep the multipart file field mapped to a binary upload.

Server URL

The spec includes local examples:

  • http://localhost:8000
  • http://funasr-api:8000

Replace them with the URL reachable from your app, container, or workflow runtime.

Endpoints

EndpointMethodPurpose
/healthGETReadiness check, selected device, loaded models, and available aliases.
/v1/modelsGETOpenAI-style model list with ready flags.
/v1/audio/transcriptionsPOSTMultipart audio transcription. Use response_format=verbose_json for segments.

Multipart transcription fields

FieldTypeRequiredNotes
filebinaryyesAudio file such as wav, mp3, flac, m4a, ogg, or webm.
modelstringnoDefaults to sensevoice; available aliases are listed by /v1/models.
languagestringnoOptional language hint.
response_formatstringnoUse json or verbose_json.

Validate against a running server

cd examples/openai_api
python server.py --model sensevoice --device cuda --port 8000
curl -fsS http://localhost:8000/openapi.json > /tmp/funasr-openapi-live.json

The live FastAPI schema may include framework-specific validation details; this checked-in spec keeps the public integration surface small and stable.