doc controlling guardrail per api key

This commit is contained in:
Ishaan Jaff 2024-07-02 18:01:21 -07:00
parent 23f8d23acb
commit 62ebcc0bb5

View file

@ -605,10 +605,13 @@ https://api.groq.com/openai/v1/ \
**Step 1** Create Key with `hide_secrets` Off
👉 Set `"permissions": {"secret_detection": false}`
👉 Set `"permissions": {"secret_detection": false}` with either `/key/generate` or `/key/update`
This means the `hide_secrets` guardrail is off for all requests from this API Key
<Tabs>
<TabItem value="/key/generate" label="/key/generate">
```shell
curl --location 'http://0.0.0.0:4000/key/generate' \
--header 'Authorization: Bearer sk-1234' \
@ -622,6 +625,26 @@ curl --location 'http://0.0.0.0:4000/key/generate' \
# {"permissions":{"hide_secrets":false},"key":"sk-jNm1Zar7XfNdZXp49Z1kSQ"}
```
</TabItem>
<TabItem value="/key/update" label="/key/update">
```shell
curl --location 'http://0.0.0.0:4000/key/update' \
--header 'Authorization: Bearer sk-1234' \
--header 'Content-Type: application/json' \
--data '{
"key": "sk-jNm1Zar7XfNdZXp49Z1kSQ",
"permissions": {"hide_secrets": false}
}'
```
```shell
# {"permissions":{"hide_secrets":false},"key":"sk-jNm1Zar7XfNdZXp49Z1kSQ"}
```
</TabItem>
</Tabs>
**Step 2** Test it with new key
```shell