curl --request POST \
--url https://{host}/api/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ask": "<string>",
"scope": [
"<string>"
],
"session_id": "<string>",
"previous_query_id": "<string>",
"workflow": "<string>",
"system_prompt": "<string>",
"guardrails": "<string>",
"shape": {},
"model": "<string>",
"models": [
"<string>"
],
"tools": [
"<string>"
],
"stream": true,
"background": true,
"timeout_seconds": 123,
"max_steps": 123,
"thinking_level": "<string>",
"compose": true,
"retrieval_only": true,
"pointers_only": true,
"chunks_only": true,
"artifacts_only": true,
"max_retrieved": 123,
"max_retrieved_chars": 123,
"comparison_group": "<string>"
}
'import requests
url = "https://{host}/api/query"
payload = {
"ask": "<string>",
"scope": ["<string>"],
"session_id": "<string>",
"previous_query_id": "<string>",
"workflow": "<string>",
"system_prompt": "<string>",
"guardrails": "<string>",
"shape": {},
"model": "<string>",
"models": ["<string>"],
"tools": ["<string>"],
"stream": True,
"background": True,
"timeout_seconds": 123,
"max_steps": 123,
"thinking_level": "<string>",
"compose": True,
"retrieval_only": True,
"pointers_only": True,
"chunks_only": True,
"artifacts_only": True,
"max_retrieved": 123,
"max_retrieved_chars": 123,
"comparison_group": "<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({
ask: '<string>',
scope: ['<string>'],
session_id: '<string>',
previous_query_id: '<string>',
workflow: '<string>',
system_prompt: '<string>',
guardrails: '<string>',
shape: {},
model: '<string>',
models: ['<string>'],
tools: ['<string>'],
stream: true,
background: true,
timeout_seconds: 123,
max_steps: 123,
thinking_level: '<string>',
compose: true,
retrieval_only: true,
pointers_only: true,
chunks_only: true,
artifacts_only: true,
max_retrieved: 123,
max_retrieved_chars: 123,
comparison_group: '<string>'
})
};
fetch('https://{host}/api/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ask' => '<string>',
'scope' => [
'<string>'
],
'session_id' => '<string>',
'previous_query_id' => '<string>',
'workflow' => '<string>',
'system_prompt' => '<string>',
'guardrails' => '<string>',
'shape' => [
],
'model' => '<string>',
'models' => [
'<string>'
],
'tools' => [
'<string>'
],
'stream' => true,
'background' => true,
'timeout_seconds' => 123,
'max_steps' => 123,
'thinking_level' => '<string>',
'compose' => true,
'retrieval_only' => true,
'pointers_only' => true,
'chunks_only' => true,
'artifacts_only' => true,
'max_retrieved' => 123,
'max_retrieved_chars' => 123,
'comparison_group' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/query"
payload := strings.NewReader("{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"session_id": "<string>",
"created": 123,
"status": "<string>",
"input": [
{
"role": "<string>",
"content": "<string>"
}
],
"output": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"score": 123,
"grounding": "<string>",
"kind": "<string>",
"source_path": "<string>",
"query_id": "<string>",
"steps": [
"<string>"
],
"artifact_name": "<string>",
"sources": [
"<string>"
]
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"strategy": {
"kind": "<string>",
"fns": [
"<string>"
],
"label": "<string>",
"scope": [
"<string>"
]
},
"tool_calls": [
{
"fn": "<string>",
"category": "<string>",
"args": {},
"result": "<unknown>",
"duration_ms": 123,
"ok": true,
"score_space": "<string>",
"error": "<string>"
}
],
"code": "<string>",
"trace_truncated": {
"truncated": true,
"dropped_documents": 123,
"dropped_tool_calls": 123
},
"cost": {
"tokens_in": 123,
"tokens_out": 123,
"decide_ms": 123,
"execute_ms": 123,
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"cum_input_tokens": 123,
"cum_output_tokens": 123
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"runtime_ms": 123,
"model": "<string>",
"error": "<string>",
"previous_query_id": "<string>",
"comparison": [
{
"workflow": "<string>",
"query_id": "<string>",
"model": "<string>"
}
],
"feedback": {
"rating": "<string>",
"comment": "<string>"
},
"output_json": {},
"max_steps": 123,
"thinking_level": "<string>",
"rollup": {
"type": "<string>",
"query_id": "<string>",
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123
},
"synthesis": {
"type": "<string>",
"query_id": "<string>",
"status": "<string>",
"tokens_in": 123,
"tokens_out": 123,
"ms": 123,
"answer_preview": "<string>",
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"trace_ref": "<string>"
}{
"id": "<string>",
"object": "<string>",
"session_id": "<string>",
"created": 123,
"status": "<string>",
"input": [
{
"role": "<string>",
"content": "<string>"
}
],
"output": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"score": 123,
"grounding": "<string>",
"kind": "<string>",
"source_path": "<string>",
"query_id": "<string>",
"steps": [
"<string>"
],
"artifact_name": "<string>",
"sources": [
"<string>"
]
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"strategy": {
"kind": "<string>",
"fns": [
"<string>"
],
"label": "<string>",
"scope": [
"<string>"
]
},
"tool_calls": [
{
"fn": "<string>",
"category": "<string>",
"args": {},
"result": "<unknown>",
"duration_ms": 123,
"ok": true,
"score_space": "<string>",
"error": "<string>"
}
],
"code": "<string>",
"trace_truncated": {
"truncated": true,
"dropped_documents": 123,
"dropped_tool_calls": 123
},
"cost": {
"tokens_in": 123,
"tokens_out": 123,
"decide_ms": 123,
"execute_ms": 123,
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"cum_input_tokens": 123,
"cum_output_tokens": 123
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"runtime_ms": 123,
"model": "<string>",
"error": "<string>",
"previous_query_id": "<string>",
"comparison": [
{
"workflow": "<string>",
"query_id": "<string>",
"model": "<string>"
}
],
"feedback": {
"rating": "<string>",
"comment": "<string>"
},
"output_json": {},
"max_steps": 123,
"thinking_level": "<string>",
"rollup": {
"type": "<string>",
"query_id": "<string>",
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123
},
"synthesis": {
"type": "<string>",
"query_id": "<string>",
"status": "<string>",
"tokens_in": 123,
"tokens_out": 123,
"ms": 123,
"answer_preview": "<string>",
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"trace_ref": "<string>"
}Run one KnowQL query turn
Send ask and, on a new session, a scope of 1–10 contexts; continue an existing one with session_id or previous_query_id. Scoped search contexts must be curated, and a scope may not mix work and search contexts. Read the answer from output[].content[].text.
stream and background are mutually exclusive. background: true returns 202 with an in_progress query to poll. stream: true emits an SSE stream whose event: names are the event type (see QueryEvent), closed by a final query frame carrying the whole turn:
id: 2 event: response.output_text.delta data: {"type":"response.output_text.delta","query_id":"qry_8b3d5f1a","delta":"Revenue grew 12%..."}
id: 3 event: response.completed data: {"type":"response.completed","query_id":"qry_8b3d5f1a"}
event: query data: {"id":"qry_8b3d5f1a","object":"query","status":"completed","output":[...]} ```
curl --request POST \
--url https://{host}/api/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ask": "<string>",
"scope": [
"<string>"
],
"session_id": "<string>",
"previous_query_id": "<string>",
"workflow": "<string>",
"system_prompt": "<string>",
"guardrails": "<string>",
"shape": {},
"model": "<string>",
"models": [
"<string>"
],
"tools": [
"<string>"
],
"stream": true,
"background": true,
"timeout_seconds": 123,
"max_steps": 123,
"thinking_level": "<string>",
"compose": true,
"retrieval_only": true,
"pointers_only": true,
"chunks_only": true,
"artifacts_only": true,
"max_retrieved": 123,
"max_retrieved_chars": 123,
"comparison_group": "<string>"
}
'import requests
url = "https://{host}/api/query"
payload = {
"ask": "<string>",
"scope": ["<string>"],
"session_id": "<string>",
"previous_query_id": "<string>",
"workflow": "<string>",
"system_prompt": "<string>",
"guardrails": "<string>",
"shape": {},
"model": "<string>",
"models": ["<string>"],
"tools": ["<string>"],
"stream": True,
"background": True,
"timeout_seconds": 123,
"max_steps": 123,
"thinking_level": "<string>",
"compose": True,
"retrieval_only": True,
"pointers_only": True,
"chunks_only": True,
"artifacts_only": True,
"max_retrieved": 123,
"max_retrieved_chars": 123,
"comparison_group": "<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({
ask: '<string>',
scope: ['<string>'],
session_id: '<string>',
previous_query_id: '<string>',
workflow: '<string>',
system_prompt: '<string>',
guardrails: '<string>',
shape: {},
model: '<string>',
models: ['<string>'],
tools: ['<string>'],
stream: true,
background: true,
timeout_seconds: 123,
max_steps: 123,
thinking_level: '<string>',
compose: true,
retrieval_only: true,
pointers_only: true,
chunks_only: true,
artifacts_only: true,
max_retrieved: 123,
max_retrieved_chars: 123,
comparison_group: '<string>'
})
};
fetch('https://{host}/api/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ask' => '<string>',
'scope' => [
'<string>'
],
'session_id' => '<string>',
'previous_query_id' => '<string>',
'workflow' => '<string>',
'system_prompt' => '<string>',
'guardrails' => '<string>',
'shape' => [
],
'model' => '<string>',
'models' => [
'<string>'
],
'tools' => [
'<string>'
],
'stream' => true,
'background' => true,
'timeout_seconds' => 123,
'max_steps' => 123,
'thinking_level' => '<string>',
'compose' => true,
'retrieval_only' => true,
'pointers_only' => true,
'chunks_only' => true,
'artifacts_only' => true,
'max_retrieved' => 123,
'max_retrieved_chars' => 123,
'comparison_group' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/query"
payload := strings.NewReader("{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ask\": \"<string>\",\n \"scope\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"previous_query_id\": \"<string>\",\n \"workflow\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"guardrails\": \"<string>\",\n \"shape\": {},\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"background\": true,\n \"timeout_seconds\": 123,\n \"max_steps\": 123,\n \"thinking_level\": \"<string>\",\n \"compose\": true,\n \"retrieval_only\": true,\n \"pointers_only\": true,\n \"chunks_only\": true,\n \"artifacts_only\": true,\n \"max_retrieved\": 123,\n \"max_retrieved_chars\": 123,\n \"comparison_group\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"session_id": "<string>",
"created": 123,
"status": "<string>",
"input": [
{
"role": "<string>",
"content": "<string>"
}
],
"output": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"score": 123,
"grounding": "<string>",
"kind": "<string>",
"source_path": "<string>",
"query_id": "<string>",
"steps": [
"<string>"
],
"artifact_name": "<string>",
"sources": [
"<string>"
]
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"strategy": {
"kind": "<string>",
"fns": [
"<string>"
],
"label": "<string>",
"scope": [
"<string>"
]
},
"tool_calls": [
{
"fn": "<string>",
"category": "<string>",
"args": {},
"result": "<unknown>",
"duration_ms": 123,
"ok": true,
"score_space": "<string>",
"error": "<string>"
}
],
"code": "<string>",
"trace_truncated": {
"truncated": true,
"dropped_documents": 123,
"dropped_tool_calls": 123
},
"cost": {
"tokens_in": 123,
"tokens_out": 123,
"decide_ms": 123,
"execute_ms": 123,
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"cum_input_tokens": 123,
"cum_output_tokens": 123
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"runtime_ms": 123,
"model": "<string>",
"error": "<string>",
"previous_query_id": "<string>",
"comparison": [
{
"workflow": "<string>",
"query_id": "<string>",
"model": "<string>"
}
],
"feedback": {
"rating": "<string>",
"comment": "<string>"
},
"output_json": {},
"max_steps": 123,
"thinking_level": "<string>",
"rollup": {
"type": "<string>",
"query_id": "<string>",
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123
},
"synthesis": {
"type": "<string>",
"query_id": "<string>",
"status": "<string>",
"tokens_in": 123,
"tokens_out": 123,
"ms": 123,
"answer_preview": "<string>",
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"trace_ref": "<string>"
}{
"id": "<string>",
"object": "<string>",
"session_id": "<string>",
"created": 123,
"status": "<string>",
"input": [
{
"role": "<string>",
"content": "<string>"
}
],
"output": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"score": 123,
"grounding": "<string>",
"kind": "<string>",
"source_path": "<string>",
"query_id": "<string>",
"steps": [
"<string>"
],
"artifact_name": "<string>",
"sources": [
"<string>"
]
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"strategy": {
"kind": "<string>",
"fns": [
"<string>"
],
"label": "<string>",
"scope": [
"<string>"
]
},
"tool_calls": [
{
"fn": "<string>",
"category": "<string>",
"args": {},
"result": "<unknown>",
"duration_ms": 123,
"ok": true,
"score_space": "<string>",
"error": "<string>"
}
],
"code": "<string>",
"trace_truncated": {
"truncated": true,
"dropped_documents": 123,
"dropped_tool_calls": 123
},
"cost": {
"tokens_in": 123,
"tokens_out": 123,
"decide_ms": 123,
"execute_ms": 123,
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"cum_input_tokens": 123,
"cum_output_tokens": 123
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"runtime_ms": 123,
"model": "<string>",
"error": "<string>",
"previous_query_id": "<string>",
"comparison": [
{
"workflow": "<string>",
"query_id": "<string>",
"model": "<string>"
}
],
"feedback": {
"rating": "<string>",
"comment": "<string>"
},
"output_json": {},
"max_steps": 123,
"thinking_level": "<string>",
"rollup": {
"type": "<string>",
"query_id": "<string>",
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123
},
"synthesis": {
"type": "<string>",
"query_id": "<string>",
"status": "<string>",
"tokens_in": 123,
"tokens_out": 123,
"ms": 123,
"answer_preview": "<string>",
"tokens_in_cached": 123,
"tokens_in_cache_write": 123,
"tokens_in_fresh": 123
},
"trace_ref": "<string>"
}Authorizations
Headers
Body
One KnowQL query turn. scope and the session-config fields are honored only when starting a NEW session and are pinned for its life; continue an existing one with session_id or previous_query_id. Every other field rides the turn and is not pinned.
Response
The completed query turn (synchronous), or the SSE stream when stream=true
One query turn. Read the answer from output[].content[].text.
Was this page helpful?