Workspaces

Automatic search

Answers one question from the workspace's ingested files: a quick fact search, or an agent that reads documents and queries tables. The result has routing, output and output_job_id. Successful Drex Search costs $0.10 per million input tokens and $0.50 per million output tokens across its models. The initiating account pays. Cached input is counted once; answer-cache hits, failed and cancelled searches are free. Read the charge in Usage Logs. Missing final usage remains pending.

post/v1/workspaces/{id}/automatic-search

Request

Path parameters

idstring required

The workspace's workspace_id.

Query parameters

wait_secondsinteger

Hold the request open until the job finishes, up to this many seconds. 0 (default) returns at once; a value above 60 waits 60.

Headers

Idempotency-Keystring

Up to 200 characters, unique per account. Retry identical inputs with the same key to get the original job; use a new key for changed inputs.

Request body

querystring required
contextstring

Background the answer takes as given. Leave it out for the workspace's global_context; "" uses none.

path_prefixstring

Search only the files under this folder.

pathsstring[]

Search exactly these files too, by path.

output_schemaobject

A JSON Schema the answer must follow; the result's structured_answer holds it.

top_kinteger

How many evidences a fact answer cites.

mode'auto' | 'fact' | 'agent'

Response

The job, finished within wait_seconds.

job_idstring uuid required
kindstring required

The document service's job kind, such as ingestion, reconciliation, kg_build, intelligent_search (automatic search), automatic_agent (QA), file_replace, file_delete or workspace_delete.

status'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' required
workspace_idstring
resultunknown

Changes

No recorded changes to this operation across all 1 revision of this API.