Pricing Template Samples
OpenAI Chat GPT Monetization
17 min
this pricing template outlines how to model openai’s pricing in amberflo to track internal costs create a customer facing pricing plan monetize generative ai services embedded in your product all usage is metered, and customers only pay for what they use for more information on openai pricing, refer to their official documentation how it works since chatgpt was released to the public in late 2022, generative ai adoption has grown rapidly this growth accelerated when openai made its large language models (llms) accessible to developers via api, enabling integration into their own applications and services to support this model, openai uses a prepaid usage based pricing strategy all user actions—including input comprehension and output generation —are priced in tokens openai meters and tracks this token usage and calculates the cost of each model interaction accordingly pricing is determined by several factors model type e g , gpt 4 or gpt 3 5 turbo context length e g , 8k or 32k token window in this template, we’ll walk through how to model pricing for both gpt 4 and gpt 3 5 turbo in amberflo instructions we will walk through how to re create this pricing model in amberflo if you do not yet have an amberflo account but would like to get started, please reach out to us here step one create meters to track the token consumption on both chat inputs and outputs a chat interaction consists of two parts the user provided input , which the model must interpret (prompt comprehension), and the llm generated output , based on that prompt both the input and the output must be tracked and charged accordingly all usage and billing calculations for openai are based on tokens the token rate can vary depending on the model type (e g , gpt 4 or gpt 3 5 turbo) the context length (e g , 8k or 32k) whether the tokens are for input or output input meter first, create a sum type meter in amberflo to track the number of tokens consumed during prompt interpretation (input) each event sent to this meter will include the number of tokens used as the meter value dimensions model name (e g , gpt 4 or gpt 3 5 turbo) model context (e g , 8k or 32k) this meter will collect and aggregate usage based on the number of tokens consumed per interaction see the screenshot below for the meter setup next, repeat the process and create a second sum type meter to track the number of tokens consumed from the model output this meter will record the number of tokens used for each generated output the meter value should be the number of output tokens use the same dimensions model name (e g , gpt 4 or gpt 3 5 turbo) model context (e g , 8k or 32k) when creating each meter, you can enable the option to automatically create a corresponding product item product items are used in amberflo billing to assign pricing and generate charges based on usage tracked by the meter step two deploy the meters to track real time usage each time a chat interaction takes place, two meter events should be sent to amberflo one for the input tokens and one for the output tokens each meter event should include the number of tokens consumed and the relevant dimensions (model name and model context) amberflo supports multiple options for integrating your application and ingesting usage data into the metering system ingestion options include amberflo sdks (available for several languages) amberflo ingestion api file based ingestion database integrations (via jdbc or direct queries) third party tools like aws cloudwatch aws s3 aws sqs elastic logstash mongodb postman collections kong api gateway for detailed instructions on each method, refer to the following resources here is the sdk information curl metering example here is the api reference https //docs amberflo io/reference/ingest meter records here are the docs on other ingestion options aws cloudwatch once the meter ingestion pipeline is configured, amberflo will begin tracking and aggregating usage in real time this data is immediately available for visualization and analysis, grouped by customer and any dimensions you have defined step three create the usage based pricing for gpt 4 and gpt 3 5 turbo once the meters are set up, the next step is to create the pricing plan that defines what your customers will be charged for using the generative ai service amberflo enables you to manage internal cost tracking, create custom pricing models, and expose customer facing pricing—all from within the platform the plan will have two product items, the input comprehension tokens and the output generation tokens for each, we will use the per unit with dimensions rate model instructions navigate to billing → pricing plans and click create new to start building your pricing plan define the plan name and billing period (e g , monthly) add the product item that corresponds to the input token meter you previously created (e g , for gpt 4 input tokens) set a per unit price for the input tokens this should include your markup on top of openai’s rates to account for your internal costs and profit margin repeat the process to create a second product item for the output tokens (e g , gpt 3 5 turbo output tokens), and include it in the same pricing plan or in a separate one depending on your business structure reminder since this is a customer facing pricing plan, the per token rates must be set higher than the openai costs to ensure you’re covering expenses and generating revenue once the pricing plan is complete and includes both input and output token product items (with correct pricing and associated meters), you’ll be ready to activate the plan and assign it to your customers step four activate the plan and assign customers to begin invoicing to begin generating invoices based on usage, you need to activate the pricing plan and assign it to customers once assigned, amberflo will calculate the billed amount in real time as usage events are ingested and processed using the rates defined in the pricing plan instructions activate the pricing plan go to the pricing plans section and toggle the plan from draft to active once activated, the plan is locked to changes and ready for assignment assign customers to the plan you can manually create customers in amberflo via the customers section and assign them the desired pricing plan alternatively, automate customer creation and plan assignment via api or allow customers to select a plan via your product’s ui using amberflo ui widgets this will create the customer in amberflo and assign the plan automatically monitor invoices you can view invoices at any time by going to the customer view and selecting the invoice for the billing period invoices update in real time as usage data is processed for additional setup instructions on manual and automated plan assignment, refer to the aws style pay as you go pricing section step five calculate internal costs by recreating openai pricing in amberflo to accurately track internal costs and margins, create a separate pricing plan in amberflo that replicates openai’s official pricing this internal facing plan will allow you to monitor cost structures per customer or per usage dimension instructions create a new pricing plan go to billing → pricing plans → create new , and name this plan something like openai internal cost add product items add two product items to the plan one for prompt comprehension (input tokens) one for response generation (output tokens) use “per unit with dimensions” rate model for both product items, select the per unit with dimensions pricing model this allows you to define specific token rates based on dimensions like model name (e g , gpt 4, gpt 3 5 turbo) context window (e g , 8k, 32k) mirror openai pricing exactly set the rates to match openai’s public pricing page this ensures your internal cost calculation reflects what your company pays for api usage recall, openai pricing can be found here note this plan is not customer facing it is used solely for internal margin and usage analysis step six create a price model to compare customer facing and internal pricing side by side at this stage, your customer facing pricing is active and being used to calculate the monthly billable amounts you've also set up an internal cost pricing plan that mirrors openai's rates to gain insights into profit margins and account level economics, you can now compare both pricing models instructions create a new price model navigate to billing → price models → create new select the customer facing and internal pricing plans in the price model configuration, select your customer facing pricing plan (e g , gpt premium pricing) your internal cost pricing plan (e g , openai internal cost) run the price model once configured, run the model using live usage data from your system amberflo will apply both pricing plans to the same set of meter events review the comparison the output will show a detailed breakdown of revenue per product item or customer cost based on openai rates margins by customer, product, or dimension (e g , model name, context window) see the screenshot below for an example of the configuration this level of visibility allows your finance, product, and operations teams to monitor profitability per customer adjust pricing based on usage trends optimize margin in real time tying it all together amberflo provides an end to end platform for customers to easily and accurately meter usage and operate a usage based business you can track and bill for any scale of consumption — from experimental models in beta to production grade deployments with thousands of daily users amberflo is infrastructure agnostic and flexible enough to track any resource with any aggregation logic experiment confidently with various pricing models including usage based pricing prepaid credits hybrid pricing long term commitments each model can be tailored to meet the needs of your business and customer base amberflo also offers powerful, real time tools analytics and dashboards for full visibility into usage and revenue custom alerts to notify you when key thresholds or limits are reached granular insights by customer, product, or dimension with amberflo, you can monitor usage and revenue in real time at a per customer and per dimension level this visibility allows you to react quickly to changes in customer behavior maintain profitability by controlling costs scale operations with confidence amberflo empowers businesses to deliver accurate, transparent, and scalable billing for modern, usage based products and services