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

Add support for user information API calls #9

Open
charlesjlee opened this issue Jul 22, 2022 · 4 comments
Open

Add support for user information API calls #9

charlesjlee opened this issue Jul 22, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@charlesjlee
Copy link
Contributor

It would be nice to be able to get some user information -- specifically how many tokens are left in the user's account.

@ezzcodeezzlife
Copy link
Owner

Did you find API endpoints for this? (i was looking for the same thing with openais gpt3 api, but found nothing)

@ezzcodeezzlife ezzcodeezzlife added enhancement New feature or request help wanted Extra attention is needed labels Jul 22, 2022
@charlesjlee
Copy link
Contributor Author

I just created this as a placeholder. I didn't try doing it 😆

@kv-crosstech
Copy link

import requests

auth_header = "Bearer sess-......."


ret = requests.get(
    "https://labs.openai.com/api/labs/billing/credit_summary",
    headers={"Authorization": auth_header},
)
print(ret.json())

returns {'aggregate_credits': 545, 'next_grant_ts': 1661754850, 'breakdown': {'free': 0, 'paid_dalle_15_115': 545}, 'object': 'credit_summary'}

@ezzcodeezzlife
Copy link
Owner

I will add this asap 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants