Speech-to-Text API
Version History
Version | Date | Changes |
---|---|---|
v1.0 | 2024-08-29 | Initial release |
MaaS Whisper
Public Information
Parameter | Description | Example |
---|---|---|
basePath | The base path for invoking the mass api, including the fixed path /v1/ai | https://genaiapi.cloudsway.net/v1/ai |
endpointPath | The randomly generated segment of the mass api | RkBOAlaWzKcubSji |
AccessKey | The AccessKey for invoking the mass api | RWxxxxxxxx0Gd |
According to the above example, the final path for requesting the Voice-to-Text interface is https://genaiapi.cloudsway.net/v1/ai/RkBOAlawzKcubSji
Request Method
POST
Request Path
{basePath}/{endpointPath}/audio/transcriptions
Request Header
Parameter | Description | Example |
---|---|---|
Authorization | AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request Body
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
file | File | Yes | Audio file in formats such as mp3, mp4, mpwweg, mpga, m4a, wav, webm, with a file size limit of 25M | |
prompt | String | No | Prompt | "Generate a video of a sunset over the ocean." |
response_format | String | No | The format in which the model returns the result | json,verbose_json |
temperature | String | No | Temperature, a value between 0 and 1 | |
language | String | No | The language of the specified audio file | "en"(English),"zh"(Chinese),"es"(Spanish), etc |
timestamp_granularities | String | No | The granularity of the timestamp | "none": no timestamp. "word": timestamp for each word. "sentence": timestamp for each sentence. |
Response
Parameter | Type | Description | Example |
---|---|---|---|
text | String | Speech-to-Text |
Example
Request
curl --request POST \
--url https://genaiapipre.cloudsway.net/v1/ai/RkBOAlaWzKcubSji/audio/transcriptions \
--header 'Accept: */*' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'Connection: keep-alive' \
--header 'Content-Type: multipart/form-data' \
--header 'Host: genaiapipre.cloudsway.net' \
--header 'content-type: multipart/form-data' \
--form 'prompt=A poetic description of early morning, including words like dawn, quiet, mist, and possibility' \
--form response_format=verbose_json \
--form temperature=0.1 \
--form language=en \
--form timestamp_granularities=none \
--form 'file=xx.wav'
Response
{
"text": "In this ancient town, plum blossoms bloom silently. The white petals are like snow, falling on the branches, welcoming the cold winter. The fragrance of the flowers is elegant, and it touches the heart, as if it is the scent of time. In this ancient town, plum blossoms bloom silently. Every plum blossom is a small miracle, which blooms in the coldness of life. They are not afraid of the cold, they are firm, symbolizing hope and rebirth. The blooming of plum blossoms is like the praise of nature for life, warming everyone's heart. Each blossom is a small miracle, symbolizing hope and rebirth. Standing under the plum trees, it is as if you can hear the rain of years. Flowers bloom and fall, spring and autumn come. Plum blossoms witness the turning of time, and witness people's joy and sorrow. They are the guardians of memory, quietly preserving the story of this town. Standing under the plum tree, one can almost hear the whispers of time. Plum blossoms are not just a plant, but also a spiritual symbol. It teaches us to keep hope in adversity, to find warmth in the cold winter. Every year's blooming is a praise of life, a hope for the future. Plum blossoms teach us to keep hope alive in adversity. Let's cherish the beauty before us and embrace every moment of life bravely. Let's cherish the beauty before us and embrace every moment of life bravely."
}
Translate audio to English
Request Method
POST
Request Path
{basePath}/{endpointPath}/audio/translation
Request header
Parameter | Description | Example |
---|---|---|
Authorization | AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request body
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
file | File | Yes | Audio File | mp3, mp4, mpwweg, mpga, m4a, wav, webm, file size limit is 25M |
prompt | String | No | Prompt | "Generate a video of a sunset over the ocean." |
response_format | String | No | Output Format | json,verbose_json |
temperature | String | No | Temperature | Value between 0-1 |
Response
Parameter | Type | Description | Example |
---|---|---|---|
text | String | Translate audio to English |
Example
Request
curl --location --request POST 'https://genaiapipre.cloudsway.net/v1/ai/RkBOAlaWzKcubSji/audio/translation' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Host: genaiapipre.cloudsway.net' \
--header 'Connection: keep-alive' \
--header 'Content-Type: multipart/form-data; boundary=--------------------------726232426471513578566370' \
--form 'prompt=A poetic description of early morning, including words like dawn, quiet, mist, and possibility' \
--form 'response_format=verbose_json' \
--form 'temperature=0.1' \
--form 'timestamp_granularities=none' \
--form 'file=xxx.wav"'
Response
{
"text": "In this ancient town, plum blossoms bloom silently. The white petals are like snow, falling on the branches, welcoming the cold winter. The fragrance of the flowers is elegant, and it touches the heart, as if it is the scent of time. In this ancient town, plum blossoms bloom silently. Every plum blossom is a small miracle, which blooms in the coldness of life. They are not afraid of the cold, they are firm, symbolizing hope and rebirth. The blooming of plum blossoms is like the praise of nature for life, warming everyone's heart. Each blossom is a small miracle, symbolizing hope and rebirth. Standing under the plum trees, it is as if you can hear the rain of years. Flowers bloom and fall, spring and autumn come. Plum blossoms witness the turning of time, and witness people's joy and sorrow. They are the guardians of memory, quietly preserving the story of this town. Standing under the plum tree, one can almost hear the whispers of time. Plum blossoms are not just a plant, but also a spiritual symbol. It teaches us to keep hope in adversity, to find warmth in the cold winter. Every year's blooming is a praise of life, a hope for the future. Plum blossoms teach us to keep hope alive in adversity. Let's cherish the beauty before us and embrace every moment of life bravely. Let's cherish the beauty before us and embrace every moment of life bravely."
}