# Codestral Embed

> Codestral Embed is Mistral's embedding model for code and natural-language queries, built for code search and retrieval. It takes text input with an 8K-token context.

**ID**: `mistralai/codestral-embed`  
**Creator**: Mistral AI  
**Category**: embedding  
**Context**: 8K tokens  
**Pricing**: $0.15 / $0 per 1M · billed by your provider (BYOK)  
**Released**: 2025-05-28  
**Web page**: https://anyrouter.dev/model/mistralai/codestral-embed

**Input modalities**: text  
**Output modalities**: embeddings  

**Tokenizer**: Mistral

**Capabilities**: embedding

## Usage

**Endpoint**: `POST https://anyrouter.dev/api/v1/embeddings`

```bash
curl https://anyrouter.dev/api/v1/embeddings \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "mistralai/codestral-embed",
  "input": "The quick brown fox jumps over the lazy dog"
}'
```

Pass `input` as a string or an array of strings to embed a batch in one call.

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| mistral-byok | $0.15/M (list) | $0 (list) |

BYOK routes are billed by your own provider key — AnyRouter charges $0. Rates marked (list) are the provider's published list price.

## Source

- Upstream docs: https://docs.mistral.ai/models/codestral-embed-25-05
