Get hands-on

Explore our examples hub

Live demos

API Documentation

OpenAI-compatible API for generating interactive UI components from natural language prompts.

v1.0.0OpenAI CompatibleStreaming Support

Getting Started

Start generating UI in minutes with the N4i API

1. Get Your API Key

For development, use the default key: n4i-dev-key

In production, set N4I_API_KEYS environment variable.

2. Make Your First Request

curl -X POST http://localhost:3000/api/v1/embed \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer n4i-dev-key" \
  -d '{
    "model": "n4i-default",
    "messages": [{"role": "user", "content": "Create a dashboard with sales metrics"}],
    "stream": false
  }'

3. Render the UI

import { N4iRenderer } from "@/lib/n4i";

function MyComponent({ uiTree }) {
  return (
    <N4iRenderer 
      tree={uiTree} 
      onAction={(actionId, nodeId) => console.log(actionId, nodeId)}
    />
  );
}

📚 Interactive Examples

Explore comprehensive examples with live demos, code snippets, and best practices.

N4i API - Generative UI for AI-native applications