# Voyage 4

The balanced mid-tier in Voyage AI by MongoDB's Voyage 4 series. Voyage 4 shares the Voyage 4 embedding space with the flagship and lite variants, letting you mix models across document and query workloads without separate indices.

- **Model ID:** `voyage/voyage-4`
- **Type:** embedding
- **Providers:** voyage
- **Context window:** 32,000
- **Maximum output tokens:** 0
- **Pricing:** $0.06/1M input tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/voyage-4

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { embed } from 'ai';

const result = await embed({
  model: 'voyage/voyage-4',
  value: 'Sunny day at the beach',
})
```

## About

Voyage 4 sits at the center of Voyage AI by MongoDB's Voyage 4 lineup, released January 15, 2026. It supports a context window of 32K tokens and occupies the middle ground between the MoE flagship `voyage-4-large` and the budget-oriented `voyage-4-lite`.

All Voyage 4 models share one embedding space. You can embed documents with `voyage-4-large` and run queries through Voyage 4 without maintaining separate vector indices. This asymmetric pattern lets you optimize cost per query while keeping document embeddings at flagship quality.

Voyage 4 supports Matryoshka dimensions (2048, 1024, 512, 256) and quantization-aware training across float32, int8, and binary formats. These compression options apply the same way across all Voyage 4 models, so you can tune storage costs independently of which model you choose for embedding.

## What to consider

When query volume dominates cost, embed the corpus once with `voyage-4-large` and serve queries with `voyage-4-lite`, or Voyage 4. Voyage AI by MongoDB reports higher accuracy than symmetric retrieval with smaller models alone.

Use Voyage 4 for both queries and documents when you want one model and balanced cost.

Moving from voyage-3.5, voyage-3-large, or older models requires re-embedding because the embedding space differs from Voyage 4.

## When to use

### Best For

- **General-purpose retrieval** where you want Voyage 4's shared space and mid-sized efficiency
- **Asymmetric setups** where documents use `voyage-4-large` and queries use Voyage 4
- **RAG pipelines** that use Matryoshka dimensions and quantization to cut vector database cost
- **Teams moving from voyage-3-large** who want Voyage 4 compatibility

### Consider Alternatives When

- **You need the highest published Voyage 4 scores**; use `voyage-4-large`
- **You need the lowest query compute**; use `voyage-4-lite`
- **Your corpus is exclusively source code**; use `voyage-code-3`
- **You need multimodal embeddings**; pick a model with native image inputs

## Best for

- **General-purpose retrieval:** You want Voyage 4's shared space and mid-sized efficiency
- **Asymmetric setups:** Documents use `voyage-4-large` and queries use Voyage 4 to control latency and cost
- **RAG pipelines:** Use Matryoshka dimensions and quantization to cut vector database cost
- **Teams moving from voyage-3-large:** Want Voyage 4 compatibility and flagship accuracy on the document side

## Consider alternatives

- **Highest average retrieval scores in Voyage AI by MongoDB's published Voyage 4 benchmarks:** Use `voyage-4-large` (MoE flagship)
- **Lowest compute for queries:** Use `voyage-4-lite` when per-query cost is the binding constraint and voyage-3.5-level accuracy is sufficient
- **Source-code-only corpora:** `voyage-code-3` stays purpose-built for code
- **Multimodal text-and-image embeddings:** Pick a model with native image inputs

## Frequently asked questions

### What is the difference between Voyage 4, voyage-4-large, and voyage-4-lite?

`voyage-4-large` is the MoE flagship with the highest average retrieval scores in Voyage AI by MongoDB's published Voyage 4 benchmarks. Voyage 4 is the mid-sized model; Voyage AI by MongoDB reports it approaches voyage-3-large quality. `voyage-4-lite` uses fewer parameters; Voyage AI by MongoDB reports it approaches voyage-3.5 retrieval accuracy. All three share one embedding space.

### How does Voyage 4 compare to voyage-3.5?

Voyage 4 is a Voyage 4 model with a shared embedding space and updated training. Voyage AI by MongoDB positions `voyage-4-lite` near voyage-3.5 accuracy; Voyage 4 targets voyage-3-large-level quality. Moving from Voyage 3.x requires re-embedding your corpus.

### What is the context window for Voyage 4?

32K tokens. Set chunk sizes so single-pass embeds stay under this limit on long texts.

### Can I use Voyage 4 for RAG applications?

Yes. Voyage 4 is a text embedding model for semantic search and retrieval-augmented generation across mixed content types, including technical documentation, business text, and conversational text.

### How do I access Voyage 4 through Vercel AI Gateway?

Add your Voyage AI by MongoDB API key in AI Gateway settings, then send embedding requests through AI Gateway. AI Gateway authenticates requests and records usage.

### Do I need to re-embed my data to switch from Voyage 3.x to Voyage 4?

Yes. Voyage 3 and Voyage 4 use different embedding spaces, so you re-embed and re-index when you move generations. Within Voyage 4, you can often change query models without re-vectorizing documents if you follow Voyage AI by MongoDB's asymmetric retrieval pattern with `voyage-4-large` document embeddings.

### What is shared embedding space in Voyage 4?

All Voyage 4 models map text into the same vector space, so embeddings from different models in the family are compatible. You can search document vectors from `voyage-4-large` with query vectors from Voyage 4 or `voyage-4-lite`.

## Links

- [Model page](https://vercel.com/ai-gateway/models/voyage-4)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://docs.voyageai.com/docs/embeddings)
- [Provider pricing](https://docs.voyageai.com/docs/pricing)
