Skip to main content
post/knowledge-fs/spaces/{knowledge_base_id}/research-tasks/plan
Request example
Response
post/knowledge-fs/spaces/{knowledge_base_id}/research-tasks/plan

Authorization

Authorizationstringheaderrequired#

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Path parameters

knowledge_base_idstringrequired#
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.

Body

application/json
budgetUsdnumber#
Spend ceiling in USD to compare with the cost estimate. Sets budget.exceeds_budget and budget.remaining_budget_usd in the response.

Range: >= 0

modeenum<string>#
Retrieval depth: fast, deep, or research (see Retrieval Depth). Omit it to use the knowledge base's default depth, retrieval.default_mode in Get Knowledge Base Settings.
Options:fastdeepresearchnull
querystringrequired#
The question. Use a nonblank query. Also limited to 16,384 UTF-8 bytes.

Length: max 16000Pattern: \S

topKinteger#
Maximum number of chunks kept after the search results are merged and reranked. Explicit values must be between 1 and 50. If omitted, uses the knowledge base's published TOP K setting, which can be up to 100. Higher values give the model more context and more noise. Lower values stay focused and can miss relevant chunks.

Range: 1–50

Responses

application/json
The plan and its estimates.
budgetobject#
Verdict of the cost estimate against the request's budgetUsd.
estimatesobject#
Work, cost, and latency estimates for the task. Compare them with the limits you intend to send to Create Research Task.
knowledge_space_idstring#
Internal ID of the knowledge base. Not the knowledge base ID in the path.
querystring#
The question with surrounding whitespace removed.
retrieval_planobject#
How the search would be run.
stepsobject[]#
Per-step estimates, in execution order.
strategy_versionstring#
Version of the estimator.