showcase/shell-docs/src/content/docs/generative-ui/open-json-ui.mdx
Open-JSON-UI is an open standardization of OpenAI's internal declarative Generative UI schema, designed to enable agents to generate structured user interfaces.
Open-JSON-UI is OpenAI's contribution to the generative UI ecosystem. It provides:
As the standardization of OpenAI's internal schema, Open-JSON-UI works seamlessly with OpenAI's tools and models, providing a familiar interface for developers already using OpenAI services.
The specification provides clear, type-safe definitions for UI components, making it easier to validate and render agent-generated interfaces.
Backed by OpenAI, this specification is becoming an industry standard for declarative generative UI, ensuring long-term support and community adoption.
CopilotKit's AG-UI protocol natively supports Open-JSON-UI alongside other generative UI specifications.
// Example: Agent returns Open-JSON-UI specification
{
type: "open-json-ui",
spec: {
components: [
{
type: "card",
properties: {
title: "Data Visualization",
content: {...}
}
}
]
}
}
Open-JSON-UI provides a well-defined schema for component definitions:
{
"version": "1.0",
"components": [
{
"id": "main-container",
"type": "container",
"children": [
{
"type": "text",
"content": "Hello World",
"style": {
"fontSize": "large",
"color": "primary"
}
}
]
}
]
}
Strong typing ensures that generated UI components are valid and can be properly rendered:
interface OpenJsonUIComponent {
id?: string;
type: ComponentType;
properties?: Record<string, any>;
children?: OpenJsonUIComponent[];
style?: StyleProperties;
}
The schema is designed to be easily generated by OpenAI's language models, with patterns that align with their training.
| Feature | Open-JSON-UI | A2UI | MCP Apps |
|---|---|---|---|
| Format | JSON | JSONL | HTML/Iframe |
| Streaming | Limited | Native | Limited |
| Type Safety | Strong | Moderate | Flexible |
| Platform | Agnostic | Agnostic | Web-focused |