voyage-law-2

This documentation is valid for the following list of our models:

  • voyage-law-2

Model Overview

This model leads the MTEB leaderboard for legal retrieval by a significant margin, outperforming OpenAI v3 large by an average of 6% across eight legal retrieval datasets and by over 10% on three key benchmarks (LeCaRDv2, LegalQuAD, and GerDaLIR). With a 16K context length and training on extensive long-context legal documents, voyage-law-2 excels in retrieving information across lengthy texts. Notably, it also matches or surpasses performance on general-purpose corpora across domains.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

Submit a request

API Schema

post
Authorizations
Body
modelundefined · enumRequiredPossible values:
inputany ofRequired

Input text to embed, encoded as a string or array of tokens.

string · min: 1 · max: 8000Optional
or
string[]Optional
input_typestring · enumOptional

The type of input data for the model.

Default: documentPossible values:
Responses
201Success
post
POST /v1/embeddings HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 63

{
  "model": "voyage-law-2",
  "input": "text",
  "input_type": "document"
}
201Success

No content

Last updated

Was this helpful?