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

feat: add method to retrieve the API usage so far in the cycle #533

Closed
ngupta23 opened this issue Nov 6, 2024 · 2 comments
Closed

feat: add method to retrieve the API usage so far in the cycle #533

ngupta23 opened this issue Nov 6, 2024 · 2 comments

Comments

@ngupta23
Copy link
Member

ngupta23 commented Nov 6, 2024

Description

Add a method to the client to retrieve the API usage in the current cycle.

Use case

While experimenting, users may be interested in dynamically retrieving their API usage using the SDK to make tradeoffs with experiments and prod usage.

@ngupta23
Copy link
Member Author

ngupta23 commented Nov 6, 2024

Per @Yibei990826, the following can be used in the mean time.

import requests

url = "https://api.nixtla.io/usage"

headers = {
  'Authorization': 'Bearer YOUR_API_KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

@jmoralez
Copy link
Member

jmoralez commented Dec 6, 2024

Fixed by #548

@jmoralez jmoralez closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants