Skip to content
Software capabilities
Voyage AI

How to create Voyage AI embeddings

Create embeddings with REST or the official Python client, batching within model and account limits.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: POST /v1/embeddings
  2. SDK: voyageai.Client.embed
API

POST /v1/embeddings

Generate vectors for texts.

Read source: Voyage embeddings API reference
Requirements
Voyage API key, supported model, and JSON input.
Limitations
The input list can contain up to 1,000 texts. The voyage-3.5 model accepts up to 320,000 total tokens per request.

Example shell

curl --fail https://api.voyageai.com/v1/embeddings -H "Authorization: Bearer $VOYAGE_API_KEY" -H "Content-Type: application/json" -d '{"input":["A short document"],"model":"voyage-3.5"}'
SDK

voyageai.Client.embed

Generate embeddings in Python.

Read source: Voyage embeddings guide
Requirements
Python, voyageai, and API key.
Limitations
The default truncation setting shortens individual texts that exceed the model context length. Set truncation=False to surface an error instead.

Example text

import voyageai
client = voyageai.Client()
result = client.embed(["A short document"], model="voyage-3.5", input_type="document")