API लागत calculator: tokens, cache और request volume
Token rates और request volume से forecast बनाना, cache hit को अलग रखना और accepted workflow की वास्तविक लागत जाँचना।
Cost calculator का काम एक निश्चित बिल बताना नहीं, assumptions को साफ़ करना है। Current model rates, input tokens, output tokens, cached tokens और requests की संख्या अलग रखें। Prices और model availability dynamic हैं; configuration या budget approval के दिन BetterToken pricing देखें।
अपने API requests के लिए BetterToken API documentation से setup जाँचें और test के बाद Dashboard में model, input, output, cache tokens और charge मिलाएँ। Dashboard forecast का विकल्प नहीं, उसका actual-data check है।
calculator को कौन-से data चाहिए
हर model के लिए input rate, cache-hit rate, output rate, average input/output tokens और period में requests चाहिए। Currency conversion, taxes, minimum top-up या fixed team cost को token formula में छिपाने के बजाय अलग line में रखें।
universal formula
Rates को per-token या per-million-token unit में एक समान करें। Cached tokens input से अलग billed हो सकते हैं; उन्हें सामान्य input में दोबारा न जोड़ें।
copyable Python calculator
यह estimate है, invoice नहीं। API units और current rates भरने से पहले pricing source पढ़ें।
cache hit rate को कैसे लें
Cache hit को 0% या 100% मानना अक्सर गलत है। Stable system prompt या shared prefix hit हो सकता है, लेकिन tool results, history और files बदलने पर prefix miss हो सकता है। पहले conservative estimate बनाएँ, फिर Dashboard के वास्तविक calls से assumption सुधारें।
एक संख्या के बजाय तीन scenarios
Basic scenario में expected volume और conservative cache लें। Favorable scenario में वही workload अधिक reuse के साथ रखें। Worst case में cache कम, output अधिक और retries शामिल करें। Budget discussion में तीनों assumptions लिखें; केवल सबसे कम figure न दिखाएँ।
agent workflow की लागत
Agent के लिए accepted task की लागत देखें: planning, tool calls, retries और final output सभी जोड़ें। एक long request की तुलना में कई छोटे verified requests सस्ते या महंगे हो सकते हैं; workload पर मापें। Infinite concurrency, fixed cache saving या universal lowest price का दावा न करें।
forecast को तथ्य से मिलाएँ और सीमाएँ
एक safe test run के बाद timestamp, model और usage fields से Dashboard record मिलाएँ। Actual charge अनुमान से अधिक हो तो model, token units, cache assumption, output length और retries जाँचें। Calculator unknown tool-side fees, future price changes, failed side effects या हर provider की billing rule नहीं बताता।
FAQ
Cache न हो तो cache ratio 0 रखें। Month का estimate daily/weekly request volume से बनता है। Cached token केवल तभी अलग लें जब provider का usage record उसे अलग दिखाए। वास्तविक charge अधिक हो तो पहले current rate और request record देखें, अनुमान को invoice न मानें।