From 23a12428bc6933fd1abbf3265983bcfd38410190 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 7 Apr 2026 22:50:51 +0000 Subject: [PATCH] docs: add Customers tab to Reset Budgets section Add a 'Customers' tab to the Reset Budgets section showing how to use /customer/new and /customer/update with budget_duration to set up automatically resetting budgets for customers (end-users). Co-authored-by: Krrish Dholakia --- docs/my-website/docs/proxy/users.md | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/my-website/docs/proxy/users.md b/docs/my-website/docs/proxy/users.md index 88a7a0f1e07..5037169a2ec 100644 --- a/docs/my-website/docs/proxy/users.md +++ b/docs/my-website/docs/proxy/users.md @@ -621,6 +621,48 @@ curl 'http://0.0.0.0:4000/team/new' \ "budget_duration": "30s", # 👈 KEY CHANGE }' ``` + + + +Use `/customer/new` to create a customer with a `budget_duration`. The budget will automatically reset at the end of the specified duration. + +```bash +curl 'http://0.0.0.0:4000/customer/new' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "user_id": "my-customer-id", + "max_budget": 10, + "budget_duration": "30d", # 👈 KEY CHANGE +}' +``` + +To update an existing customer's budget duration: + +```bash +curl 'http://0.0.0.0:4000/customer/update' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "user_id": "my-customer-id", + "max_budget": 10, + "budget_duration": "30d", # 👈 KEY CHANGE +}' +``` + +Then pass the customer's `user_id` as the `user` parameter in `/chat/completions` requests: + +```bash +curl 'http://0.0.0.0:4000/chat/completions' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data '{ + "model": "gpt-4o", + "user": "my-customer-id", + "messages": [{"role": "user", "content": "Hello!"}] +}' +``` +