{"slug":"best-code-embedding-apis-for-repository-search","title":"Best code embedding APIs for repository search","question":"What are the best code embedding APIs for repository search in 2026?","verdict":"As of 2026-08-10, ChatGPT, Claude, Gemini and Grok collectively rank Voyage Code 3 #1 for code embedding apis for repository search on ModelsAgree by aggregate score. The models' case: Purpose-built for code retrieval and consistently at or near the top of code-search benchmarks. The models' main caveat: Commercial hosted API only with no self-host or open weights, and now tied to MongoDB's roadmap — a non-starter for air-gapped or fully on-prem code. The strongest alternative is Codestral Embed — Best overall for chunked repository search: excellent real-world issue-to-file retrieval, flexible dimensions and int8 output, and strong value at. Not unanimous: ChatGPT picks Codestral Embed. Source: https://modelsagree.com/best/best-code-embedding-apis-for-repository-search (modelsagree.com, CC BY 4.0).","category":"AI Infra","url":"https://modelsagree.com/best/best-code-embedding-apis-for-repository-search","updated":"2026-08-10","models":["ChatGPT","Claude","Gemini","Grok"],"consensus":"3 of 4 models rank Voyage Code 3 the top pick","disagreement":"ChatGPT picks Codestral Embed","combined":[{"rank":1,"product":"Voyage Code 3","domain":null,"score":19,"appearances":4,"modelRanks":{"ChatGPT":2,"Claude":1,"Gemini":1,"Grok":1},"reason":"Purpose-built for code retrieval and consistently at or near the top of code-search benchmarks; long context, Matryoshka-style adjustable dimensions and int8/binary quantization let you trade recall for index cost, which matters at whole-repo scale; mature reranker pairing (rerank-2) and clean API. Near-tie with Codestral Embed at the top."},{"rank":2,"product":"Codestral Embed","domain":null,"score":13,"appearances":3,"modelRanks":{"ChatGPT":1,"Claude":2,"Grok":2},"reason":"Best overall for chunked repository search: excellent real-world issue-to-file retrieval, flexible dimensions and int8 output, and strong value at $0.15/M tokens; narrowly beats Voyage assuming normal code-aware chunking."},{"rank":3,"product":"Jina Code Embeddings 1.5B","domain":null,"score":5,"appearances":2,"modelRanks":{"ChatGPT":3,"Grok":4},"reason":"Essentially tied with Voyage across a broad 25-benchmark code suite, with 32K context, task-specific query/document modes, multilingual and cross-language search, Matryoshka dimensions, and hosted or self-deployed paths."},{"rank":4,"product":"OpenAI text-embedding-3-large","domain":"openai.com","score":4,"appearances":2,"modelRanks":{"Claude":4,"Gemini":4},"reason":"Not code-specialized but a dependable, ubiquitous default — good enough retrieval on mixed code+doc corpora, dimension shortening, and the widest ecosystem/vendor-DB integration, making it the lowest-friction path to a working repo search."},{"rank":5,"product":"BGE-M3","domain":"baai.ac.cn","score":4,"appearances":1,"modelRanks":{"Gemini":2},"reason":"Best open-source option for repository search because it natively combines dense, sparse, and multi-vector retrieval for unmatched exact symbol and function name matching. Assumes team can host local vector pipelines."},{"rank":6,"product":"Nomic Embed Code","domain":null,"score":3,"appearances":2,"modelRanks":{"ChatGPT":4,"Claude":5},"reason":"Strong CodeSearchNet results, fully released weights, training data and evaluation code under Apache 2.0, and excellent control for teams willing to deploy their own embedding endpoint."},{"rank":7,"product":"Jina Embeddings v2 Base Code","domain":null,"score":3,"appearances":1,"modelRanks":{"Gemini":3},"reason":"Dedicated open-weights code embedding model with 8k context support and explicit task instruction-tuning for high retrieval precision at low hosting cost. Near-tie with text-embedding-3-large on general repository RAG."},{"rank":8,"product":"Qodo Embed 1","domain":null,"score":3,"appearances":1,"modelRanks":{"Claude":3},"reason":"Open-weight, code-first model that punches above its parameter count on code retrieval, so you can self-host, fine-tune, and keep source private while getting near-frontier quality; sensible small (1.5B-class) footprint."},{"rank":9,"product":"ZeroEntropy zembed-1","domain":null,"score":3,"appearances":1,"modelRanks":{"Grok":3},"reason":"Tops recent code NDCG@10 benches while remaining competitive or leading across other domains; 32k context, asymmetric query/document modes, highly flexible dims (down to 40); available as managed API plus open weights for hybrid use."},{"rank":10,"product":"Cohere Embed v3","domain":null,"score":1,"appearances":1,"modelRanks":{"Gemini":5},"reason":"Provides dedicated searchcode input type tuning that improves intent alignment between developer queries and repository chunks within enterprise RAG systems."},{"rank":11,"product":"Google Gemini Embedding 2","domain":"ai.google.dev","score":1,"appearances":1,"modelRanks":{"ChatGPT":5},"reason":"A practical managed fallback with an 8K context, flexible 128–3072 dimensions, batch pricing, broad language coverage, and straightforward Gemini or Vertex AI integration."}],"perModel":{"ChatGPT":[{"rank":1,"product":"Codestral Embed","reason":"Best overall for chunked repository search: excellent real-world issue-to-file retrieval, flexible dimensions and int8 output, and strong value at $0.15/M tokens; narrowly beats Voyage assuming normal code-aware chunking.","fix":"Its 8K context and closed weights make it a poor fit for whole-file embedding or self-hosting without an enterprise arrangement."},{"rank":2,"product":"Voyage Code 3","reason":"Near-tie for first, with consistently elite code-retrieval quality, a 32K context window, flexible 256–2048 dimensions, mature API, and a generous 200M-token free allowance.","fix":"At $0.18/M tokens, it costs more than Codestral while lacking a clear quality advantage on repository issue-to-file retrieval."},{"rank":3,"product":"Jina Code Embeddings 1.5B","reason":"Essentially tied with Voyage across a broad 25-benchmark code suite, with 32K context, task-specific query/document modes, multilingual and cross-language search, Matryoshka dimensions, and hosted or self-deployed paths.","fix":"The CC-BY-NC license restricts commercial self-hosting unless separately licensed."},{"rank":4,"product":"Nomic Embed Code","reason":"Strong CodeSearchNet results, fully released weights, training data and evaluation code under Apache 2.0, and excellent control for teams willing to deploy their own embedding endpoint.","fix":"The 7B model is costly to serve and officially targets only six programming languages."},{"rank":5,"product":"Google Gemini Embedding 2","reason":"A practical managed fallback with an 8K context, flexible 128–3072 dimensions, batch pricing, broad language coverage, and straightforward Gemini or Vertex AI integration.","fix":"It is general-purpose rather than code-specialized, with weaker public evidence on repository-level retrieval than the four leaders."}],"Claude":[{"rank":1,"product":"Voyage Code 3","reason":"Purpose-built for code retrieval and consistently at or near the top of code-search benchmarks; long context, Matryoshka-style adjustable dimensions and int8/binary quantization let you trade recall for index cost, which matters at whole-repo scale; mature reranker pairing (rerank-2) and clean API. Near-tie with Codestral Embed at the top.","fix":"Commercial hosted API only with no self-host or open weights, and now tied to MongoDB's roadmap — a non-starter for air-gapped or fully on-prem code that can't leave the building."},{"rank":2,"product":"Codestral Embed","reason":"Code-specialized embedding from a strong code-model lineage, competitive with or ahead of voyage-code-3 on several code-retrieval evals, with configurable output dimension and precision for cost/quality tuning; benefits from Mistral's broader code tooling ecosystem. Near-tie with #1.","fix":"Newer with a shorter production track record and API-only access; less third-party tooling/integration battle-testing than the incumbents."},{"rank":3,"product":"Qodo Embed 1","reason":"Open-weight, code-first model that punches above its parameter count on code retrieval, so you can self-host, fine-tune, and keep source private while getting near-frontier quality; sensible small (1.5B-class) footprint.","fix":"You own the serving infrastructure, GPU capacity, and eval work — no managed SLA, batching, or reranker bundled in, so it's not for teams that want a turnkey endpoint."},{"rank":4,"product":"OpenAI text-embedding-3-large","reason":"Not code-specialized but a dependable, ubiquitous default — good enough retrieval on mixed code+doc corpora, dimension shortening, and the widest ecosystem/vendor-DB integration, making it the lowest-friction path to a working repo search.","fix":"A general-purpose model that measurably trails dedicated code embedders on pure code-to-code and NL-to-code retrieval; the wrong pick if search quality on code specifically is the priority."},{"rank":5,"product":"Nomic Embed Code","reason":"Fully open, code-specialized weights with transparent training and an easy local/self-host story; a credible privacy-preserving option when data residency rules out hosted APIs and you want something purpose-built for code rather than a generic open model.","fix":"Smaller ecosystem and generally a step behind the top commercial code models on quality; you still carry all the serving/ops burden."}],"Gemini":[{"rank":1,"product":"Voyage Code 3","reason":"Top-tier code retrieval accuracy specifically fine-tuned for syntax, function call graphs, and technical documentation, featuring a large context window to ingest entire modules. Assumes cloud API usage is permitted.","fix":"Closed-source proprietary API with no self-hostable open weights, making it unsuitable for air-gapped or strict zero-data-retention environments."},{"rank":2,"product":"BGE-M3","reason":"Best open-source option for repository search because it natively combines dense, sparse, and multi-vector retrieval for unmatched exact symbol and function name matching. Assumes team can host local vector pipelines.","fix":"Significant infrastructure complexity and storage footprint required to serve multi-vector representations at scale compared to single-vector APIs."},{"rank":3,"product":"Jina Embeddings v2 Base Code","reason":"Dedicated open-weights code embedding model with 8k context support and explicit task instruction-tuning for high retrieval precision at low hosting cost. Near-tie with text-embedding-3-large on general repository RAG.","fix":"Reduced model capacity compared to large proprietary endpoints, leading to occasional degradation on complex cross-file architectural reasoning."},{"rank":4,"product":"OpenAI text-embedding-3-large","reason":"Ubiquitous ecosystem integration, high semantic strength across mixed text/code docs, and Matryoshka dimension shortening to optimize vector storage costs.","fix":"General-purpose text focus causes lower precision on fine-grained syntax and exact symbol lookups compared to dedicated code models."},{"rank":5,"product":"Cohere Embed v3","reason":"Provides dedicated searchcode input type tuning that improves intent alignment between developer queries and repository chunks within enterprise RAG systems.","fix":"Fully proprietary API model subject to per-token pricing without open-weights deployment flexibility for custom codebases."}],"Grok":[{"rank":1,"product":"Voyage Code 3","reason":"Specialized code retrieval model with consistent double-digit gains over general embeddings on large suites of code datasets (functions, docs, real repos); 32k context, Matryoshka dims + quantization for practical large-repo indexing cost/storage; proven in production code RAG/agents. Assumption: practitioner prioritizes measurable retrieval quality on actual code over pure price.","fix":"Highest per-token cost among specialists; overkill (and expensive) for tiny repos or pure keyword needs."},{"rank":2,"product":"Codestral Embed","reason":"Purpose-built code embedder that beats prior SOTA (including voyage-code-3 and OpenAI large) on SWE-Bench-style real GitHub issue/fix retrieval and Text2Code tasks; flexible output dims/precision down to 256/int8 while retaining lead; strong for agentic repo search.","fix":"Newer specialist with thinner independent long-term production track record outside Mistral ecosystem."},{"rank":3,"product":"ZeroEntropy zembed-1","reason":"Tops recent code NDCG@10 benches while remaining competitive or leading across other domains; 32k context, asymmetric query/document modes, highly flexible dims (down to 40); available as managed API plus open weights for hybrid use.","fix":"Newer entrant whose strongest numbers come from vendor-curated evals; less battle-tested at massive multi-repo scale than Voyage."},{"rank":4,"product":"Jina Code Embeddings 1.5B","reason":"Compact yet SOTA-competitive on 25+ code retrieval tasks","fix":null}]},"missedByModel":{"ChatGPT":[{"product":"OpenAI text-embedding-3-large","reason":"easy, mature API but materially behind specialized code models and unchanged since 2024"},{"product":"Cohere Embed 4","reason":"excellent long-context enterprise retrieval, but its multimodal strengths add little to source-code search and Codestral beats it on code-focused evaluations"}],"Claude":[{"product":"Google gemini-embedding-001","reason":"very strong general embedder with long context and a solid managed API, but not code-specialized, so it loses to dedicated code models on pure repo retrieval"}],"Gemini":[{"product":"CodeSage-Large","reason":"strong benchmark results for code understanding but lacks turnkey API infrastructure and deployment tooling"},{"product":"Nomic Embed Code","reason":"fully open and auditable model, but trails BGE-M3 and Voyage on complex multi-language retrieval benchmarks"}]}}