PHP code example of javaabu / dhivehigpt-sdk

1. Go to this page and download the library: Download javaabu/dhivehigpt-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

javaabu / dhivehigpt-sdk example snippets


use Javaabu\DhivehiGpt\DhivehiGpt;

$dhivehigpt = new DhivehiGpt('YOUR_API_KEY');

$voices = $dhivehigpt->voices()->list();

$audio = $dhivehigpt->tts()->generate('ދިވެހިޖީޕީޓީއަށް މަރުޙަބާ', 'hajja');

'dhivehigpt' => [
    'api_key' => env('DHIVEHIGPT_API_KEY'),
    'base_url' => env('DHIVEHIGPT_BASE_URL'), // optional
    'api_version' => env('DHIVEHIGPT_API_VERSION'), // optional
    'guzzle' => [], // optional, additional Guzzle client options
],

use Javaabu\DhivehiGpt\Facades\DhivehiGpt;

$voices = DhivehiGpt::voices()->list();

$audio = DhivehiGpt::tts()->generate('ދިވެހިޖީޕީޓީއަށް މަރުޙަބާ', 'hajja');