Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Integrate Token Usage Cost Calculation Based on OpenAI's Pricing #375

Open
Programmer-RD-AI opened this issue Feb 2, 2025 · 0 comments

Comments

@Programmer-RD-AI
Copy link

Hello,

Token Usage Cost Calculation:
I would like to request the addition of a feature that calculates the cost of token usage based on OpenAI's current pricing. This feature would allow developers to estimate the cost directly while using Tiktoken for tokenization.

Real-Time Pricing API:
While I understand that real-time pricing information was discussed in a separate issue (openai/openai-python#2074), I believe it would be valuable to integrate this information into Tiktoken as soon as OpenAI provides an official API for retrieving current pricing.

Benefits:

  • Cost Management: Helps developers manage their budget by providing instant token usage cost estimation.
  • Optimization: Guides developers in optimizing token usage to avoid unnecessary costs.
  • Convenience: Provides a seamless experience by consolidating tokenization and cost calculation in one place.

Thank you for considering this suggestion, and I look forward to any potential discussions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant