Voyage law 2 overview
Voyage law 2 specs
- Model ID
anthropic/voyage-law-2- Developer
- Anthropic
- Input
- Text
- Endpoint
POST https://api.aimlapi.com/v1/embeddings
Voyage Law 2 is a domain-specific embedding model fine-tuned for legal document retrieval and similarity tasks.
Semantic search
Rank documents by meaning for retrieval and discovery.
RAG pipelines
Ground LLM answers in your own data via vector retrieval.
Use cases
Legal retrieval and RAG are documented use cases for voyage-law-2.
It is also documented as suited to long-context retrieval across domains, with the model described as trained on long-context legal documents and excelling in retrieving information from lengthy texts.
Legal tasks are explicitly listed as a use case for voyage-law-2 in the platform documentation.
The model is also described as recommended for retrieval tasks in the legal domain.
Voyage law 2 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.12 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
How to use the Voyage law 2 API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/embeddings' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "anthropic/voyage-law-2",
"input": "The quick brown fox jumps over the lazy dog."
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "anthropic/voyage-law-2",
"input": "The quick brown fox jumps over the lazy dog."
}
response = requests.post("https://api.aimlapi.com/v1/embeddings", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/embeddings", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "anthropic/voyage-law-2",
"input": "The quick brown fox jumps over the lazy dog."
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Voyage law 2 FAQ
What inputs and outputs does Voyage law 2 support?
Voyage law 2 takes text as input and returns embedding.
When was Voyage law 2 released?
Voyage law 2 became available on December 13, 2025.
How much does Voyage law 2 cost?
Voyage law 2 costs $0.12 per 1M input tokens on AI/ML API, billed as you go with no subscription.
Who created Voyage law 2?
Voyage law 2 was built by Anthropic.
How do I call Voyage law 2 on AI/ML API?
Send a request to https://api.aimlapi.com/v1/embeddings with anthropic/voyage-law-2 as the model id.
Is Voyage law 2 available through a single API key?
Yes. Voyage law 2 is served through AI/ML API, so the same key and endpoint format used for other models applies.
What is Voyage Law 2 designed for?
It is a domain-specific embedding model fine-tuned for legal document retrieval and similarity tasks.
What is the Voyage law 2 model ID?
Use anthropic/voyage-law-2 as the model parameter. Requests go to https://api.aimlapi.com/v1/embeddings with your AI/ML API key.