Skip to main content
POST
Query Knowledge Engine
Query a knowledge engine with a natural language question. This endpoint uses Server-Sent Events (SSE) to stream the response back to the client.

Request Format

string
required
The natural language query to ask the knowledge engine
string
required
A name for this query workflow
string
Context ID used in case of thread mode for chat based workflows
boolean
Flag to enable advanced reasoning for the query
string
The model to use for the query

Example Request

Response Format

The response is streamed using Server-Sent Events (SSE) with the following event types:
  • message: Contains intermediate response chunks as they are generated
  • error: Contains error messages if something goes wrong
  • done: Final event containing the complete response with metadata

Example Response Stream

Notes

  • The streaming response allows for real-time display of the AI’s response as it’s being generated
  • The final done event includes the complete response along with metadata and citations
  • If an error occurs, the stream will emit an error event and close the connection
  • Clients should handle connection closure appropriately using the close event
The streaming response requires a client that supports Server-Sent Events (SSE). Most modern browsers and HTTP clients support this feature.

Response Object

string
Unique identifier for the workflow
string
Name of the workflow
string
The original query that was asked
string
Type of workflow (always “query”)
string
ID of the knowledge engine that was queried
string
Status of the workflow (“processed” when complete)
string
The complete response text
array
Array of citations supporting the response
number
Unix timestamp when the workflow was created

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

Knowledge engine ID

Body

application/json
query
string
required

The natural language query

name
string
required

Name of the workflow

advanced_reasoning
boolean

Enable advanced reasoning

model
enum<string>

LLM to use for the query

Available options:
auto,
claude-4.5-sonnet,
llama-v3-70b,
llama-4-scout,
llama-4-maverick,
gemini-2.5,
gpt-5.4,
claude-4.6-haiku,
gpt-4.1
Example:

"llama-v3-70b"

context_id
string

Context ID for maintaining conversation history in chat mode

Response

Streaming response using Server-Sent Events

The response is of type string.