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

Print total api costs #706

Merged
merged 3 commits into from
Sep 17, 2023
Merged

Print total api costs #706

merged 3 commits into from
Sep 17, 2023

Conversation

lukaspetersson
Copy link
Contributor

Cost conscious users would want to monitor their api usage.

Prints the total cost at the end:

...
If you have time, please explain what was not working (ok to leave blank)

Total api cost: 0.30204

@lukaspetersson lukaspetersson marked this pull request as ready for review September 16, 2023 18:17
gpt_engineer/ai.py Outdated Show resolved Hide resolved
@ATheorell
Copy link
Collaborator

I think this is a great idea!

Would you mind adding a dollar sign on main.py, line 99, so that it becomes:

print("Total api cost: $ ", ai.usage_cost())

then I will merge.

@ATheorell ATheorell merged commit 29e891c into AntonOsika:main Sep 17, 2023
@lukaspetersson lukaspetersson deleted the print_cost branch September 22, 2023 17:28
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

Successfully merging this pull request may close these issues.

3 participants