### Generate Audio V1 using cURL Source: https://botnoiapi.lovable.app/index This snippet shows how to generate audio using the Botnoi API's V1 (Classic) endpoint with cURL. It requires an API key and specifies the text, speaker, volume, speed, media type, save file option, and language. ```cURL curl -X 'POST' \ 'https://api-voice.botnoi.ai/openapi/v1/generate_audio' \ -H 'accept: application/json' \ -H 'botnoi-token: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ \ "text": "สวัสดีครับ", \ "speaker": "1", \ "volume": 1, \ "speed": 1, \ "type_media": "mp3", \ "save_file": "True", \ "language": "th" \ }' ``` -------------------------------- ### Generate Audio V2 using cURL Source: https://botnoiapi.lovable.app/index This snippet demonstrates how to generate audio using the Botnoi API's V2 endpoint with cURL. It requires an API key and specifies the text, speaker, volume, speed, media type, save file option, and language. ```cURL curl -X 'POST' \ 'https://api-voice.botnoi.ai/openapi/v1/generate_audio_v2' \ -H 'accept: application/json' \ -H 'botnoi-token: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ \ "text": "สวัสดีครับ", \ "speaker": "8", \ "volume": 1, \ "speed": 1, \ "type_media": "mp3", \ "save_file": "True", \ "language": "th" \ }' ``` -------------------------------- ### V2 API - Premium Voices Source: https://botnoiapi.lovable.app/index This endpoint generates audio using premium V2 voices. It supports various languages and allows customization of speaker, volume, speed, and output format. ```APIDOC ## POST /openapi/v1/generate_audio_v2 ### Description Generates audio from text using premium V2 voices. Allows customization of speaker, volume, speed, output format, and saving the file. ### Method POST ### Endpoint `https://api-voice.botnoi.ai/openapi/v1/generate_audio_v2` ### Parameters #### Header Parameters - **accept** (string) - Required - `application/json` - **botnoi-token** (string) - Required - Your API key #### Request Body - **text** (string) - Required - The text to convert to speech. - **speaker** (string) - Required - Speaker ID from the voice library (e.g., '8' for Ava V2). - **volume** (number) - Optional - Audio volume (0.1 - 2.0). Defaults to 1. - **speed** (number) - Optional - Speech speed (0.5 - 2.0). Defaults to 1. - **type_media** (string) - Optional - Output format (mp3, wav). Defaults to 'mp3'. - **save_file** (string) - Optional - Whether to save the file ('True' or 'False'). Defaults to 'True'. - **language** (string) - Required - Language code (e.g., 'en', 'th', 'ja'). The input text must match the specified language. ### Request Example ```json { "text": "สวัสดีครับ", "speaker": "8", "volume": 1, "speed": 1, "type_media": "mp3", "save_file": "True", "language": "th" } ``` ### Response #### Success Response (200) - **audio_url** (string) - URL to the generated audio file. - **message** (string) - Confirmation message. #### Response Example ```json { "audio_url": "https://example.com/audio.mp3", "message": "Audio generated successfully" } ``` ``` -------------------------------- ### V1 API - Classic Voices Source: https://botnoiapi.lovable.app/index This endpoint generates audio using classic V1 voices. It supports various languages and allows customization of speaker, volume, speed, and output format. ```APIDOC ## POST /openapi/v1/generate_audio ### Description Generates audio from text using classic V1 voices. Allows customization of speaker, volume, speed, output format, and saving the file. ### Method POST ### Endpoint `https://api-voice.botnoi.ai/openapi/v1/generate_audio` ### Parameters #### Header Parameters - **accept** (string) - Required - `application/json` - **botnoi-token** (string) - Required - Your API key #### Request Body - **text** (string) - Required - The text to convert to speech. - **speaker** (string) - Required - Speaker ID from the voice library (e.g., '1'). - **volume** (number) - Optional - Audio volume (0.1 - 2.0). Defaults to 1. - **speed** (number) - Optional - Speech speed (0.5 - 2.0). Defaults to 1. - **type_media** (string) - Optional - Output format (mp3, wav). Defaults to 'mp3'. - **save_file** (string) - Optional - Whether to save the file ('True' or 'False'). Defaults to 'True'. - **language** (string) - Required - Language code (e.g., 'en', 'th', 'ja'). The input text must match the specified language. ### Request Example ```json { "text": "สวัสดีครับ", "speaker": "1", "volume": 1, "speed": 1, "type_media": "mp3", "save_file": "True", "language": "th" } ``` ### Response #### Success Response (200) - **audio_url** (string) - URL to the generated audio file. - **message** (string) - Confirmation message. #### Response Example ```json { "audio_url": "https://example.com/audio.mp3", "message": "Audio generated successfully" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.