In this article, you will learn how Mistral is using Lago to build a billing system based on AI tokens. This template is suitable for Large Language Model (LLM) and Generative AI companies whose pricing can vary based on the application or model used.Documentation Index
Fetch the complete documentation index at: https://docs.getlago.com/llms.txt
Use this file to discover all available pages before exploring further.
Pricing structure
For Mistral, pricing depends on the language model used. Here are several price points they offer: Prices are per 1M tokens used. You can think of tokens as pieces of words (learn more here).”| Models | Input | Output |
|---|---|---|
| mistral-small | $1 / 1M tokens | $3 / 1M tokens |
| mistral-medium | $2.7 / 1M tokens | $8.1 / 1M tokens |
| mistral-large | $4 / 1M tokens | $12 / 1M tokens |
Get started
Create a billable metric
Create a single billable metric to track token usage across different models and input/output types.Refer to the API reference and guide on filters to learn more.
- Add a unique
codefor your billable metric - Set
aggregation_typetosum_agg - Set
field_nametotokens - Set
recurringtofalse - Set
filtersto distinguish between models and token types
Create a plan
Create a plan to price packages of tokens used with Mistral’s specific pricing tiers.Refer to the API reference and guide on charges with filters to learn more.
- Add a unique
codefor your plan - Under
charges, configure pricing tiers for different models and token types
Create a customer
Prepay usage with credits
- Create a wallet with the customer’s
external_customer_id, set the walletcurrencyandrate_amountfor credit conversion
- Create a subscription for the customer with the plan’s
code.
Ingest usage via events
Send usage events to Lago to track usage.Refer to the API reference to create an event.
- Reference your billable metric with
code - Reference the customer’s subscription with
external_subscription_id - Include usage and filters data in
properties
Monitor current usage
Track real-time customer usage for the current billing period.Refer to the API reference to get the current usage.