Save the organization's own Anthropic key (BYOK)
curl --request PUT \
--url https://app.trustivan.com/api/v1/assistant/key \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/assistant/key"
payload = { "api_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_key: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/assistant/key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assistant/key"
payload := strings.NewReader("{\n \"api_key\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"available": true,
"configured": true,
"entitled": true,
"enabled": true,
"store_questions": true,
"can_manage": true,
"tokens_used": 123,
"monthly_tokens": 123,
"requests_per_minute": 123,
"reason": "not_configured",
"message": "<string>",
"model": "<string>",
"key_source": "platform",
"byok": {
"entitled": true,
"set": true,
"hint": "<string>",
"fingerprint": "<string>",
"verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
},
"credits": {
"month": "<string>",
"included": 123,
"used": 123,
"remaining": 123,
"overage_entitled": true,
"overage_enabled": true,
"overage_cap": 123,
"overage_used": 123,
"alert_percent": 0,
"credit_microusd": 123
}
}Save the organization's own Anthropic key (BYOK)
Team plan and above (ai_byok). The key is checked with one
read-only Anthropic call first and stored only if Anthropic accepts
it; it is sealed at rest, bound to the organization, and never
returned by any endpoint, log or audit entry. Replaces any previous
key. Questions then use this key and spend no AI credits; if Anthropic
refuses it later, the question fails with that message and is never
answered with TRUSTIVAN’s key instead. Requires organization:manage
and a human; audited as assistant.byok.set or .replaced, and a
refused key as .verify_failed (fingerprint and hint only).
PUT
/
assistant
/
key
Save the organization's own Anthropic key (BYOK)
curl --request PUT \
--url https://app.trustivan.com/api/v1/assistant/key \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/assistant/key"
payload = { "api_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_key: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/assistant/key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assistant/key"
payload := strings.NewReader("{\n \"api_key\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"available": true,
"configured": true,
"entitled": true,
"enabled": true,
"store_questions": true,
"can_manage": true,
"tokens_used": 123,
"monthly_tokens": 123,
"requests_per_minute": 123,
"reason": "not_configured",
"message": "<string>",
"model": "<string>",
"key_source": "platform",
"byok": {
"entitled": true,
"set": true,
"hint": "<string>",
"fingerprint": "<string>",
"verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
},
"credits": {
"month": "<string>",
"included": 123,
"used": 123,
"remaining": 123,
"overage_entitled": true,
"overage_enabled": true,
"overage_cap": 123,
"overage_used": 123,
"alert_percent": 0,
"credit_microusd": 123
}
}Authorizations
Response
The status after the change.