PHP code example of aisdk / togetherai
1. Go to this page and download the library: Download aisdk/togetherai 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 / togetherai example snippets
use AiSdk\Generate;
use AiSdk\TogetherAI;
$result = Generate::text('Explain closures in PHP in one sentence.')
->model(TogetherAI::model('deepseek-ai/DeepSeek-V4.1-Flash-1017'))
->run();
echo $result->text;