HTTP API and Docker
The repository ships a FastAPI server with a web demo. Run the Docker image, or uvicorn server:app from a clone after pip install ".[app]".
$ docker run -p 8000:8000 openpronounce $ curl -F file=@answer.wav -F expected_text="Hello, I am a good designer" -F lang=en http://localhost:8000/pronunciation $ curl -F file=@talk.wav http://localhost:8000/free
Endpoints
| Endpoint | Form fields | Returns |
|---|---|---|
POST /pronunciation | file, expected_text, lang (default en) | The full read-speech result |
POST /free | file, lang | The free-speech result |
POST /speech2text | file, lang | {"transcript": ...} |
POST /phonemes | text, lang | The expected sounds of a text |
POST /tts | text, lang | A reference reading, 16 kHz wav |
GET /languages | The languages available | |
GET /health | Liveness, for your orchestrator | |
GET /docs | Interactive documentation |
From a browser
const form = new FormData(); form.append("file", recordingBlob, "answer.webm"); // from MediaRecorder form.append("expected_text", "Hello, I am a good designer"); const result = await (await fetch("/pronunciation", { method: "POST", body: form })).json(); if (!result.reliable) showRetry(result.reasons);
In production
- The image downloads the models at build time: deploy it where the network is closed.
- Count about 4 GB of memory per instance, and scale on the number of recordings analysed at the same time.
Dockerfile.gpubuilds the same server for an NVIDIA GPU.- The server has no authentication of its own. Put it behind your gateway.