canonical: https://jentic.com/apis/mistral.ai/mistral

# Mistral AI API

Jentic publishes the only available OpenAPI specification for Mistral AI API, keeping it validated and agent-ready. The Mistral AI API exposes Mistral's open-weight and proprietary models for chat completion, fill-in-the-middle code generation, embeddings, content classifiers, OCR, agent and conversation orchestration, batch inference, and fine-tuning. It covers 71 endpoints across La Plateforme, including model listing, conversation memory, agent creation, file uploads for training and OCR, and asynchronous batch jobs for high-throughput workloads.

## For AI agents

Generate text, embeddings, OCR, and classifications using Mistral models, and orchestrate stateful conversations and agents on La Plateforme. Supports fine-tuning, batch inference, and file uploads.

## Scope

Does not handle image generation, speech synthesis, or video - use for Mistral text, embeddings, OCR, and classifier workloads only.

## Capabilities

- Generate chat completions with Mistral Large, Small, and Codestral models
- Create embeddings for semantic search and retrieval pipelines
- Run OCR jobs to extract structured text from PDFs and images
- Build stateful conversations and persistent agents with tool calls
- Submit batch inference jobs for high-volume offline scoring
- Fine-tune base models on uploaded training files
- Classify text content with prebuilt classifier endpoints

## Use cases

### RAG Pipeline Embeddings

Build retrieval-augmented generation systems by generating embeddings for a document corpus with Mistral's embeddings endpoint, then ranking results at query time. Mistral embeddings are competitive with closed-model alternatives at lower cost and run on EU-resident infrastructure for teams with data residency requirements.

Example prompt: Call POST /v1/embeddings with model mistral-embed and an array of 50 product descriptions, then store the returned vectors

### Document OCR and Extraction

Upload a scanned PDF or image, then call the OCR endpoint to receive structured text with layout information. Useful for accounts payable automation, contract intake, and onboarding flows where receipts or identity documents arrive as images. Files are uploaded once and referenced by ID across calls.

Example prompt: Upload invoice.pdf via POST /v1/files, then call the OCR endpoint with the returned file ID and parse the structured text response

### Stateful Conversational Agents

Create a Mistral agent with a system prompt and tool definitions, then drive multi-turn conversations through the conversations endpoints. State is persisted server-side so the client only sends the latest user message and the agent retains prior context, simplifying chatbot and copilot architectures.

Example prompt: Create an agent via POST /v1/agents with a customer-support system prompt, start a conversation, and append the next user message

### Agent Discovery via Jentic

Discover and call Mistral operations through Jentic without hand-wiring the SDK. An agent searches for an intent like generate text with Mistral, Jentic returns the matching operation schema, and execution runs against api.mistral.ai with the bearer key handled by your Jentic One instance.

Example prompt: Use Jentic to search for chat completion with Mistral, load the schema, and execute with model mistral-large-latest and a user message

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/chat/completions | Generate a chat completion |
| POST | /v1/embeddings | Create vector embeddings |
| GET | /v1/models | List available models |
| POST | /v1/agents | Create a stateful agent |
| POST | /v1/conversations | Start a conversation |
| POST | /v1/files | Upload a file for OCR or fine-tuning |

## Key resources

- **chat** — Chat completion endpoints for Mistral models
- **embeddings** — Vector embedding generation
- **agents** — Stateful agent definitions with tools and system prompts
- **conversations** — Persistent multi-turn conversation history
- **files** — Uploaded files for OCR, fine-tuning, and batch jobs
- **fine-tuning** — Custom model training jobs
- **batch** — Asynchronous bulk inference jobs
- **ocr** — Document OCR with layout output

## Why Jentic

- **Setup:** Wiring Mistral by hand means handling its bearer key against api.mistral.ai and coding the chat, embeddings, files, and agents calls yourself. Through Jentic you install once, import Mistral AI from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Mistral's chat, embeddings, and agent endpoints take the model and payload in the request body rather than a URL path resource, so scope the agent to the operations it needs, such as chat completions or creating embeddings. You choose which operations are allowed, so uploading files or creating agents is only included if you add it.
- **Credential handling:** Your Mistral bearer key is stored once, encrypted, by your own Jentic One instance and injected into the Authorization header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate text with Mistral' or 'create embeddings', and Jentic returns the matching Mistral operation with its input schema and model options so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI API** — GPT models, embeddings, and assistants from OpenAI
- **Anthropic Messages API** — Claude chat completions from Anthropic
- **Groq API** — Low-latency inference for open-weight models including Mixtral

## FAQ

### Why is there no official OpenAPI spec for Mistral AI API?

Mistral AI does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Mistral AI API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Mistral AI API use?

The Mistral AI API uses bearer token authentication. Pass your La Plateforme API key in the Authorization header as Bearer your-key. Through Jentic the key is stored in the credential vault and injected at execution so agent code never holds the secret directly.

### Can I run OCR on documents with the Mistral API?

Yes. Upload the file via POST /v1/files with purpose ocr, then call the OCR endpoint referencing the returned file ID. The response includes extracted text with layout structure suitable for downstream parsing.

### What are the rate limits for the Mistral AI API?

Rate limits depend on your La Plateforme tier and the specific endpoint family. Chat completions, embeddings, and batch jobs each have separate quotas. Check your account dashboard at console.mistral.ai for the current numeric limits before running large workloads.

### How do I fine-tune a Mistral model through Jentic?

Search Jentic for create fine tuning job, upload your training file via the files endpoint, then execute the fine-tuning operation with the file ID and base model. Job status can be polled through the same Jentic flow until the model is ready.

### Does the Mistral API support persistent conversations?

Yes. The /v1/conversations endpoints store message history server-side. Create a conversation, append messages, and retrieve history without resending the entire transcript on each turn.

### Can I limit what my agent is allowed to do with the Mistral AI API?

Yes. Because you run Jentic One yourself, you decide which Mistral operations the agent may call, so you can allow only chat completions and embeddings while leaving out everything else. Mistral's chat, embeddings, and agent endpoints take the model and payload in the request body rather than a URL path resource, so scoping happens at the operation level rather than by resource path. Higher-impact operations such as uploading files or creating persistent agents are included only if you explicitly add them, and your stored bearer key is injected at execution time under those same rules.
