Skip to main content

Mistral

Route your Mistral API calls through AI SpendOps for automatic usage tracking and cost attribution.

Configuration

SettingValue
Route/v1/mistral/*
Upstreamhttps://api.mistral.ai
Auth headerAuthorization: Bearer ...
Streaming usageNative. stream_options is not injected

SDK base URL

https://proxy.aispendops.com/v1/mistral/v1

Example

curl https://proxy.aispendops.com/v1/mistral/v1/chat/completions \
-H "Authorization: Bearer your-mistral-key" \
-H "X-ASO-API-Key: aso_k_yourkey.secret" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-large-latest","messages":[{"role":"user","content":"Hello"}]}'

Usage fields

FieldDescription
prompt_tokensInput tokens
completion_tokensOutput tokens

Keeping the whole stack in Europe

Mistral is the usual choice for teams that need inference from a European provider, and it pairs cleanly with how AI SpendOps stores data: usage and cost records are held in United Kingdom and European Union regions, under UK GDPR and EU GDPR, with a Data Processing Addendum available.

That means the model provider and the cost telemetry about your model provider both stay in Europe. It is worth checking that property deliberately, because adding an observability or FinOps layer in front of a European model provider is a common way for data to end up leaving the region without anyone noticing.

AI SpendOps also never stores prompts or completions, only token counts, cost, model, timings and the dimensions you attach, so the content of your Mistral calls is not retained anywhere regardless of region.

Streaming and usage_source

Unlike most OpenAI-compatible providers in this catalogue, AI SpendOps does not inject stream_options: { include_usage: true } into Mistral requests. Mistral returns usage in the final streaming chunk on its own, and injecting an unrecognised field risks the upstream rejecting the request.

Every usage event carries a usage_source field so you can tell measured data from inferred data:

ValueMeaning
providerReal token counts from Mistral's usage block. What you should normally see
estimateResponse completed without a usage block, so counts are estimated from character length
partialCaller disconnected mid-stream and the partial response was estimated
noneUpstream returned an error, so no tokens were charged and none are recorded

If you are producing finance reports, filter on usage_source = 'provider' to exclude estimated rows, or report the estimated share alongside the total.

What AI SpendOps records

FieldPopulated
cache_read_tokensNo
cache_write_tokensNo
reasoning_tokensOnly where the model returns completion_tokens_details
provider_costNo. Cost is calculated from token counts and the current Mistral rate card

Notes

  • Both Mistral's native endpoints and its OpenAI-compatible surface route through /v1/mistral/* unchanged.
  • Full field definitions are in the usage event field reference.