REST API
One POST endpoint, three headers, JSON in / Server-Sent Events out. The platform handles system prompt injection, conversation history, MCP tool round-trips, and response storage.
The whole API in one request
X-Api-Key
X-Agent-Id
Content-Type
{
"message": "Hello, agent!",
"conversation_id": null
}curl -N -X POST https://api.sentientone.ai/v1/chat/stream \
-H "Content-Type: application/json" \
-H "X-Api-Key: sk-so-YOUR_KEY" \
-H "X-Agent-Id: YOUR_AGENT_ID" \
-d '{ "message": "Hello!" }'
# Server-Sent Events stream back, one event per "data:" line:
# data: {"type":"meta","conversation_id":"...","trace_id":"..."}
# data: {"type":"sources","sources":[{"index":1,"id":"...","title":"...","url":"...","source_type":"...","score":0.9,"snippet":"..."}]}
# data: {"type":"delta","content":"Hello"}
# data: {"type":"delta","content":", how can I help?"}
# data: {"type":"done","conversation_id":"...","trace_id":"..."}
#
# Concatenate every delta "content" to assemble the full answer.That's it. X-Api-Key authenticates your account; X-Agent-Id selects which configured agent runs the request; the body carries the user's message and (optionally) the conversation id you want to continue.
What to read
Authentication
Headers, key formats, and where to find each value.
Read moreChat Endpoint
Request body fields, the Server-Sent Events response shape, and multi-turn handling.
Read moreStreaming
Parsing the SSE event stream for progressive token delivery.
Read moreError Codes
Every error the platform can return — with fixes.
Read moreRate Limits
Per-account quotas, response headers, and retry strategy.
Read morePerformance
Prompt caching, auto-retries, token optimization.
Read moreCode Examples
Drop-in snippets — Python, JavaScript, TypeScript, C#, cURL.
Read moreTry before you wire