aistemsplitter/aistemsplitter-php

Official PHP SDK for the AIStemSplitter public API.

Maintainers

Package info

github.com/aistemsplitter/aistemsplitter-php

Homepage

Documentation

pkg:composer/aistemsplitter/aistemsplitter-php

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-05-09 04:59 UTC

This package is not auto-updated.

Last update: 2026-05-10 04:43:19 UTC


README

Website Docs OpenAPI

Official PHP SDK for AIStemSplitter, an AI-powered stem splitter that separates vocals, drums, bass, and other instruments from uploaded audio files or direct audio URLs.

Links

Features

  • Vocal isolation and remover workflows
  • Drum, bass, and instrumental stems
  • Async API with webhook callbacks
  • Pay-as-you-go credits

Get an API Key

Sign up at aistemsplitter.org and use AISTEMSPLITTER_API_KEY in local examples.

Install

composer require aistemsplitter/aistemsplitter-php

Quickstart

<?php

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

use AIStemSplitter\Client;

$client = new Client(getenv('AISTEMSPLITTER_API_KEY'));

$credits = $client->getCredits();
echo $credits['balance'] . ' ' . $credits['unit'] . PHP_EOL;

$split = $client->createSplit([
    'input' => [
        'type' => 'direct_url',
        'url' => 'https://example.com/song.mp3',
    ],
    'stemModel' => '6s',
], idempotencyKey: 'retry-001');

$result = $client->waitForSplit($split['id'], timeoutMs: 10 * 60 * 1000, intervalMs: 2000);
print_r($result['stems'] ?? []);

Upload Then Split

$upload = $client->uploadAudio(
    filename: 'song.mp3',
    contentType: 'audio/mpeg',
    contents: file_get_contents(__DIR__ . '/song.mp3'),
);

$split = $client->createSplit([
    'input' => $upload['input'],
    'stemModel' => '4s',
]);

Smoke Example

AISTEMSPLITTER_API_KEY=ast_live_xxx php examples/smoke.php

Without AISTEMSPLITTER_API_KEY, the smoke example exits cleanly with setup instructions.

Development

composer validate --strict
composer test
php -l src/Client.php
php -l src/AIStemSplitterException.php

Publishing to Packagist is blocked until the github.com/aistemsplitter/aistemsplitter-php repository exists and the package is submitted or linked in Packagist.