Last updated: 2026-04-12
Mistral Integration
Route Mistral API calls through SpendLil.
SpendLil proxies Mistral's API. Swap api.mistral.ai for mistral.gateway.spendlil.ai.
URL Pattern
diff Before → After
- POST https://api.mistral.ai/v1/chat/completions
+ POST https://mistral.gateway.spendlil.ai/v1/chat/completions Node.js
javascript Using fetch
const response = await fetch(
'https://mistral.gateway.spendlil.ai/v1/chat/completions',
{
method: 'POST',
headers: {
'X-SpendLil-Key': process.env.SPENDLIL_KEY,
'X-Provider-Key': `Bearer ${process.env.MISTRAL_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'mistral-large-latest',
messages: [{ role: 'user', content: 'What is SpendLil?' }],
}),
}
);
const data = await response.json();
console.log(data.choices[0].message.content); Cost Tracking
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| mistral-large | $2.00 | $6.00 |
| mistral-small | $0.20 | $0.60 |