Mistral uses almost exactly the same API shape as OpenAI, which makes it one of the quickest AI providers to connect. The differences are the base URL and the model names. Everything else maps directly onto what you already know.
Mistral is a French AI company whose models are available through their La Plateforme API. The request format follows the OpenAI standard closely: same Bearer auth, same messages array, same response path. If you have already connected OpenAI, connecting Mistral is essentially changing two lines.
New to the External API Request step? Read the foundation guide first.
Current model list and pricing: docs.mistral.ai/getting-started/models. The -latest aliases simplify things, but the page also lists pinned versions if you need stable behaviour across updates.
https://api.mistral.ai/v1/chat/completions| Header | Value |
|---|---|
| Authorization | Bearer YOUR_KEY |
| Content-Type | application/json |
Same pattern as OpenAI. No extra headers needed.
{
"model": "mistral-small-latest",
"messages": [
{
"role": "system",
"content": "You are a helpful support assistant for {{business_name}}. Answer briefly."
},
{
"role": "user",
"content": "{{customer_message}}"
}
]
}Unlike Claude, max_tokens is optional here. Unlike OpenAI's gpt-4o, the model you use affects cost significantly. mistral-small-latest handles most WhatsApp chatbot tasks at a fraction of the cost of larger models.
The response path is identical to OpenAI's.
{
"choices": [
{
"message": {
"role": "assistant",
"content": "...Mistral's reply is here..."
},
"finish_reason": "stop"
}
]
}Map choices[0].message.content into your next WhatsApp message. If you previously connected OpenAI, the mapping is exactly the same; only the provider changed.
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong or missing API key | Confirm the full key is in the Authorization header as Bearer YOUR_KEY |
| 422 Unprocessable | Invalid model name | Use mistral-small-latest or check docs.mistral.ai for current model IDs |
| 400 Bad Request | Malformed JSON body | Validate the body; check messages is an array with at least one user message |
| Empty reply | model field missing | model is required in the body for Mistral |
Mistral returns an error object in the response body with a message field naming the problem.
Free trial, no credit card required. And if you ever get stuck, we are the only platform in India that answers you live on WhatsApp.