{
  "openapi": "3.1.0",
  "info": {
    "title": "VXLVERSE Game Maker",
    "version": "1.0.0",
    "description": "Check a VXLVERSE game written in VXLScript and get a short link that opens it, ready to play, in the 3D editor at vxlverse.com. The language is documented at https://vxlverse.com/llms.txt."
  },
  "servers": [{ "url": "https://vxlverse.com" }],
  "paths": {
    "/api/make": {
      "post": {
        "operationId": "makeGame",
        "summary": "Check a VXLScript game and get a link to play it",
        "description": "Send the WHOLE game as plain VXLScript text. If ok is true, give the user the link (and show the script in a code block). If ok is false, fix the errors in order and call again with the whole corrected script; never give the user a link before ok is true.",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["script"],
                "properties": {
                  "script": {
                    "type": "string",
                    "description": "The whole game as plain VXLScript text, starting with its Title: line. No code fence needed."
                  },
                  "lang": {
                    "type": "string",
                    "enum": ["en", "es", "fr", "de", "el"],
                    "description": "The language the user writes in, for the site around the game (the script itself stays in English). Default en."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The check's answer: a link when ok is true, the errors to fix when ok is false.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MakeResult" } } }
          },
          "400": {
            "description": "No script was sent.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MakeResult" } } }
          },
          "413": {
            "description": "The script is too long.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MakeResult" } } }
          },
          "429": {
            "description": "Too many requests; wait a few seconds and call again.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MakeResult" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MakeResult": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean", "description": "true = the game builds and can be won; give the user the link." },
          "link": { "type": "string", "description": "Opens the game in the 3D editor at vxlverse.com (only when ok is true)." },
          "title": { "type": "string", "description": "The game's Title: line." },
          "errors": { "type": "array", "items": { "type": "string" }, "description": "What stops the game from building or being won, most important first (only when ok is false)." },
          "warnings": { "type": "array", "items": { "type": "string" }, "description": "Lines the game understood only in part. The game still works; fix them if they matter to the story." },
          "next": { "type": "string", "description": "What to do with this answer." }
        }
      }
    }
  }
}
