- AI APIs (LLMs like OpenAI, Anthropic, Mistral)
- Machine learning inference services
- Text-to-Speech or Speech-to-Text APIs
For example, if a user processes:
- 5 million input tokens → 15.00 x 5)
- 2 million output tokens → 60.00 x 2)
- 1 million cached input tokens → 7.50 x 1)
- Total Cost = $202.50
-
Create Metered Features for Token Usage
Since token usage is metered, we first define three separate Metered Features in Flexprice for input tokens, output tokens, and cached input tokens.
-
Create a Plan with Package-Based Pricing
Once the metered features are created, we define a Plan that charges users per million tokens rather than per individual token.
- See real-time usage events for token consumption.
- Get a dynamically generated proposed invoice based on their usage.
- Have full transparency in billing, ensuring clarity on costs.

