Manually managing per-token pricing can be complex, but with Flexprice, you can automate and scale your billing effortlessly. This guide walks you through setting up OpenAI’s O1 pricing model using a package-based pricing approach. This method ensures clarity in billing, making it ideal for AI APIs, generative models, and machine learning services. Use CasesDocumentation Index
Fetch the complete documentation index at: https://docs.flexprice.io/llms.txt
Use this file to discover all available pages before exploring further.
- AI APIs (LLMs like OpenAI, Anthropic, Mistral)
- Machine learning inference services
- Text-to-Speech or Speech-to-Text APIs
| Token Type | Price per Million Tokens |
|---|---|
| Input Tokens | $15.00 per million tokens |
| Output Tokens | $60.00 per million tokens |
| Cached Input Tokens | $7.50 per million tokens |
- 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.
Feature Name Feature Type Aggregation Method Key Filters Input Tokens Metered SUM model_name model: OpenAI O1, prompt_type: input Output Tokens Metered SUM model_name model: OpenAI O1, prompt_type: output Cached Input Tokens Metered SUM model_name model: OpenAI O1, prompt_type: cached_input -
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.
Metered Feature Billing Model Charges Input Tokens Package Charge $15.00 per million tokens Output Tokens Package Charge $60.00 per million tokens Cached Input Tokens Package Charge $7.50 per million tokens
- 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.

