PHPackages                             aisdk/voyageai - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aisdk/voyageai

ActiveLibrary

aisdk/voyageai
==============

Official Voyage AI provider for the PHP AI SDK.

v0.8.0(1mo ago)04↓25%MITPHPPHP ^8.3CI passing

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/phpaisdk/voyageai)[ Packagist](https://packagist.org/packages/aisdk/voyageai)[ Docs](https://github.com/phpaisdk/voyageai)[ RSS](/packages/aisdk-voyageai/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

aisdk/voyageai
==============

[](#aisdkvoyageai)

[![GitHub Workflow Status](https://camo.githubusercontent.com/024ef45a21d8ba1fe325c58e5d55e3fc79f36d0ea4b030323381619087290352/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870616973646b2f766f7961676561692f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://github.com/phpaisdk/voyageai/actions)[![Total Downloads](https://camo.githubusercontent.com/8bd69e0fa2bf96df07e2d94c3d7a66aaac2fe31e45bc5e59bec91a1ce596dd5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616973646b2f766f796167656169)](https://packagist.org/packages/aisdk/voyageai)[![Latest Version](https://camo.githubusercontent.com/39308b112343ab9fb10d59463ad5e0b32cd161fcdb0ca7cedd88ceb2fa2e1241/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616973646b2f766f796167656169)](https://packagist.org/packages/aisdk/voyageai)[![License](https://camo.githubusercontent.com/f051bc9feb84a8ca127b98243bc32711f360b644235e066cacb9ef12928af3e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616973646b2f766f796167656169)](https://packagist.org/packages/aisdk/voyageai)[![Why PHP in 2026](https://camo.githubusercontent.com/d2b9305e630caf7daae4ca023de39ece0b885c37461629d42961533f00868b76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5768795f5048502d696e5f323032362d3741383645383f7374796c653d666c61742d737175617265266c6162656c436f6c6f723d313831383162)](https://whyphp.dev)

---

Official Voyage AI provider for the PHP AI SDK.

Installation
------------

[](#installation)

```
composer require aisdk/voyageai
```

Text Embeddings
---------------

[](#text-embeddings)

```
use AiSdk\Generate;
use AiSdk\VoyageAI;

$result = Generate::embedding([
        'First document',
        'Second document',
    ])
    ->model(VoyageAI::model('voyage-4-large'))
    ->dimensions(512)
    ->providerOptions('voyageai', [
        'input_type' => 'document',
    ])
    ->run();

$vector = $result->output->vector;
$vectors = $result->embeddings;
```

The portable API covers Voyage's text embeddings endpoint. Multimodal, contextualized chunk embeddings, and reranking use different API contracts and are not part of this package surface yet.

Configuration
-------------

[](#configuration)

VariableDescriptionDefault`VOYAGE_API_KEY`API key for authenticationRequired`VOYAGE_BASE_URL`Base URL for API requests`https://api.voyageai.com/v1````
VoyageAI::create([
    'apiKey' => 'pa-...',
    'baseUrl' => 'https://api.voyageai.com/v1',
    'headers' => ['X-Custom-Header' => 'value'],
]);
```

Provider-Specific Options
-------------------------

[](#provider-specific-options)

Voyage's documented text embedding fields pass through unchanged:

```
$result = Generate::embedding('A search query')
    ->model(VoyageAI::model('voyage-4-large'))
    ->providerOptions('voyageai', [
        'input_type' => 'query',
        'truncation' => true,
        'output_dtype' => 'float',
    ])
    ->run();
```

`dimensions()` maps to Voyage's `output_dimension` field. Model IDs pass through unchanged so Voyage's API remains the source of truth for model availability and supported dimensions.

The portable SDK result is a float vector, so this adapter accepts Voyage's `output_dtype: float` only and rejects base64 encoding. Quantized and bit-packed output need a separate result contract rather than being mislabeled as ordinary float dimensions.

Testing
-------

[](#testing)

```
composer test
```

Documentation
-------------

[](#documentation)

- [PHP AI SDK documentation](https://phpaisdk.com/docs)
- [Voyage AI documentation](https://phpaisdk.com/docs/voyageai)

Community
---------

[](#community)

- [Contributing](https://github.com/phpaisdk/.github/blob/main/CONTRIBUTING.md)
- [Support](https://github.com/phpaisdk/.github/blob/main/SUPPORT.md)
- For private security reports, email .

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef29d1962da41e7526023f215cf844494e209b2fd163742084cb919a3b508021?d=identicon)[aisdk](/maintainers/aisdk)

---

Top Contributors

[![RanaMoizHaider](https://avatars.githubusercontent.com/u/58527494?v=4)](https://github.com/RanaMoizHaider "RanaMoizHaider (7 commits)")

---

Tags

aiembeddingsaisdkvoyageai

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aisdk-voyageai/health.svg)

```
[![Health](https://phpackages.com/badges/aisdk-voyageai/health.svg)](https://phpackages.com/packages/aisdk-voyageai)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
