From ab3ece37c07a6fc75da823aeaca0ac987c4ac87b Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 14 Jun 2024 14:46:23 -0700 Subject: [PATCH] docs(users.md): update user docs to show reset budget --- docs/my-website/docs/proxy/users.md | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/my-website/docs/proxy/users.md b/docs/my-website/docs/proxy/users.md index 77fbcb4448..dca9f190e1 100644 --- a/docs/my-website/docs/proxy/users.md +++ b/docs/my-website/docs/proxy/users.md @@ -413,6 +413,52 @@ curl 'http://0.0.0.0:4000/key/generate' \ +### Reset Budgets + +Reset budgets across keys/internal users/teams/customers + +`budget_duration`: Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). + + + + +```bash +curl 'http://0.0.0.0:4000/user/new' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "max_budget": 10, + "budget_duration": 10s, # 👈 KEY CHANGE +}' +``` + + + +```bash +curl 'http://0.0.0.0:4000/key/generate' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "max_budget": 10, + "budget_duration": 10s, # 👈 KEY CHANGE +}' +``` + + + + +```bash +curl 'http://0.0.0.0:4000/team/new' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "max_budget": 10, + "budget_duration": 10s, # 👈 KEY CHANGE +}' +``` + + + ## Set Rate Limits You can set: