Guide

Build a Chatbot UI

This guide walks through a minimal OpenAI-compatible chat UI, token streaming, and retry handling with POST /v1/chat/completions.

1. Create a chat layout with message history and prompt input.

2. Send requests to CLEX with your model ID and messages array.

3. Stream Server-Sent Events and append delta tokens to the assistant bubble.

4. Add error/retry states and a fallback model for resilience.

Back to Docs