How to hit the Voyage AI API

Voyage AI at https://api.voyageai.com/v1 makes embedding and reranking models for search and retrieval. input_type tells it whether text is a query or a document.

Authentication

Create a key at dashboard.voyageai.com. Send it as Authorization: Bearer <key>. In the examples it's written {{VOYAGE_API_KEY}}.

Full reference: https://docs.voyageai.com/reference/embeddings-api

Create embeddings

curl https://api.voyageai.com/v1/embeddings \
  -H "Authorization: Bearer {{VOYAGE_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"model": "voyage-4-large", "input": ["Sample text"], "input_type": "document"}'
Run in PostTaco