Docs Menu
Docs Home

Migrate Your Applications to use the Atlas Embedding and Reranking API

If you are an existing Voyage AI user, complete the following steps to migrate your application to use the Atlas Embedding and Reranking API.

1

If you're new to Atlas, it creates an organization and project for you.

To learn more, see Create an Atlas Account.

2
  1. In your Atlas project, select AI Models from the navigation bar.

  2. Click Create model API key.

  3. Give the API key a name and then click Create.

  4. To confirm your API key is valid, you can make a test request to the Embedding and Reranking API:

    curl \
    --request POST 'https://ai.mongodb.com/v1/embeddings' \
    --header "Authorization: Bearer $VOYAGE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "input": "Sample text",
    "model": "voyage-4-lite",
    "input_type": "document"
    }'

To learn more about creating and managing API keys, see Model API Keys.

3

For example, if you set your API key as an environment variable, update the value:

VOYAGE_API_KEY="<your-new-model-api-key>"

If you pass the API key directly in your code, update the value where you initialize the client or make API requests.

Note

If you set your API key as an environment variable, you can run the following command to verify the variable is set:

echo $VOYAGE_API_KEY
4

If your application explicitly specifies API endpoints, update it to use the equivalent Embedding and Reranking API API endpoints:

Old Endpoint
New Endpoint

https://api.voyageai.com/v1/embeddings

https://ai.mongodb.com/v1/embeddings

https://api.voyageai.com/v1/rerank

https://ai.mongodb.com/v1/rerank

https://api.voyageai.com/v1/multimodalembeddings

https://ai.mongodb.com/v1/multimodalembeddings

https://api.voyageai.com/v1/contextualizedembeddings

https://ai.mongodb.com/v1/contextualizedembeddings

Note

If you use the voyageai Python client (version 0.3.7 or later), the client automatically routes requests to the correct endpoint based on the API key format. No endpoint changes are required if you use the client without explicitly setting the base_url parameter.

To learn more, see Python Client.

5

Test your application to ensure it correctly generates embeddings and performs reranking operations using the Embedding and Reranking API.

6

After you confirm that your application works with the model API key, delete your old API key from the Voyage AI platform to prevent unauthorized access.

On this page