Skip to content

Voyage AI Integration

Official Voyage AI Documentation

Voyage AI provides embeddings, reranking, contextualized embeddings, multimodal embeddings, files, and batch inference APIs. KeyPool exposes these APIs through a team-token protected service endpoint.

KeyPool Endpoint for Voyage AI

Use:

{YOUR_KEYPOOL_BASE_URL}/v1/voyage

The alias {YOUR_KEYPOOL_BASE_URL}/v1/voyageai is also accepted, but new integrations should use /v1/voyage.

Authentication

Send your KeyPool Team Token to KeyPool:

Authorization: Bearer <KEYPOOL_TEAM_TOKEN>

KeyPool validates your team token and forwards the request to Voyage.

cURL

Embeddings:

curl -X POST "$KEYPOOL_BASE_URL/v1/voyage/v1/embeddings" \
  -H "Authorization: Bearer $KEYPOOL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "voyage-3.5-lite",
    "input": ["Voyage request through KeyPool."]
  }'

Rerank:

curl -X POST "$KEYPOOL_BASE_URL/v1/voyage/v1/rerank" \
  -H "Authorization: Bearer $KEYPOOL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "rerank-2.5-lite",
    "query": "service endpoint",
    "documents": [
      "KeyPool provides one shared Voyage endpoint.",
      "This document is unrelated."
    ]
  }'

Python SDK

import os
import voyageai

client = voyageai.Client(
    api_key=os.environ["KEYPOOL_TOKEN"],
    base_url=f"{os.environ['KEYPOOL_BASE_URL']}/v1/voyage",
)

result = client.embed(
    ["KeyPool exposes Voyage AI through one team endpoint."],
    model="voyage-3.5-lite",
)

print(result.embeddings[0][:5])

The Python SDK appends paths such as /embeddings to base_url. Use the KeyPool Voyage service root shown above; KeyPool accepts the SDK's request shape.

TypeScript

Use the official Voyage SDK with a base URL override if the current SDK version supports it. If the SDK does not expose a base URL option, use fetch directly:

const response = await fetch(`${process.env.KEYPOOL_BASE_URL}/v1/voyage/v1/embeddings`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KEYPOOL_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "voyage-3.5-lite",
    input: ["Voyage request through KeyPool."],
  }),
});

console.log(await response.json());

Files and Batches

Voyage file and batch APIs require callers to keep related file and batch IDs together. Use the same KeyPool base URL and team token when creating files, creating batches, checking batch status, and cancelling batches.

Use this shape:

KEYPOOL_BASE_URL/v1/voyage/...