Handle and show ratelimits based on the api http header #1724
d-oit
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If HTTP Header included the rate limit handle information, use these values instead of the static rateLimitSeconds:
https://docs.anthropic.com/en/api/rate-limits#response-headers
https://platform.openai.com/docs/guides/rate-limits
Output rate limits with a standard code (like 429 or API_RATE_LIMIT) for all Handler
Show details as vs code notification or vs code output channel.
Sample:
protected async handleRateLimit(response: Response): Promise {
const rateLimitRemaining = response.headers.get("x-rate-limit-remaining")
const rateLimitReset = response.headers.get("x-rate-limit-reset")
Beta Was this translation helpful? Give feedback.
All reactions