OpenClaw-ready game generation API

Wire OpenClaw / Clauwbot / Moltbook agents to AI Game Generator using API keys and a simple analyze → generate flow. Route to GLM-4.7, DeepSeek, or OpenAI (GPT-5.4 configurable).

Built for agent workflows

Keep the flow deterministic for toolchains and reusable prompts.

API key authentication

Use x-api-key or Authorization: Bearer for all tool calls.

Analyze → generate pipeline

Intent analysis returns enhancedPrompt, then generate produces HTML5 code.

Single-file HTML5 output

Game output is a complete HTML file you can store or deploy.

Recommended workflow

1

Step 1

Create an API key in Settings → API Keys.

2

Step 2

Call /api/game/analyze-intent with the user prompt to get enhancedPrompt.

3

Step 3

Call /api/game/generate with enhancedPrompt to produce HTML5 code.

4

Step 4

Store the HTML output, preview, and publish when ready.

FAQ




Tool definitions & API examples

Tool definitions

Keywords to target: Clauwbot, Moltbook, openclaw.

Example tool: analyze intent

{
  "name": "game_analyze_intent",
  "description": "Analyze a game idea and return enhancedPrompt",
  "method": "POST",
  "url": "https://YOUR_DOMAIN/api/game/analyze-intent",
  "headers": {
    "x-api-key": "YOUR_API_KEY"
  },
  "body": {
    "prompt": "{{prompt}}",
    "provider": "auto",
    "model": "auto"
  }
}

Example tool: generate game

{
  "name": "game_generate",
  "description": "Generate a playable HTML5 game",
  "method": "POST",
  "url": "https://YOUR_DOMAIN/api/game/generate",
  "headers": {
    "x-api-key": "YOUR_API_KEY"
  },
  "body": {
    "type": "arcade",
    "prompt": "{{enhancedPrompt}}",
    "usePrebuilt": false,
    "forceRegenerate": true
  }
}

cURL quick test

curl -X POST "https://YOUR_DOMAIN/api/game/analyze-intent" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"prompt":"A neon runner game with simple controls"}'

The response contains enhancedPrompt. Pass it into /api/game/generate to obtain the full HTML5 file.

OpenClaw Game Generator API | OpenClaw tools for AI Game Generator