voyage-code-2

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

  • voyage-code-2

Model Overview

This embedding model is designed for semantic retrieval of code and related text from both natural language and code-based queries. In a comprehensive evaluation across 11 code retrieval tasks—sourced from popular datasets like HumanEval and MBPP—it achieved a significant 14.52% improvement in recall over competitors, including OpenAI and Cohere. Additionally, it demonstrated consistent gains, averaging 3.03%, across various general-purpose text datasets.

Setup your API Key

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

Submit a request

API Schema

post
Authorizations
Body
modelundefined · enumRequiredPossible values:
inputany ofRequired
string · min: 1 · max: 8000Optional
or
string[]Optional
input_typestring · enumOptionalDefault: documentPossible values:
encoding_formatstringOptional
Responses
201Success
post
POST /v1/embeddings HTTP/1.1
Host: api.apilaplas.com
Authorization: Bearer <YOUR_LAPLASAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 89

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

No content

Last updated