Run one KnowQL query turn
Send ask (the natural-language question) and, when starting a new session, a scope of 1–10 contexts. Continue an existing session with session_id or previous_query_id. Scoped search contexts must be curated (work contexts are queryable immediately), and a scope may not mix work and search contexts.
stream and background are mutually exclusive. With background: true the API returns 202 with an in_progress query and the client polls GET /queries/{id}. With stream: true the API emits an SSE stream whose event: names are the event type (response.created, response.step, response.output_text.delta, response.turn_rollup, response.synthesis, response.trace, and a terminal response.completed / response.failed / response.cancelled), followed by a final query event carrying the full query object. Read the answer from output[].content[].text.
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.
Body
A single KnowQL query turn. scope and the session-config fields (system_prompt, guardrails, model/models, tools) are honored only when starting a NEW session and are pinned for its life; continue an existing session with session_id or previous_query_id. The per-turn controls (workflow, shape, max_steps, thinking_level, compose, retrieval_only/pointers_only, chunks_only/artifacts_only, max_retrieved/max_retrieved_chars) ride the turn and are not pinned to the session.
The natural-language question
Context slugs/UUIDs. New session only; pinned for the session's life. A scope may not mix work and search contexts.
1 - 10 elementsContinue an existing session
Continue the session this query belongs to
Search workflow for this turn. Legacy aliases query_search/query_sac, query_cc, query_rag are still accepted on input. Ignored for work contexts, which always run the work runtime.
Instructions pinned to a new session
Guardrails pinned to a new session
JSON Schema subset for structured output; result in output_json
provider/model
Ordered fallback list; takes precedence over model
SSE streaming. Mutually exclusive with background.
Fire-and-forget: 202 + in_progress query; poll GET /queries/{id}. Mutually exclusive with stream.
May only LOWER the 15-minute (900s) cap
Cap the agent's tool-loop steps for this turn
Gemini reasoning depth. Default low. Gemini-backed workflows only; ignored for search_cc.
false skips synthesis (alias for retrieval_only)
Skip synthesis; return retrieved hits in output_json
Skip synthesis; return just pointers in output_json
Retrieval-only, narrowed to chunks
Retrieval-only, narrowed to artifacts
Cap the item count for retrieval-only turns
Cap per-item verbatim text length for retrieval-only turns
Client-generated id shared by the turns of one Compare run, so the preview per-project query cap treats them as a single action. The group is size-bounded server-side (max 3 turns). Omit for a normal single query.
Response
The completed query turn (synchronous), or the SSE stream when stream=true
One query turn. Read the answer from output[].content[].text.
Unix seconds
The stored message array (plain-text content).
Output items; assistant text is {role, content:[{type: output_text, text}]}
Present when a shape was used, or on a retrieval-only turn
Per-turn token/cache totals + tool tally (response.turn_rollup)
Token/latency of the answer completion (response.synthesis)
Blob key of the persisted trace