Search by

flowspeech / flowspeech-php

waeckerlinfederowicz66-sketch

PHP client for the FlowSpeech text-to-speech API.

dev-main 2026-07-13 09:53 UTC

This package is auto-updated.

Last update: 2026-09-13 10:36:14 UTC


README

PHP client for the FlowSpeech text-to-speech API.

FlowSpeech converts text into human-like audio with context-aware delivery, emotion control, pause control, and multi-speaker voice configuration. This package provides a small Composer-friendly client for the public FlowSpeech API surface.

Installation

composer require flowspeech/flowspeech-php

Authentication

Create a FlowSpeech API key in your account, then pass it as a Bearer token through the client:

use FlowSpeech\FlowSpeechClient;

$client = new FlowSpeechClient(getenv('FLOWSPEECH_API_KEY'));

Do not commit real FlowSpeech API keys, provider keys, cookies, session tokens, or environment values.

Check Quota

$quota = $client->getQuota();
print_r($quota);

Generate Speech

$audio = $client->generateSpeech(
    'Welcome to FlowSpeech. Generate natural speech from context-aware text.',
    [
        ['voiceName' => 'Kore'],
    ],
);

print_r($audio);

Multi-Speaker Speech

$audio = $client->generateMultiSpeakerSpeech(
    "Speaker A: We can make this sound natural.\nSpeaker B: Great, let's use different voices.",
    [
        ['speaker' => 'Speaker A', 'voiceName' => 'Kore'],
        ['speaker' => 'Speaker B', 'voiceName' => 'Puck'],
    ],
);

print_r($audio);

API Surface

This client targets the stable FlowSpeech API-key flow:

  • GET /api/ai/text-to-speech/quota
  • POST /api/ai/text-to-speech

It intentionally avoids internal web-session routes and provider-specific compatibility routes.

License

MIT