openai / openai-cookbook

Examples and guides for using the OpenAI API
https://cookbook.openai.com
MIT License
58.54k stars 9.28k forks source link

Ho to count number of input tokens and the output tokens #1090

Closed SaraAmd closed 4 months ago

SaraAmd commented 6 months ago

the main question is how to count the number of input tokens and the output tokens separately given that the code in the link just outputs a number as the total tokens and the pricing for input tokens and output tokens are different. If you have a code for this scenario it could be very helpful to share so that developers to have more accurate cost estimates

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 10 days with no activity.