M

Mistral AI API

by Mistral AI

Mistral AI offers frontier open and commercial models via REST API. Mistral Large 2 rivals top closed models; Codestral specializes in code generation; Mistral Embed handles semantic search. The API is OpenAI-compatible — simply change the base URL and model name.

mistral-large-2codestralopenai-compatiblefunction-calling

Quick Reference

Base URL https://api.mistral.ai/v1 Auth type Bearer Token Auth header Authorization: Bearer ... Rate limit 1 request/s · 500,000 TPM Pricing from $0.10/mo Free quota Experimental models free during preview Documentation https://docs.mistral.ai Endpoint status Server online — HTTP 404 — server is online but path returned an error (may require auth)259ms (checked Mar 29, 2026) Builder score C 63% builder-friendly
Pricing
75
Latency
45
Depth
67

Authentication

Standard Bearer token authentication using your Mistral API key.

Authorization: Bearer ...

Pricing

Model pay-as-you-go Starting price from $0.10/mo Free quota Experimental models free during preview

Mistral Medium 3: $0.40/M input, $2.00/M output. Mistral Small 3.1: $0.03/M input, $0.11/M output. Mistral Nemo: $0.02/M. Codestral: $0.20/M input, $0.60/M output. Mistral Large 2: $2.00/M input, $6.00/M output. Free experiment plan available.

Key Endpoints

MethodPathDescription
POST /chat/completions OpenAI-compatible chat completions
POST /embeddings Generate text embeddings
POST /fim/completions Fill-in-the-middle for code (Codestral)
GET /models List available models

Sample Request

curl https://api.mistral.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MISTRAL_API_KEY" \
  -d '{
    "model": "mistral-large-latest",
    "messages": [{"role": "user", "content": "Write a haiku about APIs."}]
  }'

Sample Response

{
  "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
  "object": "chat.completion",
  "model": "mistral-large-latest",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Keys unlock the gate / Data flows through silent paths / Endpoints never sleep"
    },
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 15, "completion_tokens": 18}
}

Data sourced from API Map. Always verify pricing and rate limits against the official Mistral AI documentation.