var CloudmersiveSpeechApiClient = require('cloudmersive-speech-api-client');
var defaultClient = CloudmersiveSpeechApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveSpeechApiClient.SpeakApi();

var format = "format_example"; // String | File format to generate response in; possible values are \"mp3\" or \"wav\"

var text = "text_example"; // String | The text you would like to conver to speech.  Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.speakPost(format, text, callback);
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');



$apiInstance = new Swagger\Client\Api\SpeakApi(
    
    
    new GuzzleHttp\Client(),
    $config
);
$format = "format_example"; // string | File format to generate response in; possible values are \"mp3\" or \"wav\"
$text = "text_example"; // string | The text you would like to conver to speech.  Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"

try {
    $result = $apiInstance->speakPost($format, $text);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SpeakApi->speakPost: ', $e->getMessage(), PHP_EOL;
}
?>
CMDefaultConfiguration *apiConfig = [CMDefaultConfiguration sharedConfig];

// Configure API key authorization: (authentication scheme: Apikey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Apikey"];




NSString* format = @"format_example"; // File format to generate response in; possible values are \"mp3\" or \"wav\"
NSString* text = text_example; // The text you would like to conver to speech.  Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"

CMSpeakApi*apiInstance = [[CMSpeakApi alloc] init];

// Perform text-to-speech on a string
[apiInstance speakPostWithFormat:format
              text:text
          completionHandler: ^(NSObject* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling CMSpeakApi->speakPost: %@", error);
                        }
                    }];
# load the gem
require 'cloudmersive-voice-recognition-api-client'
# setup authorization
CloudmersiveVoiceRecognitionApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveVoiceRecognitionApiClient::SpeakApi.new

format = "format_example" # String | File format to generate response in; possible values are \"mp3\" or \"wav\"

text = "text_example" # String | The text you would like to conver to speech.  Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"


begin
  #Perform text-to-speech on a string
  result = api_instance.speak_post(format, text)
  p result
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
  puts "Exception when calling SpeakApi->speak_post: #{e}"
end