forked from phoenix/litellm-mirror
docs(users.md): add user rate limits to docs
This commit is contained in:
parent
17d47ea1ed
commit
a351211d03
1 changed files with 15 additions and 3 deletions
|
@ -1,11 +1,13 @@
|
|||
# Set budgets per user
|
||||
|
||||
LiteLLM exposes a `/user/new` endpoint to create budgets for users, that persist across multiple keys.
|
||||
# Set Budgets + Rate Limits per user
|
||||
|
||||
Requirements:
|
||||
|
||||
- Need to a postgres database (e.g. [Supabase](https://supabase.com/), [Neon](https://neon.tech/), etc)
|
||||
|
||||
|
||||
## Set Budgets
|
||||
LiteLLM exposes a `/user/new` endpoint to create budgets for users, that persist across multiple keys.
|
||||
|
||||
This is documented in the swagger (live on your server root endpoint - e.g. `http://0.0.0.0:8000/`). Here's an example request.
|
||||
|
||||
```curl
|
||||
|
@ -28,3 +30,13 @@ The request is a normal `/key/generate` request body + a `max_budget` field.
|
|||
```
|
||||
|
||||
|
||||
## Set Rate Limits
|
||||
|
||||
Set max parallel requests a user can make, when you create user keys - `/key/generate`.
|
||||
|
||||
```bash
|
||||
curl --location 'http://0.0.0.0:8000/key/generate' \
|
||||
--header 'Authorization: Bearer sk-1234' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{"duration": "20m", "max_parallel_requests": 1}' # 👈 max parallel requests = 1
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue