Skip to content
Star

Local and simple APIs

Render messages from your app or connect a plain-text stream.

Choose JSON or a text stream

If your app already has message records, render them directly from your existing store. Use the external store example if you also need commands that check the current conversation.

For a plain UTF-8 stream, install the view dependencies and add the tested AI SDK packages.

Install dependencies

Pass TextStreamChatTransport to the hook. Choose a structured protocol if your interface needs tools, files, or other UI data.

simple-text-api.tsx

Connect a Composer or application input to runtime.controller.send({ text, attachments: [] }); use its guarded stop command and handle rejected commands. The SDK supplies message assembly and cancellation. Supply custom transport request options for authentication and request-body policy rather than hiding them in Ghost.

Upgrade only when needed

Plain text has no tool or artifact schema. Move to current UI-message SSE, AG-UI or full agent state when those contracts solve an actual need. Do not guess a stream format from a successful response or copy a bespoke parser into the view.