(docs) virtual_keys

This commit is contained in:
ishaan-jaff 2024-01-18 13:55:32 -08:00
parent 90509a159a
commit f405a827e3

View file

@ -186,6 +186,38 @@ curl --location 'http://localhost:8000/key/generate' \
"max_budget": 0,}'
```
<!-- ## /key/update -->
<!-- ### Request
```shell
curl 'http://0.0.0.0:8000/key/update' \
--header 'Authorization: Bearer <your-master-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "sk-kdEXbIqZRwEeEiHwdg7sFA",
"models": ["gpt-3.5-turbo", "gpt-4", "claude-2"],
"metadata": {"user": "ishaan@berri.ai"},
"team_id": "core-infra"
}'
```
Request Params:
- key: str - The key that needs to be updated.
- models: list or null (optional) - Specify the models a token has access to. If null, then the token has access to all models on the server.
- duration: str or null (optional) - Specify the length of time the token is valid for. If null, the default is set to 1 hour. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d").
- metadata: dict or null (optional) - Pass metadata for the updated token. If null, defaults to an empty dictionary.
- team_id: str or null (optional) - Specify the team_id for the associated key.
### Response
```python
``` -->
## Tracking Spend
You can get spend for a key by using the `/key/info` endpoint.