# Mistral API

CreateWithAI Hub page: https://createwithaihub.com/apis-sdks/mistral-api
Latest version of this file: https://createwithaihub.com/apis-sdks/mistral-api.md

- Type: API / SDK · Category: APIs & SDKs
- Publisher: Mistral AI
- Pricing: Paid
- Runs on: API (cloud)

Mistral AI's pay-as-you-go API for chat, code completion, OCR, embeddings, audio and agents, with Python and TypeScript SDKs.

The Mistral API at api.mistral.ai serves Mistral's models through chat completions, Responses, fill-in-the-middle code completion, embeddings, classifiers, OCR, audio transcription and speech, batch and realtime endpoints, with Agents, Conversations and Libraries in beta. Keys and usage are managed in Mistral Studio, Mistral's platform for building and deploying AI apps and agents (older pages called it La Plateforme). Official SDKs are available for Python and TypeScript, and billing is pay-as-you-go per token, page or minute; for example, Mistral Large 4 costs $0.70 per 1M input tokens and $2.10 per 1M output tokens.

Useful for: Extracting text and tables from scanned PDFs with the OCR endpoint, or adding a European-hosted chat model to an app.

## Key features

- Chat completions and Responses endpoints
- Fill-in-the-middle (FIM) endpoint for code completion with Codestral
- OCR endpoint priced per 1,000 pages
- Embeddings, classifiers, audio transcription and speech
- Batch API at 50% off standard prices
- Official Python (mistralai) and TypeScript SDKs, Apache-2.0

## Connection

- Modality: Text, Image, Audio, Multimodal
- SDK language: Python, TypeScript / JS

## Before you start

- Mistral Studio account with billing activated
- API key

## Install steps from the official documentation

Python SDK:

```
pip install mistralai
```

TypeScript SDK:

```
npm add @mistralai/mistralai
```

## Limitations

- No free API access: the free mode covers trying Vibe and Studio only, and API keys require billing activation
- Agents, Conversations and Libraries endpoints are still in beta
- Rate limits are shown only in the admin panel, not in public docs

## Official links

- Website: https://mistral.ai/products/studio
- Source repository: https://github.com/mistralai/client-python
- Documentation: https://docs.mistral.ai
- Source: https://docs.mistral.ai/api (Base URL api.mistral.ai, endpoint list including beta and deprecated sections)
- Source: https://mistral.ai/products/studio (Mistral Studio: platform to build, deploy and govern AI apps and agents)
- Source: https://docs.mistral.ai/admin/billing-usage/usage-limits (Free mode does not include API access; API requires billing activation and pay-as-you-go)
- Source: https://docs.mistral.ai/inference/pricing (Per-model token prices, OCR per 1,000 pages)
- Source: https://mistral.ai/pricing (Pay-as-you-go plans; batch processing 50% off; cached-input discounts; Free plan includes Mistral Studio access)
- Source: https://github.com/mistralai/client-python (pip install mistralai; Apache-2.0)
- Source: https://github.com/mistralai/client-ts (npm add @mistralai/mistralai; Apache-2.0)
- Source: https://docs.mistral.ai/models/mistral-large-4-0 (Mistral Large 4 (v26.10): $0.7 input / $0.07 cached / $2.1 output per 1M, 1M context)
- Source: https://mistral.ai/news/mistral-large-4-oss/ (Mistral Large 4 announcement with $0.70 / $2.10 pricing)
