If you are an existing Voyage AI user, complete the following steps to migrate your application to use the Atlas Embedding and Reranking API.
Procedure
Sign up for a free Atlas account or log in.
If you're new to Atlas, it creates an organization and project for you.
To learn more, see Create an Atlas Account.
Create a model API key for your project.
In your Atlas project, select AI Models from the navigation bar.
Click Create model API key.
Give the API key a name and then click Create.
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.
Replace your existing Voyage API key with the model API key.
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
Replace explicit API endpoints with the Embedding and Reranking API endpoints.
If your application explicitly specifies API endpoints, update it to use the equivalent Embedding and Reranking API API endpoints:
Old Endpoint | New Endpoint |
|---|---|
|
|
|
|
|
|
|
|
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.