For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Chat with the Agent over project, org, or Open Library knowledge
POST
/api/v2/chat
Multi-turn conversational endpoint. Supports both synchronous JSON
responses and server-sent event (SSE) streaming via `stream: true`.
`search_scope` picks the corpus: `project` (`project_id` required),
`org` (the org's own documents), or `open_library` (the shared Open
Library corpus — requires the `api.open_library` feature and cannot be
combined with `chat_type`). When omitted, the scope is derived from
`project_id` presence. Scope is per-request: multi-turn Open Library
conversations re-send it with each request.
`chat_type` picks the agent: `general`/`project` (org or project
knowledge) or `safety` (the shared safety corpus — requires the
Safety Assistant to be enabled for the organization via Agent
Allocation, otherwise 403 AGENT_NOT_ENABLED). When omitted, the
agent is inferred from the message among the agents enabled for the
organization.
Authentication
AuthorizationBearer
Pyramid API key (prefix with “Bearer ”)
Request
This endpoint expects an object.
messageslist of objectsRequired
project_idstringOptionalformat: "uuid"
chat_idstringOptionalformat: "uuid"
chat_typeenumOptional
Allowed values:
modelenumOptional
Allowed values:
streambooleanOptionalDefaults to false
search_scopeenumOptional
Which corpus the query searches. Exclusive — one request searches one corpus.
- `project` — the given project's document chunks (`project_id` required).
- `org` — the organization's own org-level documents (`project_id` must be omitted).
- `open_library` — the shared Open Library corpus of Hong Kong government
engineering documents (`project_id` must be omitted). Requires the
`api.open_library` feature to be enabled for your organization.
When omitted, the scope is derived for backward compatibility: `project`
when `project_id` is present, `org` otherwise.
Allowed values:
Response
Chat response (JSON when stream=false, SSE when stream=true)
request_idstringformat: "uuid"
Server-generated per-request UUID. Also sent as X-Request-Id response header. Include in support tickets.
successany
dataobjectOptional
paginationobjectOptional
Present only on list endpoints. Top-level (not nested inside data).
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
Multi-turn conversational endpoint. Supports both synchronous JSON
responses and server-sent event (SSE) streaming via stream: true.
search_scope picks the corpus: project (project_id required),
org (the org’s own documents), or open_library (the shared Open
Library corpus — requires the api.open_library feature and cannot be
combined with chat_type). When omitted, the scope is derived from
project_id presence. Scope is per-request: multi-turn Open Library
conversations re-send it with each request.
chat_type picks the agent: general/project (org or project
knowledge) or safety (the shared safety corpus — requires the
Safety Assistant to be enabled for the organization via Agent
Allocation, otherwise 403 AGENT_NOT_ENABLED). When omitted, the
agent is inferred from the message among the agents enabled for the
organization.
Which corpus the query searches. Exclusive — one request searches one corpus.
project — the given project’s document chunks (project_id required).
org — the organization’s own org-level documents (project_id must be omitted).
open_library — the shared Open Library corpus of Hong Kong government
engineering documents (project_id must be omitted). Requires the
api.open_library feature to be enabled for your organization.
When omitted, the scope is derived for backward compatibility: project
when project_id is present, org otherwise.