Replicate Mistral’s per-token pricing model with Lago.
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.
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 |
Set up Lago
Create a billable metric
Create a single billable metric to track token usage across different models and input/output types.
code
for your billable metricaggregation_type
to sum_agg
field_name
to tokens
recurring
to false
filters
to distinguish between models and token typesRefer to the API reference and guide on filters to learn more.
Create a plan
Create a plan to price packages of tokens used with Mistral’s specific pricing tiers.
code
for your plancharges
, configure pricing tiers for different models and token typesRefer to the API reference and guide on charges with filters to learn more.
Create a customer
Prepay usage with credits
external_customer_id
,
set the wallet currency
and rate_amount
for credit conversionRefer to the API reference to create a wallet.
code
.Refer to the API reference to create a subscription.
Ingest usage via events
Send usage events to Lago to track usage.
code
external_subscription_id
properties
Refer to the API reference to create an event.
Monitor current usage
Track real-time customer usage for the current billing period.
Refer to the API reference to get the current usage.
Per-token pricing offers flexibility and visibility, and allows LLM and Generative AI companies like Mistral to attract more customers. With Lago, you can create your own metric dimensions to adapt this template to your products and services.
Give it a try, click here to get started!