[Voyage AI](/ai-gateway/models/labs/voyage)

# Voyage Code 3

Voyage Code 3 is Voyage AI's code-specialized embedding model with a context window of 0 tokens, 300+ programming language support, and Matryoshka dimensionality. It outperforms OpenAI text-embedding-3-large by 13.80% on code retrieval across 32 datasets. Your use is subject to Voyage AI's [Terms](https://www.voyageai.com/tos) & [Privacy](https://www.voyageai.com/privacy) Policies.

[Use with AI Gateway](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Futm_source%3Dgateway-model-page%26utm_campaign%3Dai-gateway-models&title=Get+Started+with+Vercel+AI+Gateway) [View docs](https://vercel.com/docs/ai-gateway)

```
1import { embed } from 'ai';
2

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

[Read docs](https://vercel.com/docs/ai-gateway/sdks-and-apis/ai-sdk)

[Overview](/ai-gateway/models/voyage-code-3) [About](/ai-gateway/models/voyage-code-3/about) [Providers](/ai-gateway/models/voyage-code-3/providers) [Similar](/ai-gateway/models/voyage-code-3/similar) [FAQ](/ai-gateway/models/voyage-code-3/faq)

## [Copy link to heading](#providers)Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the [docs](/docs/ai-gateway/provider-options) for more info. Using a provider means you agree to their terms, listed under Legal.

| Provider |
| --- |

| Context | Input | Capabilities | ZDR | No Training | Free Tier | Release Date |  |
| --- | --- | --- | --- | --- | --- | --- | --- |

| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [Voyage AI](/ai-gateway/models/providers/voyage) Legal:[Terms](https://www.voyageai.com/tos)•[Privacy](https://www.voyageai.com/privacy) |  | $0.18/M |  |  |  |  | 12/04/2024 |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |

## [Copy link to heading](#more-models-by-voyage-ai)More models by Voyage AI

All

Embed

Rerank

| Model |
| --- |

| Context | Latency | Throughput | Input | Output | Cache | Web Search | Capabilities | Providers | ZDR | No Training | Free Tier | Release Date |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |

| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/voyage\-4-large](/ai-gateway/models/voyage-4-large) | 32K |  |  | $0.12/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 01/15/2026 |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/voyage-4](/ai-gateway/models/voyage-4) | 32K |  |  | $0.06/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 01/15/2026 |  |
| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/voyage-4-lite](/ai-gateway/models/voyage-4-lite) | 32K |  |  | $0.02/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 01/15/2026 |  |
| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/rerank-2.5](/ai-gateway/models/rerank-2.5) | 32K |  |  | $0.05/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 08/11/2025 |  |
| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/voyage-3.5-lite](/ai-gateway/models/voyage-3.5-lite) |  |  |  | $0.02/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 05/20/2025 |  |
| ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) [voyage/voyage-finance-2](/ai-gateway/models/voyage-finance-2) |  |  |  | $0.12/M |  |  | — |  | ![voyage logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fvoyage.png&w=48&q=75) |  |  |  | 06/03/2024 |  |

## [Copy link to heading](#about-voyage-code-3)About Voyage Code 3

Voyage Code 3 is Voyage AI's code-specialized embedding model, released December 4, 2024. It supports a context window of 0 tokens and produces embeddings in four dimensions: 2048, 1024, 512, and 256. Voyage AI trained it on trillions of tokens combining text, code, and mathematical content plus real-world query-code pairs from GitHub repositories. It covers over 300 programming languages.

Across 32 code retrieval datasets, Voyage Code 3 outperforms OpenAI text-embedding-3-large by 13.80% and CodeSage-large by 16.81%. At 1024 dimensions, it retains 92.28% of its full-precision quality, compared to 77.64% for OpenAI at the same dimension. This makes dimension reduction particularly effective for cost or latency optimization.

Quantization-aware training supports 32-bit float, `int8`, `uint8`, binary, and unsigned binary formats. Binary embeddings at 256 dimensions still outperform OpenAI text-embedding-3-large by 4.81% while using 1/384th the storage of 3072-dimensional float embeddings. These compression options make Voyage Code 3 practical for very large codebases where millions of files need indexing.

## [Copy link to heading](#what-to-consider-when-choosing-a-provider)What To Consider When Choosing a Provider

- Configuration: Voyage Code 3 covers 300+ programming languages, the widest language coverage in Voyage AI's code embedding lineup. If your codebase spans multiple languages or includes less common languages, this breadth eliminates the need for language-specific models.
- Configuration: At 1024 dimensions, Voyage Code 3 retains 92.28% quality versus 77.64% for OpenAI. This makes dimension reduction particularly effective for Voyage Code 3, enabling large-scale code search indices at lower storage cost.
- Configuration: Voyage Code 3 doubles the context window (32K vs. 16K), adds Matryoshka dimensionality, and expands language coverage from a handful of languages to 300+. For new code search deployments, Voyage Code 3 is the recommended option.
- Zero Data Retention: Zero Data Retention is offered on a per-provider and model basis. See the [documentation](https://vercel.com/docs/ai-gateway/security-and-compliance/zdr) for details.
- Authentication: AI Gateway authenticates requests using an [API key](https://vercel.com/docs/ai-gateway/authentication-and-byok#api-key-authentication) or [OIDC token](https://vercel.com/docs/ai-gateway/authentication-and-byok#oidc-token-authentication). You do not need to manage provider credentials directly.

## [Copy link to heading](#when-to-use-voyage-code-3)When to Use Voyage Code 3

### Best for

- Enterprise code search: Polyglot repositories with hundreds of programming languages
- RAG for code generation: Retrieving relevant code examples, patterns, and documentation improves generated output quality
- Large-scale code indexing: Binary or int8 embeddings at 256-1024 dimensions keep storage costs manageable across millions of files
- Text-to-code retrieval: Natural language queries surface relevant functions, classes, and modules
- Code-to-code similarity: Detecting duplicates, finding related implementations, and recommending refactoring targets
- Developer tools and IDE integrations: Fast, accurate code search served as a backend service

### Consider alternatives when

- Your retrieval corpus is primarily natural language: Voyage-3.5 or voyage-3-large are better general-purpose choices when there's little or no code
- Your workload is exclusively in one domain like legal or finance: Domain-specific models may provide marginal accuracy gains
- You need multimodal embeddings: Pick a model with native image inputs for screenshots and diagrams
- Maximum cost efficiency is required: Voyage-3.5-lite handles code as one of its eight evaluated domains when accuracy requirements are moderate

## [Copy link to heading](#conclusion)Conclusion

Voyage Code 3 achieves a 13.80% improvement in code retrieval quality over OpenAI text-embedding-3-large across 32 datasets and covers 300+ programming languages. Its Matryoshka dimensionality and quantization options make it practical for indexing large codebases at scale. Route requests through AI Gateway for unified access, usage tracking, and the flexibility to switch providers without changing your integration.