Skip to content

13 articles

API reference

The REST API: keys, authentication, the streaming chat endpoint, every event and error code, rate limits, request ids and the workflows API.

  1. API overviewWhat the SentientOne API does, its base URL, the endpoints you'll use and how requests, streams and errors fit together.Reference2 min
  2. API keys: secret and publishableThe two kinds of SentientOne key, where to find them, where each one may be used, and what to do if a secret key leaks.Reference2 min
  3. Test requests on the API keys pageSend a real request to any of your agents from the app, watch the events stream in, and copy ready-made cURL, TypeScript or Python.Guide2 min
  4. AuthenticationThe headers every API call needs: X-Api-Key and X-Agent-Id, plus the optional X-Llm-Key, X-Request-Id and X-Perf-Timing.Reference2 min
  5. POST /v1/chat/streamThe chat endpoint field by field: request body, limits, what the agent does with each request and how the streamed reply ends.Reference2 min
  6. Streaming eventsEvery server-sent event the chat stream can send, in order, with each field, plus how to parse the stream safely.Reference3 min
  7. Conversations and historyHow conversation_id works, how much history the model sees, and where conversations from every channel show up.Reference1 min
  8. Errors and error codesThe error envelope, every error code the chat, widget, workflow and ingest endpoints return, its HTTP status and what to do about it.Reference3 min
  9. Rate limitsPer-agent requests per minute, widget limits per key and per visitor, workflow limits, the X-RateLimit headers and how to retry.Reference1 min
  10. Request ids and correlationSend X-Request-Id and follow one request through the API, its trace, error reports, your model provider, MCP servers and webhooks.Reference1 min
  11. Latency and performanceMeasured timings for a reply, what SentientOne does to keep them low (caches, hedged calls, retries) and how to time your own requests.Reference2 min
  12. Workflows APIStart live runs of published workflows with POST /v1/workflows/run or a webhook, read step events, and handle run errors.Reference2 min
  13. Code examplesCopy-ready examples: cURL, a Node stream reader, a Next.js route that keeps your key server-side, and async Python with conversations.Guide4 min
Next topicMCP toolsConnect agents to your Model Context Protocol servers so they can call your APIs in the middle of an answer.

Still stuck?

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

support@sentientone.ai