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

How to get the Available tokens though Reader API to monitor the token usage? #64

Closed
songkq opened this issue May 22, 2024 · 5 comments
Closed

Comments

@songkq
Copy link

songkq commented May 22, 2024

@nomagick @hanxiao @zac-li @saahil @CatStark Hi all, could you please give some advice for how to get the available tokens through the Reader API instead of the "'Buy tokens' tab" shown in https://jina.ai/reader/?
image
image

@nomagick
Copy link
Member

Currently, you can

curl https://r.jina.ai -H 'Authorization: Bearer <YOUR_TOKEN>'

There will be an additional section showing the count of your remaining tokens.

CleanShot 2024-05-22 at 18 16 50@2x

@hanxiao
Copy link
Member

hanxiao commented May 22, 2024

@songkq if u want to check via UI, u can also type in your key and it will show.

image

@songkq
Copy link
Author

songkq commented May 23, 2024

@hanxiao @nomagick Thanks. Could you please add a JSON response format for "[Balance left] 1000000", e.g., {'available_tokens': 1000000}?

@songkq
Copy link
Author

songkq commented May 23, 2024

@hanxiao @nomagick Another issue please... Even after I add a freetrial API_Key during request, it seems that I cannot parse more than 20 urls in asynchronism and concurrency during one minute. It returns the response "Whoa there, turbo! You've hit the rate limit on the Reader API. Cool down a bit and try again later; or resend the request with a Jina AI API Key in the authorization header...."

image

Could you please give some advice for this issue?

By the way, is there a guidance tutorial for deploy the Jina Reader locally in a private enrivonment?

@hanxiao
Copy link
Member

hanxiao commented May 23, 2024

Regarding the 20 RPM with API key issue u have, I have a feeling your header may be wrongly set and not respected by the server, could it be a misspelling or something?

Here is a google colab that you can refer to regarding w/ w/o API key's rate limit https://colab.research.google.com/drive/1uoBy6_7BhxqpFQ45vuhgDDDGwstaCt4P#scrollTo=MTEWpqyxCJ5U

@songkq songkq closed this as completed May 28, 2024
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

3 participants