API Reference

API Reference

Use the API to analyze prompts and generate playable HTML5 games with the same model routing as the dashboard.

Base URL

https://ai-game-generator.com/api

Authentication

  • Create an API key in Settings → API Keys.
  • Send it via x-api-key or Authorization: Bearer <key>.

Provider selection

  • Optional provider field for both endpoints.
  • Supported values: auto, zhipu, deepseek, minimax, ark, openrouter, openai, siliconflow.
  • Model IDs are configured server-side (for example OPENAI_MODEL=gpt-5.3-codex).

Endpoints

POST /game/analyze-intent

Analyze a game idea and return an enhanced prompt.

Request

{
  "prompt": "A neon runner game with simple controls",
  "provider": "auto"
}

Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "analysis": {
      "gameType": "arcade",
      "genre": "neon runner",
      "coreGameplay": "...",
      "features": ["..."],
      "difficulty": "medium",
      "enhancedPrompt": "..."
    },
    "provider": "zhipu",
    "model": "glm-4.7",
    "analyzedAt": "2026-02-06T06:00:00.000Z"
  }
}

POST /game/generate

Generate a playable HTML5 game.

Request

{
  "type": "arcade",
  "prompt": "Use the enhancedPrompt returned from analyze-intent",
  "usePrebuilt": false,
  "forceRegenerate": true,
  "provider": "auto"
}

Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "success": true,
    "gameCode": "<!DOCTYPE html>...",
    "gameInfo": {
      "provider": "openai",
      "model": "gpt-5.3-codex",
      "isPrebuilt": false,
      "generatedAt": "2026-02-06T06:00:00.000Z"
    }
  }
}

OpenClaw

For OpenClaw / Clauwbot / Moltbook tool definitions and examples, visit /openclaw.