{
 "kind": "api",
 "slug": "mistral-api",
 "path": "apis/mistral-api/",
 "name": "Mistral AI API",
 "logo": "https://agentgid.com/media/avatars/mistralai.png",
 "maker": "Mistral AI",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Model hosting and inference",
   "apis/inference/"
  ]
 ],
 "lead": "French AI models for text, documents and code.",
 "chips": [
  {
   "label": "Model hosting and inference",
   "path": "apis/inference/"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Add Mistral to my app on the server: install mistralai (V2+, import from mistralai.client), read MISTRAL_API_KEY from .env, use mistral-small-latest, retry 429 with backoff, and never send the key to the browser."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://mistral.ai"
  },
  {
   "label": "Pricing",
   "href": "https://mistral.ai/pricing"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/mistralai/client-ts"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Paid",
   "status": "info",
   "sub": "from $0.5 per million input tokens",
   "quote": null,
   "note": "No free tier on the pricing page. As reported on the official pricing page, checked Oct 22, 2026.",
   "src": "https://mistral.ai/pricing"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "Allowed",
   "status": "yes",
   "sub": null,
   "quote": "Mistral AI hereby assigns to Customer all right, title, and interest, if any, in and to Output that Mistral AI may have.",
   "note": "Allowed on a paid account under the commercial terms; you own the output. Data: opt-out; API data can improve Mistral's services unless an admin turns the toggle off.",
   "src": "https://legal.mistral.ai/terms/commercial-terms-of-service/"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var MISTRAL_API_KEY",
   "quote": "Browser clients cannot store long-lived API keys safely and cannot set Authorization headers on WebSocket connections.",
   "note": "API key sent as Authorization: Bearer",
   "src": "https://docs.mistral.ai/studio/audio/deprecated/speech_to_text/realtime_transcription/client_auth.md"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "info",
   "sub": "llms.txt · OpenAPI · SDK",
   "quote": "It exposes your workspace as MCP tools and authenticates each request with your Mistral API key.",
   "note": " Our agent check: 4 of 6 (Nov 13, 2026).",
   "src": "https://docs.mistral.ai/resources/mcp.md"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 22, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Mistral AI API does",
   "parts": [
    {
     "t": "prose",
     "text": "The Mistral AI API lets your app send text, images or documents to Mistral's AI models and get answers back. It covers chat, reading scanned documents, turning text into searchable numbers, speech and code. You pay per amount of text processed, after adding a payment method; the free plan does not include the API."
    },
    {
     "t": "list",
     "items": [
      "Mistral AI API is one of 41 APIs in the Model hosting and inference category on AgentGid.",
      "It is not among the 13 that can be started for free.",
      "6 of them ship an official MCP server; Mistral AI API does not.",
      "Its official SDK is the 3rd most downloaded in the category (10.2M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Answers and summaries in your app",
       "text": "Add a chat box, a \"summarise this\" button or automatic replies, using a small model that costs little per message.",
       "idea": false
      },
      {
       "title": "Turn emails into tidy records",
       "text": "Pull the customer, topic and priority out of a support email straight into the fields of your helpdesk.",
       "idea": false
      },
      {
       "title": "Read scanned documents and PDFs",
       "text": "Turn invoices, contracts or scanned pages into text and tables your app can search and store.",
       "idea": false
      },
      {
       "title": "Search help articles by meaning",
       "text": "Find the help article closest to a question, even when it uses other words, such as \"money back\" for a refund policy.",
       "idea": false
      },
      {
       "title": "Process a large pile overnight",
       "text": "Send thousands of texts as one batch job when you do not need instant answers, at half the price.",
       "idea": false
      },
      {
       "title": "Switch from OpenAI with small changes",
       "text": "Move an existing chatbot to Mistral by changing the client, the setup line and the model name.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Mistral AI API popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "10.1M",
       "l": "SDK downloads a week",
       "d": "-12.8% on the 4-week average",
       "up": false
      },
      {
       "n": "206",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "161",
       "l": "GitHub stars, mistralai/client-ts"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "None"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "e.g. Mistral Large $0.5 per million input tokens, $1.5 per million output; batch processing 50% off"
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "1 million input tokens, Mistral Small 4",
       "$0.15"
      ],
      [
       "1 million output tokens, Mistral Small 4",
       "$0.6"
      ],
      [
       "1 million input tokens, Mistral Large 4",
       "$0.7"
      ],
      [
       "1,000 pages read with OCR 4.1",
       "$4"
      ],
      [
       "1 million tokens turned into embeddings (Mistral Embed)",
       "$0.1"
      ]
     ]
    },
    {
     "t": "more",
     "items": [
      {
       "title": "Price history",
       "items": [
        "A year of the pricing page in the Internet Archive (7 months): the lowest monthly figure went from $14.99 (2025-10) to $5.99 (2026-11).",
        "2026-06: lowest $/month figure $14.99 → $5.99; new figures $5.99/mo",
        "2026-07: no longer shown $50/mo",
        "2026-08: new figures $50/mo",
        "2026-09: new figures $10/mo, $15/mo, $30/mo"
       ]
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 22, 2026. Prices change: confirm before you buy.",
     "link": "mistral.ai/pricing",
     "href": "https://mistral.ai/pricing"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "All",
       "v": "Tokens per minute and requests per second per model, shown in the Admin Panel; higher limits through support",
       "src": "https://docs.mistral.ai/admin/billing-usage/usage-limits.md"
      },
      {
       "l": "All",
       "v": "Monthly spending limit per Organization and per Workspace",
       "src": "https://docs.mistral.ai/admin/billing-usage/usage-limits.md"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "docs.mistral.ai/admin/billing-usage/usage-limits.md",
     "href": "https://docs.mistral.ai/admin/billing-usage/usage-limits.md"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "API key sent as Authorization: Bearer"
      },
      {
       "l": "Environment variable",
       "v": "MISTRAL_API_KEY",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "Yes"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Create a Mistral account and activate billing with a payment method and prepaid credit. Nothing in code; the API works only after this.",
      "Create an API key in Studio with an expiration date and copy it into .env. Read MISTRAL_API_KEY on the server; the SDK reads that variable name.",
      "Decide on training use; an admin can switch off API data training in the Admin Panel Privacy menu. Note the choice in the project README.",
      "Set a monthly spending limit for the Organization or Workspace. Handle 402 errors by telling the person billing needs attention."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "You pay per use, and you own what the models produce for you. Several models are also released as open weights, many under Apache 2.0, so you can run them yourself."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "Yes",
       "status": "yes",
       "sub": "Allowed on a paid account under the commercial terms; you own the output.",
       "quote": "Mistral AI hereby assigns to Customer all right, title, and interest, if any, in and to Output that Mistral AI may have.",
       "src": "https://legal.mistral.ai/terms/commercial-terms-of-service/"
      },
      {
       "l": "To train your own AI",
       "v": "With conditions",
       "status": "cond",
       "sub": "Text output is yours; image output may not be used to train an image generator that competes with Mistral.",
       "quote": "Customer may not use image Outputs to develop or train any image generation product that competes with a Mistral AI product.",
       "src": "https://legal.mistral.ai/terms/commercial-terms-of-service/"
      },
      {
       "l": "inside-app-bundle",
       "v": "With conditions",
       "status": "cond",
       "sub": "Only open-weight models can ship with your app, under each model's license (Apache 2.0 for Mistral Small 4, the Mistral open-weight license for Large 4); API models stay online.",
       "quote": "Mistral Large 4 mistral-large-4 Open, Generalist",
       "src": "https://docs.mistral.ai/inference/model-selection-guide.md"
      },
      {
       "l": "Trains on what you send",
       "v": "opt-out; API data can improve Mistral's services unless an admin turns the toggle off.",
       "quote": "Customers retain full control over this processing and have the right to opt out at any time.",
       "src": "https://help.mistral.ai/en/articles/455207-can-i-opt-out-of-my-input-or-output-data-being-used-for-training"
      },
      {
       "l": "Keeps your data",
       "v": "Zero data retention is available on paid plans for supported stateless calls, on request; Mistral may approve or deny it.",
       "quote": "ZDR is available on paid plans for supported stateless API calls.",
       "src": "https://docs.mistral.ai/admin/monitor-comply/zero-data-retention.md"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "401",
       "v": "The API key is missing, invalid, or expired",
       "sub": "Check the key in Studio and the header format Authorization Bearer."
      },
      {
       "l": "402",
       "v": "Billing blocks the request (no credit left, spending limit reached, failed payment)",
       "sub": "Ask the person to top up credit or raise the spending limit."
      },
      {
       "l": "422",
       "v": "Valid JSON but a wrong parameter value",
       "sub": "Read the field-level errors in the response body and fix the request."
      },
      {
       "l": "429",
       "v": "Rate limit for your tier exceeded",
       "sub": "Retry with exponential backoff and respect the Retry-After header; use batch jobs for large volumes."
      },
      {
       "l": "503",
       "v": "Service overloaded or under maintenance",
       "sub": "Retry with exponential backoff and check status.mistral.ai."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "4 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "Mistral MCP server (hosted)",
       "sub": "claude mcp add --transport http mistral https://api.mistral.ai/mcp \\\n  --header 'Authorization: Bearer ${MISTRAL_API_KEY}'"
      },
      {
       "l": "npm",
       "v": "npm install @mistralai/mistralai",
       "code": true
      },
      {
       "l": "PyPI",
       "v": "pip install mistralai",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Mistral AI API",
       "me": true,
       "facts": [
        "from $0.5 per million input tokens",
        "No free tier"
       ]
      },
      {
       "name": "OpenAI API",
       "why": "Pick the OpenAI API for GPT models with text, vision, tool calling and agents, priced per 1M tokens.",
       "path": "apis/openai-api/",
       "facts": [
        "from $0.1",
        "No free tier"
       ]
      },
      {
       "name": "Gemini API",
       "why": "Pick the Gemini API when you want a free tier and text, image, audio and video input.",
       "path": "apis/google-gemini-api/",
       "facts": [
        "Free plan",
        "Free tier"
       ]
      },
      {
       "name": "Groq (LLM inference)",
       "why": "Pick Groq for fast inference of open models such as GPT-OSS and Llama, priced per 1M tokens.",
       "path": "apis/groq/",
       "facts": [
        "from $0.075",
        "No free tier"
       ]
      }
     ],
     "more": "All model hosting and inference APIs",
     "more_path": "apis/inference/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Add Mistral to my app on the server: install mistralai (V2+, import from mistralai.client), read MISTRAL_API_KEY from .env, use mistral-small-latest, retry 429 with backoff, and never send the key to the browser."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create a Mistral account, activate billing with a payment method, then create an API key in Studio; the key is shown only once.",
       "code": null,
       "src": "https://docs.mistral.ai/getting-started/quickstarts/studio/activate-and-generate-api-key.md"
      },
      {
       "text": "Store the key in the MISTRAL_API_KEY variable and install the official package.",
       "code": "export MISTRAL_API_KEY=\"your-api-key\"\nuv add mistralai",
       "src": "https://docs.mistral.ai/getting-started/quickstarts/studio/activate-and-generate-api-key.md"
      },
      {
       "text": "Send a first chat request (the Python example is in the first use above).",
       "code": "curl https://api.mistral.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $MISTRAL_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"mistral-small-latest\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello, Mistral!\"}]\n  }'",
       "src": "https://docs.mistral.ai/getting-started/quickstarts/studio/activate-and-generate-api-key.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "curl https://api.mistral.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $MISTRAL_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"mistral-small-latest\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello, Mistral!\"}]\n  }'",
       "intro": null
      },
      {
       "tab": "Response",
       "code": "{\n  \"object\": \"chat.completion\",\n  \"model\": \"mistral-small-latest\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"finish_reason\": \"stop\",\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Hello! How can I assist you today?\"\n      }\n    }\n  ]\n}"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "from mistralai import Mistral",
       "fix": "from mistralai.client import Mistral",
       "why": "The import path changed in SDK version 2; with mistralai 3.7.0 the old import fails with ImportError (our local check)."
      },
      {
       "dont": "Putting MISTRAL_API_KEY in browser code to call the API directly",
       "fix": "Call Mistral from your server; for browser realtime transcription mint short-lived rt_ tokens on the server",
       "why": "Browsers cannot keep long-lived keys safe."
      },
      {
       "dont": "Retrying a 401, 402 or 422 in a loop",
       "fix": "Retry only 429 and 5xx with exponential backoff; fix the key, billing or request for other errors",
       "why": "The docs list only 429, 500, 502, 503 and 504 as transient."
      },
      {
       "dont": "Hard-coding a dated model name like mistral-large-2512 and forgetting it",
       "fix": "Check the models page for status and retirement dates, and move to the replacement in time",
       "why": "Mistral Large 3 (mistral-large-2512) is deprecated, with Mistral Large 4 as its replacement."
      },
      {
       "dont": "Sending a private PDF link to OCR",
       "fix": "Use a public URL, a Base64-encoded PDF, or upload the file",
       "why": "The OCR service has to fetch the document itself."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is there a free tier for the API?",
       "a": "No. The free plan does not include API access; creating keys and calling the API need billing activation and pay-as-you-go.",
       "evidence": {
        "url": "https://docs.mistral.ai/admin/billing-usage/usage-limits.md",
        "quote": "It doesn't include API access. Creating API keys and using the API require billing activation and pay-as-you-go."
       }
      },
      {
       "q": "Who owns the text the models write for me?",
       "a": "You do. The commercial terms say the customer owns all output.",
       "evidence": {
        "url": "https://legal.mistral.ai/terms/commercial-terms-of-service/",
        "quote": "Customer (i) retains all ownership rights in Customer Data and (ii) owns all Output."
       }
      },
      {
       "q": "Can I keep my prompts out of model training?",
       "a": "Yes. An admin turns off the anonymous improvement data toggle in the Admin Panel's Privacy menu.",
       "evidence": {
        "url": "https://help.mistral.ai/en/articles/455207-can-i-opt-out-of-my-input-or-output-data-being-used-for-training",
        "quote": "disable the toggle to prevent API calls and related data from being used to improve Mistral's services."
       }
      },
      {
       "q": "Is it hard to move from OpenAI?",
       "a": "Usually not. The chat request has the same structure, so you change the client import, the setup call and the model name.",
       "evidence": {
        "url": "https://docs.mistral.ai/resources/migration-guides.md",
        "quote": "For most applications, migration requires changing three things: the client import, the initialization call, and the model name."
       }
      },
      {
       "q": "Which languages have official packages?",
       "a": "Python and TypeScript.",
       "evidence": {
        "url": "https://docs.mistral.ai/getting-started/clients.md",
        "quote": "We provide official SDK clients in both Python and Typescript, you can also find third-party non-official SDKs in other languages."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "Mistral AI"
  ],
  [
   "Category",
   "Model hosting and inference"
  ],
  [
   "Price",
   "from $0.5 per million input tokens"
  ],
  [
   "Official SDK",
   "npm @mistralai/mistralai, PyPI mistralai"
  ],
  [
   "Latest SDK",
   "3.7.0 on npm"
  ],
  [
   "Agent check",
   "4 of 6"
  ],
  [
   "Pricing checked",
   "Oct 22, 2026"
  ]
 ],
 "good": [
  "The free plan covers trying Le Chat and Studio but not the API; using the API needs billing turned on and prepaid credit.",
  "By default your API calls may be used to improve Mistral's models; an admin can turn this off in the Privacy menu.",
  "If the monthly spending limit is reached, API access can stop until the next month or until an admin raises the limit."
 ],
 "checked_line": "Read by AgentGid from 28 official pages, card checked Nov 10, 2026; usage numbers update daily."
}