UIGPT - Generate. Render. Preview.

UIGPT - Generate. Render. Preview. · Actions GPT

UI Component Rendering API

API to render React components and return images

  • POST /api/renderRender a React component and return an image
Schéma original API
{
  "openapi": "3.0.0",
  "info": {
    "title": "UI Component Rendering API",
    "description": "API to render React components and return images",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://uigpt.dev"
    }
  ],
  "paths": {
    "/api/render": {
      "post": {
        "operationId": "renderComponent",
        "summary": "Render a React component and return an image",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "React component code as a string"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image of rendered component",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image": {
                      "type": "string",
                      "description": "Base64 encoded image string"
                    },
                    "url": {
                      "type": "string",
                      "description": "URL to preview the rendered component"
                    }
                  },
                  "required": [
                    "image",
                    "url"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}