The Voyage AI provider follows the Vercel AI SDK provider pattern, giving you a consistent interface for generating embeddings and reranking documents.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/patelvivekdev/voyageai-ai-provider/llms.txt
Use this file to discover all available pages before exploring further.
What is a provider?
A provider is a factory that creates model instances. The Voyage provider implements theProviderV3 interface from the AI SDK, which means it integrates seamlessly with the rest of the AI SDK ecosystem.
When you create a provider instance, you configure shared settings like API keys and base URLs. Then you use that provider to create individual model instances.
Creating a provider
You can use the default provider instance or create a custom one:Provider settings
TheVoyageProviderSettings interface defines the configuration options:
The provider automatically reads your API key from the
VOYAGE_API_KEY environment variable if you don’t provide one explicitly.Provider methods
TheVoyageProvider interface extends ProviderV3 and provides several methods for creating models:
Text embeddings
Create text embedding models using either the call syntax or the explicit method:EmbeddingModelV3 instance.
Image embeddings
Create models for embedding images:Multimodal embeddings
Create models that can embed both text and images:Reranking
Create reranking models using either method name:RerankingModelV3 instance.
The provider uses factory methods to create model instances. Each model instance is configured with the provider’s shared settings (API key, base URL, headers, etc.).
Implementation details
The provider is implemented as a function with additional methods attached. When you call it directly, it creates a text embedding model:Custom configurations
You can customize the provider for different use cases:Using a proxy server
Adding custom headers
Custom fetch middleware
Next steps
Embeddings
Learn how embeddings work and how to generate them
Reranking
Learn how reranking works and how to use it