Voyage code 2 API

Voyage Code 2 is an embedding model optimized for code retrieval, similarity search, and programming tasks.

Input price
$0.12per 1M tokens
Model type
Embeddings
Released
Dec 13, 2025

Voyage code 2 overview

Voyage code 2 specs

Model ID
anthropic/voyage-code-2
Developer
Anthropic
Input
Text
Endpoint
POST https://api.aimlapi.com/v1/embeddings

Voyage Code 2 is an embedding model optimized for code retrieval, similarity search, and programming 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

Voyage code 2 is documented as suited to semantic code retrieval, including searching for code from natural-language queries and finding similar code snippets. It is also documented for code completion tasks. It is further documented as useful for general code assistant applications.

Voyage code 2 API pricing

Voyage code 2 pricing in US dollars
UsagePriceUnit
Input$0.121M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

How to use the Voyage code 2 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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-code-2",
  "input": "The quick brown fox jumps over the lazy dog."
}'

Voyage code 2 FAQ

What inputs and outputs does Voyage code 2 support?

Voyage code 2 takes text as input and returns embedding.

When was Voyage code 2 released?

Voyage code 2 became available on December 13, 2025.

How much does Voyage code 2 cost?

Voyage code 2 costs $0.12 per 1M input tokens on AI/ML API, billed as you go with no subscription.

Who created Voyage code 2?

Voyage code 2 was built by Anthropic.

How do I call Voyage code 2 on AI/ML API?

Send a request to https://api.aimlapi.com/v1/embeddings with anthropic/voyage-code-2 as the model id.

Is Voyage code 2 available through a single API key?

Yes. Voyage code 2 is served through AI/ML API, so the same key and endpoint format used for other models applies.

What is Voyage Code 2 designed for?

It is an embedding model built for code retrieval, similarity search, and other programming-related tasks.

What type of model is Voyage Code 2?

It is an embeddings model that converts text input into vector embeddings.

What is the Voyage code 2 model ID?

Use anthropic/voyage-code-2 as the model parameter. Requests go to https://api.aimlapi.com/v1/embeddings with your AI/ML API key.

Start building with Voyage code 2

Voyage code 2 API

anthropic/voyage-code-2

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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-code-2",
  "input": "The quick brown fox jumps over the lazy dog."
}'