Mistral AI · embedding model

Codestral Embed API

Code-specialised embedding model (1536 dimensions).

Call Codestral Embed through Nicrron with one API key, next to every other model in the catalog. Use the model id mistral/codestral-embed with any OpenAI SDK.

Pricing

Codestral Embed costs $0.15 per million input tokens. That is the provider's list price. Requests paid from credit add a 5% platform fee; with your own provider key, the provider bills you and Nicrron charges 5% of the list price. No subscription: add credit and pay for what you use.

Call Codestral Embed

cURL
curl https://api.nicrron.ai/v1/embeddings \
  -H "Authorization: Bearer $NICRRON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistral/codestral-embed",
    "input": ["The quick brown fox", "Semantic search with Nicrron"]
  }'
Python (OpenAI SDK)
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.nicrron.ai/v1",
    api_key=os.environ["NICRRON_API_KEY"],
)

out = client.embeddings.create(
    model="mistral/codestral-embed",
    input=["The quick brown fox", "Semantic search with Nicrron"],
)
print(len(out.data[0].embedding))

New to Nicrron? The quickstart takes two minutes.

Questions

How much does the Codestral Embed API cost?
On Nicrron, Codestral Embed costs $0.15 per million input tokens, the provider's list price. Requests paid from credit add a 5% platform fee. There is no subscription: you add credit and pay for what you use.
What is the context window of Codestral Embed?
Codestral Embed takes up to 8,192 tokens (8k) of context.
How do I call Codestral Embed through an API?
Point any OpenAI SDK at https://api.nicrron.ai/v1, use a Nicrron API key, and set the model to "mistral/codestral-embed". The endpoint is /v1/embeddings.
Who makes Codestral Embed?
Codestral Embed is a embedding model made by Mistral AI. Nicrron gives you it and every other model in the catalog through one API key and one bill.