VoyageAI by MongoDB: voyage-code-4: AI model
voyage-code-4 is a code embedding model for code search and coding agents from Voyage AI, with a 32K-token context. Reachable from inside Iran through Hormouz.
- Context window:
- 32,000 tokens
- Input:
- $0.12/1M tokens
- Output:
- $0/1M tokens
- Type:
- embedding
- Embeddings
voyage-code-4 is a code embedding model from Voyage AI, a MongoDB company. It turns code and technical text into vectors so a coding agent or search tool can find the right functions, files and snippets in a large codebase. Embeddings come in 2048, 1024, 512 or 256 dimensions with several quantisation options, so you can trade a little accuracy for much smaller indexes.
The model handles up to 32K tokens of input per request. Through Hormouz it is served behind an OpenAI-compatible embeddings API: point your base URL at Hormouz and drop in a Hormouz key. Pricing is usage-based at $0.12 per million input tokens. There is no fixed monthly fee.
Hormouz provides stable access to the model from inside Iran, with no foreign credit card or circumvention tooling required.
voyage-code-4 is a code embedding model from Voyage AI, a MongoDB company. It is designed for coding agents and code retrieval, with Matryoshka embeddings at 2048, 1024, 512, and 256...
Quickstart
curl https://api.hormouz.net/v1/embeddings \
-H "Authorization: Bearer ng-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"voyageai/voyage-code-4","input":"The quick brown fox"}'Specs
| Vendor | Voyage AI |
|---|---|
| Type | Embedding |
| Context window | 32,000 tokens |
| Pricing | $0.12/M in · $0.00/M out |
| API | embeddings |
Code example
curl https://api.hormouz.net/v1/embeddings \
-H "Authorization: Bearer ng-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"voyageai/voyage-code-4","input":"The quick brown fox"}'from openai import OpenAI client = OpenAI(api_key="ng-YOUR_API_KEY", base_url="https://api.hormouz.net/v1") resp = client.embeddings.create(model="voyageai/voyage-code-4", input="The quick brown fox") print(resp.data[0].embedding)
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "ng-YOUR_API_KEY", baseURL: "https://api.hormouz.net/v1" });
const resp = await client.embeddings.create({
model: "voyageai/voyage-code-4",
input: "The quick brown fox",
});
console.log(resp.data[0].embedding);Buy the VoyageAI by MongoDB: voyage-code-4 API, paid in rial
- Buy credit with an Iranian bank card; no foreign card or account needed.
- One Hormouz key reaches VoyageAI by MongoDB: voyage-code-4 and 600+ other models, and you pay only for what you use.
- No VPN and no risk of a banned account; just change the base URL to api.hormouz.net/v1.
Use via Hormouz
Connect to this model and 600+ others with one API key, then see usage down to each request.
Request company accessFAQ
- What is voyage-code-4 and what is it good for?
- voyage-code-4 is a code embedding model for code search and coding agents. Typical uses are code search, retrieval for coding agents, repository question answering and duplicate-code detection.
- What context window does voyage-code-4 have?
- It accepts up to 32K tokens per input.
- How much does voyage-code-4 cost?
- Pricing is usage-based at $0.12 per million input tokens. There is no fixed monthly fee. You pay only for what you use.
- How do I access voyage-code-4 from inside Iran?
- Create an account on Hormouz and generate an API key. Hormouz provides a stable path to the model from inside Iran, with no foreign credit card or circumvention tooling required.
- Is voyage-code-4 compatible with the OpenAI embeddings API?
- Yes. Call the /v1/embeddings endpoint on Hormouz with your Hormouz key, using the same request shape as the OpenAI SDK.
Updated 2026-10-13