Skip to content

API reference

API overview

What the SentientOne API does, its base URL, the endpoints you'll use and how requests, streams and errors fit together.

Reference2 min readUpdated 23 October 2026

Every agent you build answers on one streaming endpoint. Your server sends a message with your secret key and the agent's id, and reads the reply as server-sent events: the sources the agent found, the tools it called, the answer as it is written, and the token usage at the end. The same API also runs workflows and adds knowledge.

Base URL and format

Value
Base URLhttps://api.sentientone.ai
Request bodiesJSON (Content-Type: application/json), except file uploads (multipart)
Chat repliestext/event-stream, one data: line per event
ErrorsOne JSON envelope: {"error": {"code", "message", "request_id"}}
OpenAPIhttps://api.sentientone.ai/docs (Swagger UI) and /redoc
HealthGET /health returns {"status": "ok"}; GET /status adds the version
CORSAll origins are allowed, but secret keys must never be used from a browser

Endpoints

Method and pathAuthWhat it does
POST /v1/chat/streamX-Api-Key + X-Agent-IdChat with an agent; streams the reply. See Chat stream
POST /v1/workflows/runX-Api-KeyStart a live run of a published workflow. See Workflows API
POST /v1/ingest/documentX-Api-Key + X-Agent-IdAdd a PDF or text file to an agent's knowledge (50 MB max)
POST /v1/ingest/websiteX-Api-Key + X-Agent-IdCrawl a website into knowledge
POST /v1/ingest/snippet, /v1/ingest/qaX-Api-Key + X-Agent-IdAdd a snippet or a Q&A pair
DELETE /v1/ingest/sourceX-Api-Key + X-Agent-IdRemove a source and its chunks
GET /v1/traces, /v1/traces/{trace_id}X-Api-KeyList and read your traces
GET /v1/analytics/summary, /v1/analytics/agents/{id}X-Api-KeyLatency, tokens and errors over 24h, 7d, 30d or 90d
POST /v1/widget/chat/streamX-Widget-KeyUsed by the website widget only. See Publishable keys

The knowledge endpoints are described in Add knowledge through the API. Chat is streaming only: there is no endpoint that returns the whole reply as one JSON object, so read the stream and join the delta events.

What happens on a chat request

  1. The API checks your secret key and that the agent belongs to your account.
  2. It checks the agent's requests-per-minute limit and spends 1 credit (refunded if the reply fails).
  3. It opens the stream and sends meta with the conversation id and trace id.
  4. If the agent has knowledge, it runs hybrid search and sends sources before the first word.
  5. The model answers; if it calls MCP tools you get tool_call and tool_result events, for up to 8 rounds.
  6. The answer arrives as delta events, then done with the token usage. A failure ends the stream with an error event instead.

Headers you'll see

Response headerMeaning
X-Request-IdYour correlation id, or one the API made. See Request ids
X-Trace-IdThe request's trace in Tracing
X-RateLimit-Limit, -Remaining, -ResetThe agent's rate-limit window (chat). See Rate limits
X-Workflow-Run-IdThe run id (workflow runs)
Server-TimingTime spent in the API and upstream, for your browser's dev tools

Start here

New to the API? Follow the quickstart, then copy a sample from Code examples.

Still stuck?

Email us with what you tried and any request id. A person replies.

support@sentientone.ai