Skip to main content
The same published agent that answers the phone also answers over text. There are two ways to drive a chat from your backend: the session API (durable conversations you create, message, and end) and an OpenAI-compatible completions endpoint (a drop-in for any client that already speaks the OpenAI chat shape).

Sessions

A session is a server-side conversation tied to one agent. Create it, post messages, and end it when done. History is reconstructed for you, so you can fetch the full transcript any time. Posting a message with stream: true returns Server-Sent Events (SSE) — token deltas, tool calls, and knowledge retrievals arrive as they happen, terminating with an event: done (or event: error) frame. With stream: false you get the assembled messages in one JSON response.

OpenAI-compatible completions

POST /chat/completions accepts the OpenAI request shape — set model to the agent’s id. Point an existing OpenAI SDK at the base URL https://builder.flowyte.com/api/v1 and it works with only a base-URL swap.
When stream: true, this endpoint emits OpenAI-style SSE chunks (data: {choices:[{delta:…}]}) ending with data: [DONE].

In the API

These endpoints use your secret key. To put chat in a browser without exposing a secret, use a publishable key and the Embeddable Widget.