curl --request POST \
--url https://app.trustivan.com/api/v1/assistant/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"context": {
"id": "<string>"
}
}
'import requests
url = "https://app.trustivan.com/api/v1/assistant/ask"
payload = {
"question": "<string>",
"context": { "id": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', context: {id: '<string>'}})
};
fetch('https://app.trustivan.com/api/v1/assistant/ask', 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/ask"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"context\": {\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}<string>Ask a question and stream the answer
Answers as the signed-in person: the model’s only tools are the MCP
read tools, whose API calls carry that person’s own session, so it
reads exactly what they may read in this organization and changes
nothing. It may suggest an action (proposal), which the person
reviews and confirms through the existing endpoint.
The stream is text/event-stream with these events, each a JSON
data line: text ({text}, a piece of the answer), tool
({tool}, a lookup started), citation ({citation: {kind, id}}, a
finding, asset or check the answer read), proposal
({proposal: {action, target_kind, target_id, rationale}}, action one
of open_fix_pr, suppress_finding, set_asset_owner), then done
({stopped, citations, tokens, ai_generated: true}; stopped is empty,
refusal, length or tool_limit) or error ({message}).
A session only (an API key gets 403: use /mcp). Each question is
audited as assistant.asked and written to the AI usage ledger: on
the platform key it spends AI credits (1 credit = US$0.01 of the
model’s list price), on the organization’s own key it spends none. A
person may ask a limited number per minute. done also carries
key_source and credits.
curl --request POST \
--url https://app.trustivan.com/api/v1/assistant/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"context": {
"id": "<string>"
}
}
'import requests
url = "https://app.trustivan.com/api/v1/assistant/ask"
payload = {
"question": "<string>",
"context": { "id": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', context: {id: '<string>'}})
};
fetch('https://app.trustivan.com/api/v1/assistant/ask', 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/ask"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"context\": {\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}<string>Authorizations
Body
Response
The answer, streamed.
The response is of type string.