spiralink/vapi-php-sdk

An unofficial PHP SDK for accessing Vapi's API.

Installs: 14

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/spiralink/vapi-php-sdk

0.1.0 2025-10-16 06:50 UTC

This package is auto-updated.

Last update: 2025-10-16 07:37:25 UTC


README

Vapi PHP SDK PHP

Build Status Total Downloads Latest Stable Version License

Vapi PHP SDK

This SDK provides convenient, fully-typed access to Vapi's API.

Installation

You can install the package via composer:

composer require spiralink/vapi-php-sdk

Usage

You can always refer to the documentation to examine the various resources that are available.

use Vapi\Vapi;

$vapi = new Vapi(token: 'your-api-token');

$assistants = $vapi->assistants->list();

Handling exceptions

If something goes wrong during any kind of interaction, an exception of type VapiApiException will be thrown:

use Vapi\Exceptions\VapiApiException;

try {
    $call = $vapi->calls->create($request);
} catch (VapiApiException $ex) {
    $logger->log($ex->getMessage());
}

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retriable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

A request is deemed retriable when any of the following HTTP status codes is returned:

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

Use the maxRetries request option to configure this behavior.

$call = $vapi->calls->create($request, [
    'maxRetries' => 0, // Override maxRetries at the request level
]);

Timeouts

The SDK defaults to a 30 second timeout. Use the timeout option to configure this behavior.

$call = $vapi->calls->create($request, [
    'timeout' => 15, // Override timeout at the request level
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email support@spiralink.ai instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.