Agent Interface

Quickstart

Scaffold a streaming Agent Interface application connected to your model provider.

The OpenUI CLI can scaffold a Next.js agent application with Agent Interface, an OpenUI renderer, and a server route for model generation.

1. Create the application

Run the command with the self-hosted template to connect your own OpenAI-compatible provider:

pnpx @openuidev/cli@latest create --template openui-self-hosted

2. Configure your provider key

Enter your provider key when prompted, or add it to the generated environment file:

OPENAI_API_KEY=sk-your-key-here

The key stays in the generated server route. Browser code calls your application and never receives this server credential.

3. Run

pnpm dev

Open http://localhost:3000 and request an interface such as a comparison table or interactive form.

4. Share a preview

Deploy a Vercel preview from the project directory:

pnpx @openuidev/cli@latest deploy

Allowlisted keys from .env, such as OPENAI_API_KEY, are passed to the deployment.

On this page