Cheetah Model API
The Cheetah Model API trains a Speech-to-Text model from a YAML content definition.
Send a YAML content as a request and receive a trained .pv model file in response, ready for on-device
inference with Cheetah.
Base URL
All routes are relative to the following base URL:
Authentication
Every request must be authenticated with your AccessKey passed in the x-api-key header. You can obtain a
free AccessKey from the Picovoice Console.
Requests made without a valid AccessKey are rejected with a 403 Forbidden response.
Train a Model
Trains a Cheetah model for the given language, model_type and target engine from a YAML definition.
On success, the response body is the binary .rhn model file.
Path Parameters
languagestring — The language of the context. Must be one of the supported language values (e.g.en).
Headers
x-api-keystring — Required. YourAccessKeyfrom the Picovoice Console.
Body Parameters
The request body is a JSON object with the following fields:
enginestring — Required. The target engine to train the model for. Must be one of the supported engine values. For Cheetah Speech-to-Text usecheetah.model_typestring — Required. The target model variant. Must be one of the supported model type values.yaml_contentstring — Required. The content definition, as a YAML string. Follow the format as exported from the Picovoice Console.
Example Request
A successful request returns a 303 See Other redirect pointing to the trained model. The -L flag tells
curl to follow that redirect automatically and download the .pv file:
Replace the placeholders with your own values:
${ACCESS_KEY}— yourAccessKeyfrom the Picovoice Console.${OUTPUT_PATH}— the local path to write the returned.pvmodel to (e.g../cheetah_params.pv).${ENGINE}— a supported engine value (e.g.cheetah).${MODEL_TYPE}— a supported model type value (e.g.cheetah).${YAML_STRING}— your content definition as a YAML string.${LANGUAGE}— a supported language value (e.g.en).
Responses
200 OK— Returned when the303redirect is followed. The response body is the binary.pvmodel file.303 See Other— Training succeeded. The response carries aLocationheader with a URL to the trained model. Follow this redirect (e.g. withcurl -L) to download it and receive the200 OKabove.400 Bad Request— The request was malformed, theengine/model_typevalue was invalid, or theyaml_contentwas not valid YAML / used an incorrect content format.403 Forbidden— TheAccessKeyis missing or invalid.
Supported Languages
The language path parameter accepts one of the following values:
| Language | Value |
|---|---|
| English | en |
| French | fr |
| German | de |
| Italian | it |
| Mandarin Chinese | zh |
| Portuguese | pt |
| Spanish | es |
Supported Engines
The engine body parameter accepts one of the following values:
| Engine | Value |
|---|---|
| Cheetah | cheetah |
| Leopard | leopard |
Supported Model Types
The model_type body parameter accepts one of the following values:
| Model Type | Value |
|---|---|
| default | default |