Pricing structure
Mistral prices tokens per million, with a different price per model and per token type.How it maps to Lago
Get started
1
Set up Lago
https://api.eu.getlago.com for the EU cluster. API endpoints live under /api/v2 and require the product catalog to be enabled on your organization.2
Create a billable metric
Create one billable metric that sums tokens, with Refer to the API reference and the billable metrics guide.
model and type dimensions.3
Create a metered product
4
Create product filters
Create one product filter per model and token type.Repeat for each combination:
Refer to the API reference and the product filters guide.
5
Create a rate card per filter
Each rate card targets one filter. Its initial rate uses the Repeat for each filter:
package model with a package of 1,000,000 tokens.Refer to the API reference and the package model.
6
Create a plan and apply the rate cards
7
Create a customer
external_id returns 422 instead of updating the customer. Refer to the API reference to create a customer.8
Create a contract
Replace The plan supplies the contract’s initial applied rate cards. A future
__PLAN_CODE__ with mistral_payg.started_at creates a pending contract that becomes active on that date. Only one pending or active contract can use a given external_id at a time. Refer to the API reference to create a contract.The example dates are in the future. To test right away, set each rate’s
effective_from to today and omit started_at, which defaults to now.9
Ingest usage via events
Send usage events that target the contract with Refer to the API reference and the usage ingestion guide.
external_contract_id.10
Monitor current usage
Track usage across the contract’s open billing periods.The response returns
amount_cents, taxes_amount_cents, total_amount_cents and a rate_cards array with usage per applied rate card. Pending contracts have no usage. Totals can span several invoices, so this is not a preview of one invoice. Filter with rate_card_code, product_code, product_filter_code or product_type. Refer to the API reference to get current usage.Worked example
Over one full monthly period, the customer sends 2,000,000 mistral-small input tokens and 3,000,000 mistral-large output tokens.What changed from v1
- The v1 template prepaid usage with a wallet. The v2 API does not document wallets, so this template omits prepaid credits.
- Charge filters become product filters, each priced by its own rate card.
- Events target
external_contract_idinstead ofexternal_subscription_id.
Product filters
Price subsets of metered usage separately.
Rates
Schedule price changes with effective dates.
Contracts
Apply a plan to a customer.
Send an event (API)
POST /api/v2/events