AgentStack Docs

REST API: chat

Request synchronous or streaming chat responses from a backend service.

The Chat API offers a regular response endpoint and a streaming endpoint. Choose the regular form when your backend can wait for a complete response; choose streaming when it can forward progressive output to an authorized client while handling disconnects and backpressure. In either case, keep the AgentStack API key on the server and validate the caller before initiating a model-backed request.

Treat a chat request as billable, stateful work rather than a harmless probe. Bound user input, establish a timeout in your own service, and avoid automatically replaying a request after an ambiguous network failure unless your workflow can tolerate a second response. If you expose streaming to a browser, proxy it through your backend instead of giving the browser direct key access.

Use the generated reference for the exact message and agent parameters. For an embedded visitor experience, prefer the supported widget; for an internal tooling workflow, use the REST envelope, rate-limit headers, and error codes described in the REST guides.