API 参考
API 参考
通过 API 可完成提示词意图分析与 HTML5 游戏生成,模型路由与前台保持一致。
Base URL
https://ai-game-generator.com/api认证方式
- 在 Settings → API Keys 中创建 API Key。
- 请求头支持
x-api-key或Authorization: Bearer <key>。
Provider 选择
- 两个接口都支持可选字段
provider。 - 可选值:
auto、zhipu、deepseek、minimax、ark、openrouter、openai、siliconflow。 - 模型型号由服务端配置(例如
OPENAI_MODEL=gpt-5.3-codex)。
接口列表
POST /game/analyze-intent
分析游戏意图,返回 enhancedPrompt。
请求示例
{
"prompt": "一个霓虹跑酷游戏,操作简单",
"provider": "auto"
}响应示例
{
"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
生成可试玩的 HTML5 游戏。
请求示例
{
"type": "arcade",
"prompt": "使用 analyze-intent 的 enhancedPrompt",
"usePrebuilt": false,
"forceRegenerate": true,
"provider": "auto"
}响应示例
{
"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
OpenClaw / Clauwbot / Moltbook 的工具定义与示例见 /openclaw。
Free AI Game Maker 2025: Create Games Without Code
Discover the best free AI game maker tools to create games without coding. Complete guide to AI game development, from text to playable games in minutes.
Free AI Roleplay Tools 2025: No-Cost Interactive Storytelling Platforms
Discover the best free AI roleplay tools and platforms for interactive storytelling, character creation, and immersive roleplaying experiences without spending money.