ComponentGPT

ComponentGPT · Ações GPT

Patterns API

API for creating and managing patterns

  • POST /gpt/createCreate a new pattern

    Creates a new pattern based on the provided prompt

Esquema API original
{
  "openapi": "3.1.0",
  "info": {
    "title": "Patterns API",
    "version": "1.0.0",
    "description": "API for creating and managing patterns"
  },
  "servers": [
    {
      "url": "https://www.api.magicpatterns.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/gpt/create": {
      "post": {
        "operationId": "createNewPattern",
        "summary": "Create a new pattern",
        "description": "Creates a new pattern based on the provided prompt",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The prompt to generate the pattern from"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pattern created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "patternId": {
                      "type": "string",
                      "description": "The ID of the created pattern"
                    },
                    "url": {
                      "type": "string",
                      "description": "The URL to access the pattern editor"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}