curl --request POST \
--url https://{host}/api/queries/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/queries/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/queries/{id}/cancel', 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/queries/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/queries/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/queries/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/queries/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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": "output_text",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"grounding": "<string>",
"kind": "<string>"
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"code": "<string>",
"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": {},
"rollup": {
"type": "response.turn_rollup",
"query_id": "<string>",
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123
},
"synthesis": {
"type": "response.synthesis",
"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>"
}{
"message": "<string>",
"code": "<string>"
}Cancel an in-progress query turn
Idempotent — an already-terminal query is returned unchanged. On success the turn’s status becomes cancelled.
curl --request POST \
--url https://{host}/api/queries/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/queries/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/queries/{id}/cancel', 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/queries/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/queries/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/queries/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/queries/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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": "output_text",
"text": "<string>"
}
]
}
],
"citations": [
{
"source": "<string>",
"section_paths": [
[
"<string>"
]
],
"pages": [
123
],
"grounding": "<string>",
"kind": "<string>"
}
],
"steps": [
{
"step_id": "<string>",
"status": "<string>",
"commentary": "<string>",
"fns": [
"<string>"
],
"code": "<string>",
"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": {},
"rollup": {
"type": "response.turn_rollup",
"query_id": "<string>",
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"n_steps": 123,
"n_tool_calls": 123,
"by_category": {},
"total_hits": 123,
"duration_ms": 123
},
"synthesis": {
"type": "response.synthesis",
"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>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Session token from POST /auth/login. Pass as Authorization: Bearer <token>. The alternative X-Pinecone-Api-Key header is also accepted for direct-key auth (used by the Nexus CLI on first contact).
Headers
Date-based contract version. Omit to resolve to the Nexus default version (2026-07, the oldest served version); send unstable for the in-development surface. The resolved version is echoed back on the same header. A present-but-unrecognized value is rejected with 400 unsupported_api_version.
Path Parameters
Response
The (now cancelled) query
One query turn. Read the answer from output[].content[].text.
Unix seconds
The stored message array (plain-text content).
Show child attributes
Show child attributes
Output items; assistant text is {role, content:[{type: output_text, text}]}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Present when a shape was used, or on a retrieval-only turn
Per-turn token/cache totals + tool tally (response.turn_rollup)
Show child attributes
Show child attributes
Token/latency of the answer completion (response.synthesis)
Show child attributes
Show child attributes
Blob key of the persisted trace
Was this page helpful?