Voyage AI embedding model

voyage-code-4

Voyage Code 4

Voyage Code 4 is Voyage AI's code-retrieval embedding model, trained so natural-language queries such as bug reports find the right code for coding agents. it succeeds voyage-code-3 at a third lower price.

01

price

$0.12/M

per 1M input tokens

embeddings bill input only — there are no output tokens. octomind bills the listed provider price, with no markup, on every plan, including the free one (pay as you go from credits).

02

what real work costs

workloadcost
index 10,000 help articles ~800 tokens each, 8M tokens $0.96
index a 1M-line codebase ~10 tokens a line, 10M tokens $1.20
embed 1M search queries ~20 tokens each, 20M tokens $2.40

at the listed price. re-embedding after a model change costs the same again.

03

specs

provider
Voyage AI
max input
about 32k tokens per text
dimensions
1,024 by default; also 256, 512 and 2,048
storage per 1M vectors
4.1 GB at 1,024 dims · 2 GB at 512 dims · 1 GB at 256 dims (float32)
accepts
text, code
weights
closed
released
August 13, 2026
model id
voyage-code-4

integration notes

  • context length is 32,000 tokens; over-length inputs are silently truncated unless truncation is set to false.
  • a single request accepts at most 1,000 texts in its input list.
  • set input_type to query or document so Voyage prepends its retrieval prompt; None embeds the raw text.

04

when to pick it

pick it if

  • you index source code for coding agents or natural-language code search
  • you want Voyage's reported 27.54% gain over voyage-code-3 on agentic retrieval
  • you need 256-2048 Matryoshka dimensions to trade index size for accuracy

05

where it sits on price

8th cheapest of the 10 embedding models in the catalog.

06

use Voyage Code 4 in octomind

octocode, octomind's semantic code search, takes any octohub embedding model by id. one octohub key covers it.

octocode config.toml
[embedding]
code_model = "octohub:voyage-code-4"
text_model = "octohub:voyage-code-4"

07

compare Voyage Code 4

all model comparisons →

08

similar embeddings

nearest embedding models by price.

view all models →

09

Voyage Code 4 faq

how much does voyage-code-4 cost?

$0.12/M input tokens; embeddings have no output charge. index a 1M-line codebase (~10 tokens a line, 10M tokens) costs about $1.20.

how many dimensions does voyage-code-4 have?

1,024 by default; also 256, 512 and 2,048. at the default size, one million float32 vectors take 4.1 GB.

what is the maximum input length of Voyage Code 4?

about 32k tokens per text (≈ 50 pages of prose or 3,000 lines of code). longer documents need chunking before embedding.

how do i use Voyage Code 4 with octocode?

set code_model and text_model to "octohub:voyage-code-4" in the [embedding] section of octocode's config.toml, then re-index.

use Voyage Code 4 in octomind

use it for semantic code search with octocode, or call it through octohub.