Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/phpaisdk/voyageai/llms.txt

Use this file to discover all available pages before exploring further.

The aisdk/voyageai package is the official Voyage AI provider for the PHP AI SDK. It wires Voyage AI’s text embeddings endpoint into the portable Generate::embedding() API so you can produce float-vector embeddings without writing HTTP plumbing, while still passing Voyage-native options — input_type, truncation, output_dimension, and more — directly through to the API.

Key Features

Portable Embedding API

Integrates seamlessly with Generate::embedding() from aisdk/core, keeping your application code provider-agnostic and easy to swap.

Voyage-Native Options

Pass Voyage-specific fields — input_type, truncation, output_dtype — via providerOptions() without any wrapper abstraction in the way.

Environment-Based Config

Reads VOYAGE_API_KEY and VOYAGE_BASE_URL from the environment automatically, so no credentials ever need to be hard-coded.

PHP 8.3+ Strict Types

Built entirely with declare(strict_types=1), readonly properties, and typed return values — idiomatic modern PHP throughout.

Requirements

The following dependencies are required and will be installed automatically by Composer:
DependencyVersion
PHP^8.3
aisdk/core^0.8.0
aisdk/openai-compatible^0.8.0
Scope: This package covers Voyage AI’s text embeddings endpoint only. Multimodal embeddings, contextualized chunk embeddings, and reranking use different API contracts and are not part of this package surface. The SDK result is always a float vector; output_dtype: float is the only accepted encoding — quantized and bit-packed output types are rejected before a request is sent.

Next Steps

  • Follow the Quickstart to install the package and generate your first embedding in minutes.
  • Read the Configuration guide to understand all available environment variables and programmatic options.

Build docs developers (and LLMs) love