Skip to main content
Let’s build a chat UI that talks to your Chowder instance. We’ll use Next.js with TypeScript, but the patterns here work with any framework — the Chowder API is just REST. By the end, you’ll have a working chat interface with session support and model selection.
This guide shows the key pieces, not a full copy-paste app. For a complete working implementation, check the example/ folder in the Chowder repo.

Prerequisites

  • A running Chowder instance (create one first)
  • A scoped API key with read and interact permissions (create one)
  • Node.js 18+ and a Next.js project
Never use your organization key (chd_org_...) in frontend code. It has full admin access. Always use a scoped key (chd_sk_...) with the minimum permissions needed.

Putting it all together

Here’s how you’d wire this into a Next.js page:
app/chat/page.tsx

Full example

The patterns above cover the essentials, but a production app needs more — loading states, scroll management, localStorage persistence, keyboard shortcuts, and proper styling. Check out the complete working example in the repo:
The example uses Next.js 15, shadcn/ui components, and localStorage for session persistence. Clone it, drop in your env vars, and you’ve got a full dashboard.

Architecture tips

Call the Chowder API directly from the browser using a scoped key. This is what the example app does.Pros: Simple, no backend needed, instant setup.Cons: API key is visible in browser DevTools (that’s why you use a scoped key with minimal permissions).

What’s next?

Scoped API Keys

Learn more about creating and managing keys for your frontend.

Install Skills

Give your agent capabilities that your chat UI can leverage.