Mistral's code embedding model over the direct Mistral API - vectors tuned for code search, retrieval for coding agents and duplicate detection. 1,536 dimensions by default, adjustable up to 3,072 with output_dimension. Billed on input tokens only.
Test this model instantly in the Console Playground โ no code required
Copy usage instructions for Claude, ChatGPT, or other AI
| Token Type | Credits | USD Equivalent |
|---|---|---|
| Input Tokens | 279 | $0.19 |
| Output Tokens | No charge โ billed on input tokens only | |
* 1,500 credits โ $1 (actual charges may vary based on usage)
curl -X POST "https://api.core.today/llm/mistral/v1/embeddings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer cdt_your_api_key" \
-d '{
"model": "codestral-embed-2505",
"input": [
"def add(a, b):\n return a + b",
"function add(a, b) { return a + b; }"
],
"output_dimension": 1024
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input | string | array | Yes | - | Code or text, or an array of them, to embed. Max 8,192 tokens per item. |
model | string | Yes | codestral-embed-2505 | Model identifier. The alias codestral-embed is accepted and pinned to codestral-embed-2505. |
output_dimension | integer | No | 1536 | Size of the returned vectors, up to 3,072. Note the name: the OpenAI-style `dimensions` field is rejected. |
output_dtype | string | No | float | Element type of the returned vectors. floatint8uint8binaryubinary |
Returns data[].embedding for each input, in order.
curl -X POST "https://api.core.today/llm/mistral/v1/embeddings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer cdt_your_api_key" \
-d '{
"model": "codestral-embed-2505",
"input": [
"def add(a, b):\n return a + b",
"function add(a, b) { return a + b; }"
],
"output_dimension": 1024
}'POST /llm/mistral/v1/embeddings