Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI TTS PHP SDK for RunAPI

Packagist License

Use the OpenAI TTS PHP SDK to generate speech through RunAPI with a synchronous Composer client and typed managed-audio responses.

Install

composer require runapi-ai/openai-tts

Quick start

<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\OpenaiTts\OpenaiTtsClient;

$client = new OpenaiTtsClient(); // reads RUNAPI_API_KEY
$result = $client->textToSpeech->run([
    'model' => 'tts-1',
    'text' => 'A product render',
]);

echo $result->audios[0]->url . PHP_EOL;

Pass request parameters as associative arrays with snake_case keys. Keep RUNAPI_API_KEY in the environment or your secret manager.

Links

License

Licensed under the Apache License, Version 2.0.

About

RunAPI OpenAI TTS Composer package for PHP applications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages