PHP code example of aisdk / assemblyai

1. Go to this page and download the library: Download aisdk/assemblyai 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/ */

    

aisdk / assemblyai example snippets


use AiSdk\AssemblyAI;
use AiSdk\Content;
use AiSdk\Generate;

AssemblyAI::create(['apiKey' => $_ENV['ASSEMBLYAI_API_KEY']]);

$result = Generate::transcription()
    ->model(AssemblyAI::model('universal-3-pro'))
    ->audio(Content::audio('https://example.com/audio.mp3'))
    ->run();