Skip to main content

mistral/codestral-embed/embedding

Mistral AI Codestral Embed encodes source files, diffs, and engineering queries into 1,536-dimensional vectors for codebase retrieval.

From $0.00015/1,000 tokens

Workbench

Input

Embedding
Pass a single string, a batch of up to 128 strings, or token ID arrays for Codestral Embed; each returned vector keeps its input index.
Safety checkerOff

SpicyAPI does not run a safety checker on this model. Your prompt and media go to the model as written, and the model itself decides what comes back.

Checking your account before enabling submission and pricing.

1 required field missing: Embedding Input

Output

Ready for a new run

Your result will appear here.

Configure the inputs, review the estimate, then run the model.

Missing the model you need?

Mistral AI Codestral Embed encodes source files, diffs, and engineering queries into 1,536-dimensional vectors for codebase retrieval.

Key numbers

Dimensions
1536
Codestral Embed returns 1536-dimensional floating-point vectors in float format and bills by measured input tokens across the batch.
Batch ceiling
128
128 items · 300K tokens

Token budget

Input window
300,000
tokens in one request

Before you spend

Embedding

Codestral Embed accepts up to 128 items per request and at most 300,000 tokens in total; token ID arrays are capped at 2,048 entries.

What it does

Dense 1536-dimensional representations

Codestral Embed from Mistral AI outputs floating-point vectors of 1536 dimensions ready for cosine similarity search, clustering, and reranking pipelines.

Single-text or homogeneous batch requests

Send Codestral Embed one passage or a batch of up to 128 strings or token arrays synchronously, preserving each vector's original input index.

Where it fits

  • Semantic search and RAG indexing

    Index knowledge bases and technical collections with Codestral Embed to retrieve relevant passages before passing context to a generation model.

  • Clustering and duplicate detection

    Compare 1536-dimensional vectors from Codestral Embed to group similar tickets, articles, or code snippets.

Model reference

Codestral Embed API reference

Codestral Embed API specifications

Dimensions
1536
Batch limits
128 items · 300K tokens

How to call the Codestral Embed API

  1. Prompt guide & Pro tips

    Use Codestral Embed for both document indexing and query embedding, keeping each Codestral Embed call within 128 items and 300,000 tokens and re-embedding when text changes.

Codestral Embed API questions