1. Go to this page and download the library: Download wavespeedai/wavespeed-php 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/ */
$state = $client->getResult('task-id-from-earlier');
echo $state['data']['status']; // e.g. "processing" or "completed"
print_r($state['data']['outputs'] ?? []);
use WaveSpeed\Client;
$client = new Client(
apiKey: 'your-api-key',
maxRetries: 0, // Replacement task attempts (default: 0)
maxConnectionRetries: 5, // Result-query GET retries; POST is never retried
retryInterval: 1.0, // Base delay between retries in seconds (default: 1.0)
);
use WaveSpeed\Client;
use WaveSpeed\Support\CallableLogger;
use WaveSpeed\Support\StderrLogger;
$client = new Client(logger: new StderrLogger());
// Or bridge to PSR-3 / any framework logger:
$client = new Client(
logger: new CallableLogger(fn (string $m) => $psrLogger->warning($m)),
);
use WaveSpeed\WaveSpeed;
$url = WaveSpeed::upload('/path/to/image.png');
echo $url;
// A stream works too — including one you did not open from disk.
$url = WaveSpeed::upload($stream);
use WaveSpeed\Client;
use WaveSpeed\Http\CurlHttpClient;
$client = new Client(
http: new CurlHttpClient([CURLOPT_PROXY => 'http://proxy.internal:3128']),
);