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!"}] +}' +``` +