{"openapi":"3.1.0","info":{"title":"Rengi Forge","version":"0.1.0","description":"Pay-per-call tools for AI agents building games. Paid routes use x402: call, receive HTTP 402 with payment requirements, pay in USDC, retry. Networks: Base, Solana."},"servers":[{"url":"https://rengi.dev"}],"paths":{"/v1/level-design/catalog":{"post":{"operationId":"level-design_post_catalog","summary":"Ingest your prop catalog: footprint, height, pivot and category computed from each GLB. Returns a catalogId for place.","tags":["level-design"],"x-price-usd":"0.50","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"catalogId":{"type":"string"},"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"footprint":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}},"footprintRadius":{"type":"number"},"height":{"type":"number"},"pivotOffset":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"],"additionalProperties":false},"hasMesh":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","category","footprint","footprintRadius","height","pivotOffset","hasMesh","tags"],"additionalProperties":false}},"cached":{"type":"boolean"}},"required":["catalogId","assets","cached"],"additionalProperties":false},"example":{"catalogId":"cat_0123456789abcdef0123","cached":false,"assets":[{"id":"house_small","category":"house","footprint":[[-2.3,-2.8],[2.3,-2.8],[2.3,2.8],[-2.3,2.8]],"footprintRadius":3.62,"height":5,"pivotOffset":{"x":0,"y":0,"z":0},"hasMesh":true,"tags":[]}]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.50 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120,"description":"Your prefab / asset name. Placements refer to it."},"glb":{"type":"string","description":"Base64 GLB. Footprint, height and pivot are computed from the mesh."},"glbUrl":{"type":"string","format":"uri","description":"URL of a GLB, used when glb is not given."},"bounds":{"type":"object","properties":{"min":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"max":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]}},"required":["min","max"],"additionalProperties":false,"description":"Meters, model space, Y up. Used only when no mesh is given."},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"],"description":"Overrides automatic classification."},"tags":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":20}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":300},"upAxis":{"type":"string","enum":["y","z"],"default":"y"}},"required":["assets"],"additionalProperties":false},"example":{"assets":[{"id":"house_small","glbUrl":"https://rengi.dev/samples/house_small.glb"},{"id":"pine","bounds":{"min":[-1.5,0,-1.5],"max":[1.5,6,1.5]},"category":"tree"}]}}}}}},"/v1/level-design/place":{"post":{"operationId":"level-design_post_place","summary":"Dress a level: placements for every zone, previews and a 3D viewer link.","tags":["level-design"],"x-price-usd":"1.00","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"engine":{"type":"string","enum":["unity","threejs"]},"coordinates":{"type":"string"},"planner":{"type":"string","enum":["model","preset","given"]},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}},"area":{"type":"number"}},"required":["id","kind","polygon","area"],"additionalProperties":false}},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"density":{"type":"number","minimum":0,"maximum":1},"minSpacing":{"type":"number","minimum":0,"maximum":50},"falloff":{"type":"object","properties":{"from":{"type":"string","enum":["edge","point"]},"point":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["from","strength"],"additionalProperties":false}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":60},"center":{"anyOf":[{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}]},{"type":"string","const":"random"}],"default":"random"}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"offset":{"type":"array","minItems":2,"maxItems":2,"items":false,"description":"Distance inside the zone edge, meters [min, max].","prefixItems":[{"type":"number","minimum":0},{"type":"number","minimum":0}]},"spacing":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}]},"facing":{"type":"string","enum":["along","toward","away","random"],"default":"along"}},"required":["kind","offset","spacing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ring"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"center":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"radius":{"type":"number","exclusiveMinimum":0,"maximum":80},"count":{"type":"integer","minimum":1,"maximum":60},"facing":{"type":"string","enum":["inward","outward"],"default":"inward"}},"required":["kind","radius","count"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lot"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"asset":{"type":"string"},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"yawDeg":{"type":"number"}},"required":["kind"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false},"placements":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string"},"zoneId":{"type":"string"},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"],"additionalProperties":false},"rotation":{"type":"object","properties":{"quaternion":{"type":"array","minItems":4,"maxItems":4,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}]},"eulerDeg":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"],"additionalProperties":false}},"required":["quaternion","eulerDeg"],"additionalProperties":false},"scale":{"type":"number"}},"required":["assetId","zoneId","position","rotation","scale"],"additionalProperties":false}},"stats":{"type":"object","properties":{"total":{"type":"number"},"byCategory":{"type":"object","additionalProperties":{"type":"number"}},"overlaps":{"type":"number"},"reachable":{"type":"boolean"},"removedForReachability":{"type":"array","items":{"type":"string"}}},"required":["total","byCategory","overlaps","reachable","removedForReachability"],"additionalProperties":false},"previews":{"type":"object","properties":{"topDown":{"type":"string"},"perspective":{"type":"string"},"ground":{"type":"string"}},"required":["topDown","perspective"],"additionalProperties":false},"viewer":{"type":"string"},"sceneJson":{"type":"string"},"diff":{"type":"object","properties":{"added":{"type":"number"},"removed":{"type":"number"},"moved":{"type":"number"},"kept":{"type":"number"}},"required":["added","removed","moved","kept"],"additionalProperties":false}},"required":["jobId","engine","coordinates","planner","zones","plan","placements","stats","previews","viewer","sceneJson"],"additionalProperties":false},"example":{"jobId":"job_ac27f34abec846dc9130","engine":"unity","coordinates":"Unity (left-handed, Y up). Map spans x 0..width, z 0..-depth: the top-down map's z axis is flipped so north stays +Z. Rotation is yaw about Y; asset forward = local +Z.","planner":"preset","zones":[{"id":"road-ew","kind":"road","polygon":[[0,53],[100,53],[100,47],[0,47]],"area":564},{"id":"road-ns","kind":"road","polygon":[[47,0],[47,100],[53,100],[53,0]],"area":600},{"id":"market","kind":"plaza","polygon":[[56,30],[76,30],[76,46],[56,46]],"area":320},{"id":"forest-nw","kind":"forest","polygon":[[2,2],[44,2],[44,26],[30,40],[2,44]],"area":1529.6},{"id":"field-se","kind":"field","polygon":[[60,62],[96,62],[96,94],[60,94]],"area":1152},{"id":"field-sw","kind":"field","polygon":[[8,62],[40,62],[40,90],[8,90]],"area":888},{"id":"lot-1","kind":"building-lot","polygon":[[80,34],[92,34],[92,46],[80,46]],"area":144},{"id":"lot-2","kind":"building-lot","polygon":[[56,6],[68,6],[68,18],[56,18]],"area":144},{"id":"lot-3","kind":"building-lot","polygon":[[36,54],[46,54],[46,64],[36,64]],"area":100},{"id":"lot-4","kind":"building-lot","polygon":[[54,54],[64,54],[64,60],[54,60]],"area":60},{"id":"lot-5","kind":"building-lot","polygon":[[22,38],[34,38],[34,46],[22,46]],"area":96},{"id":"spawn-w","kind":"spawn","polygon":[[0,44],[8,44],[8,56],[0,56]],"area":48}],"plan":{"zones":[{"zoneId":"market","rules":[{"kind":"anchor","asset":"well","at":"centroid"},{"kind":"ring","assets":["market_stall"],"center":"centroid","radius":4.4,"count":5,"facing":"inward"},{"kind":"along","assets":["lamp_post"],"offset":[0.6,1.2],"spacing":[9,12],"facing":"toward"}]},{"zoneId":"forest-nw","rules":[{"kind":"scatter","assets":["oak","pine"],"density":0.6,"falloff":{"from":"edge","strength":0.5}},{"kind":"scatter","assets":["bush"],"density":0.12},{"kind":"cluster","assets":["rock"],"clusters":2,"count":3,"radius":3,"center":"random"}]},{"zoneId":"field-se","rules":[{"kind":"along","assets":["fence"],"offset":[0.35,0.35],"spacing":[2.08,2.08],"facing":"toward"},{"kind":"scatter","assets":["bush"],"density":0.04}]},{"zoneId":"field-sw","rules":[{"kind":"along","assets":["fence"],"offset":[0.35,0.35],"spacing":[2.08,2.08],"facing":"toward"},{"kind":"scatter","assets":["bush"],"density":0.04}]},{"zoneId":"lot-1","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-2","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-3","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-4","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-5","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"spawn-w","rules":[{"kind":"ring","assets":["lamp_post"],"center":"centroid","radius":2,"count":2,"facing":"inward"}]},{"zoneId":"open","rules":[{"kind":"scatter","assets":["oak","pine"],"density":0.1},{"kind":"scatter","assets":["bush"],"density":0.07},{"kind":"scatter","assets":["rock"],"density":0.03}]}],"notes":"preset plan: fantasy-village"},"placements":[{"assetId":"well","zoneId":"market","position":{"x":66.4794,"y":0,"z":-40.7875},"rotation":{"quaternion":[0,0,0,1],"eulerDeg":{"x":0,"y":0,"z":0}},"scale":1},{"assetId":"house_small","zoneId":"lot-1","position":{"x":86,"y":0,"z":-40},"rotation":{"quaternion":[0,0,0,1],"eulerDeg":{"x":0,"y":0,"z":0}},"scale":1},{"assetId":"house_large","zoneId":"lot-2","position":{"x":62,"y":0,"z":-12},"rotation":{"quaternion":[0,0.707107,0,0.707107],"eulerDeg":{"x":0,"y":90,"z":0}},"scale":1},{"assetId":"tavern","zoneId":"lot-3","position":{"x":41,"y":0,"z":-59},"rotation":{"quaternion":[0,-0.707107,0,0.707107],"eulerDeg":{"x":0,"y":-90,"z":0}},"scale":1},{"assetId":"house_small","zoneId":"lot-4","position":{"x":59,"y":0,"z":-57},"rotation":{"quaternion":[0,0.707107,0,0.707107],"eulerDeg":{"x":0,"y":90,"z":0}},"scale":1}],"stats":{"total":295,"byCategory":{"prop":5,"house":5,"light":7,"fence":116,"rock":10,"tree":43,"bush":109},"overlaps":0,"reachable":true,"removedForReachability":[]},"previews":{"topDown":"https://rengi.dev/files/example/top-down.png","perspective":"https://rengi.dev/files/example/perspective.png","ground":"https://rengi.dev/files/example/ground.png"},"viewer":"https://rengi.dev/files/example/viewer.html","sceneJson":"https://rengi.dev/files/example/scene.json","note":"placements trimmed to 5 of 295 for the example"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $1.00 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"catalogId":{"type":"string"},"catalog":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120,"description":"Your prefab / asset name. Placements refer to it."},"glb":{"type":"string","description":"Base64 GLB. Footprint, height and pivot are computed from the mesh."},"glbUrl":{"type":"string","format":"uri","description":"URL of a GLB, used when glb is not given."},"bounds":{"type":"object","properties":{"min":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"max":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]}},"required":["min","max"],"additionalProperties":false,"description":"Meters, model space, Y up. Used only when no mesh is given."},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"],"description":"Overrides automatic classification."},"tags":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":20}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":300},"upAxis":{"type":"string","enum":["y","z"],"default":"y"}},"required":["assets"],"additionalProperties":false},"layout":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"zones"},"width":{"type":"number","exclusiveMinimum":0,"maximum":400,"description":"World size along x, meters."},"depth":{"type":"number","exclusiveMinimum":0,"maximum":400,"description":"World size along z, meters."},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":60},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"minItems":3,"maxItems":400,"description":"World meters (x, z). x right, z down on a top-down map."},"polyline":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":400,"description":"For roads and rivers: centerline plus width."},"width":{"type":"number","exclusiveMinimum":0,"maximum":100}},"required":["kind"],"additionalProperties":false},"maxItems":200},"requiredPoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"x":{"type":"number"},"z":{"type":"number"}},"required":["id","x","z"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["kind","width","depth","zones"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"image"},"image":{"type":"string","description":"Base64 PNG of a top-down sketch or map."},"imageUrl":{"type":"string","format":"uri"},"width":{"type":"number","exclusiveMinimum":0,"maximum":400},"depth":{"type":"number","exclusiveMinimum":0,"maximum":400},"requiredPoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"x":{"type":"number"},"z":{"type":"number"}},"required":["id","x","z"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["kind","width","depth"],"additionalProperties":false}]},"heightmap":{"type":"object","properties":{"image":{"type":"string","description":"Base64 grayscale PNG covering the whole map."},"imageUrl":{"type":"string","format":"uri"},"minHeight":{"type":"number","default":0},"maxHeight":{"type":"number"}},"required":["maxHeight"],"additionalProperties":false},"brief":{"type":"string","maxLength":4000,"default":""},"preset":{"type":"string","enum":["fantasy-village"],"default":"fantasy-village"},"density":{"type":"number","minimum":0,"maximum":1,"default":0.5},"seed":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":64}],"default":1},"targetEngine":{"type":"string","enum":["unity","threejs"],"default":"unity"},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"density":{"type":"number","minimum":0,"maximum":1},"minSpacing":{"type":"number","minimum":0,"maximum":50},"falloff":{"type":"object","properties":{"from":{"type":"string","enum":["edge","point"]},"point":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["from","strength"],"additionalProperties":false}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":60},"center":{"anyOf":[{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}]},{"type":"string","const":"random"}],"default":"random"}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"offset":{"type":"array","minItems":2,"maxItems":2,"items":false,"description":"Distance inside the zone edge, meters [min, max].","prefixItems":[{"type":"number","minimum":0},{"type":"number","minimum":0}]},"spacing":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}]},"facing":{"type":"string","enum":["along","toward","away","random"],"default":"along"}},"required":["kind","offset","spacing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ring"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"center":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"radius":{"type":"number","exclusiveMinimum":0,"maximum":80},"count":{"type":"integer","minimum":1,"maximum":60},"facing":{"type":"string","enum":["inward","outward"],"default":"inward"}},"required":["kind","radius","count"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lot"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"asset":{"type":"string"},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"yawDeg":{"type":"number"}},"required":["kind"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false,"description":"Optional: skip the planner and solve this plan exactly."}},"required":["layout"],"additionalProperties":false},"example":{"catalogId":"cat_0123456789abcdef0123","layout":{"kind":"zones","width":100,"depth":100,"zones":[{"id":"road-ew","kind":"road","polyline":[[0,50],[100,50]],"width":6},{"id":"market","kind":"plaza","polygon":[[56,30],[76,30],[76,46],[56,46]]},{"id":"lot-1","kind":"building-lot","polygon":[[80,34],[92,34],[92,46],[80,46]]}],"requiredPoints":[{"id":"spawn","x":3,"z":50},{"id":"market","x":66,"z":38}]},"brief":"Farming village, busy market square.","seed":7,"targetEngine":"unity"}}}}}},"/v1/level-design/revise":{"post":{"operationId":"level-design_post_revise","summary":"Change a placed level by instruction or structured zone edits: denser or sparser, other assets, remove a kind of prop; untouched zones keep their exact transforms. It cannot cut an empty area inside a zone or move one object: for that, add a keep-clear zone to the layout and place again.","tags":["level-design"],"x-price-usd":"0.50","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"engine":{"type":"string","enum":["unity","threejs"]},"coordinates":{"type":"string"},"planner":{"type":"string","enum":["model","preset","given"]},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}},"area":{"type":"number"}},"required":["id","kind","polygon","area"],"additionalProperties":false}},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"density":{"type":"number","minimum":0,"maximum":1},"minSpacing":{"type":"number","minimum":0,"maximum":50},"falloff":{"type":"object","properties":{"from":{"type":"string","enum":["edge","point"]},"point":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["from","strength"],"additionalProperties":false}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":60},"center":{"anyOf":[{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}]},{"type":"string","const":"random"}],"default":"random"}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"offset":{"type":"array","minItems":2,"maxItems":2,"items":false,"description":"Distance inside the zone edge, meters [min, max].","prefixItems":[{"type":"number","minimum":0},{"type":"number","minimum":0}]},"spacing":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}]},"facing":{"type":"string","enum":["along","toward","away","random"],"default":"along"}},"required":["kind","offset","spacing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ring"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"center":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"radius":{"type":"number","exclusiveMinimum":0,"maximum":80},"count":{"type":"integer","minimum":1,"maximum":60},"facing":{"type":"string","enum":["inward","outward"],"default":"inward"}},"required":["kind","radius","count"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lot"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"asset":{"type":"string"},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"yawDeg":{"type":"number"}},"required":["kind"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false},"placements":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string"},"zoneId":{"type":"string"},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"],"additionalProperties":false},"rotation":{"type":"object","properties":{"quaternion":{"type":"array","minItems":4,"maxItems":4,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}]},"eulerDeg":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"],"additionalProperties":false}},"required":["quaternion","eulerDeg"],"additionalProperties":false},"scale":{"type":"number"}},"required":["assetId","zoneId","position","rotation","scale"],"additionalProperties":false}},"stats":{"type":"object","properties":{"total":{"type":"number"},"byCategory":{"type":"object","additionalProperties":{"type":"number"}},"overlaps":{"type":"number"},"reachable":{"type":"boolean"},"removedForReachability":{"type":"array","items":{"type":"string"}}},"required":["total","byCategory","overlaps","reachable","removedForReachability"],"additionalProperties":false},"previews":{"type":"object","properties":{"topDown":{"type":"string"},"perspective":{"type":"string"},"ground":{"type":"string"}},"required":["topDown","perspective"],"additionalProperties":false},"viewer":{"type":"string"},"sceneJson":{"type":"string"},"diff":{"type":"object","properties":{"added":{"type":"number"},"removed":{"type":"number"},"moved":{"type":"number"},"kept":{"type":"number"}},"required":["added","removed","moved","kept"],"additionalProperties":false}},"required":["jobId","engine","coordinates","planner","zones","plan","placements","stats","previews","viewer","sceneJson"],"additionalProperties":false},"example":{"jobId":"job_fedcba9876543210fedc","engine":"unity","coordinates":"Unity (left-handed, Y up). Map spans x 0..width, z 0..-depth: the top-down map's z axis is flipped so north stays +Z. Rotation is yaw about Y; asset forward = local +Z.","planner":"preset","zones":[{"id":"road-ew","kind":"road","polygon":[[0,53],[100,53],[100,47],[0,47]],"area":564},{"id":"road-ns","kind":"road","polygon":[[47,0],[47,100],[53,100],[53,0]],"area":600},{"id":"market","kind":"plaza","polygon":[[56,30],[76,30],[76,46],[56,46]],"area":320},{"id":"forest-nw","kind":"forest","polygon":[[2,2],[44,2],[44,26],[30,40],[2,44]],"area":1529.6},{"id":"field-se","kind":"field","polygon":[[60,62],[96,62],[96,94],[60,94]],"area":1152},{"id":"field-sw","kind":"field","polygon":[[8,62],[40,62],[40,90],[8,90]],"area":888},{"id":"lot-1","kind":"building-lot","polygon":[[80,34],[92,34],[92,46],[80,46]],"area":144},{"id":"lot-2","kind":"building-lot","polygon":[[56,6],[68,6],[68,18],[56,18]],"area":144},{"id":"lot-3","kind":"building-lot","polygon":[[36,54],[46,54],[46,64],[36,64]],"area":100},{"id":"lot-4","kind":"building-lot","polygon":[[54,54],[64,54],[64,60],[54,60]],"area":60},{"id":"lot-5","kind":"building-lot","polygon":[[22,38],[34,38],[34,46],[22,46]],"area":96},{"id":"spawn-w","kind":"spawn","polygon":[[0,44],[8,44],[8,56],[0,56]],"area":48}],"plan":{"zones":[{"zoneId":"market","rules":[{"kind":"anchor","asset":"well","at":"centroid"},{"kind":"ring","assets":["market_stall"],"center":"centroid","radius":4.4,"count":5,"facing":"inward"},{"kind":"along","assets":["lamp_post"],"offset":[0.6,1.2],"spacing":[9,12],"facing":"toward"}]},{"zoneId":"forest-nw","rules":[{"kind":"scatter","assets":["oak","pine"],"density":0.6,"falloff":{"from":"edge","strength":0.5}},{"kind":"scatter","assets":["bush"],"density":0.12},{"kind":"cluster","assets":["rock"],"clusters":2,"count":3,"radius":3,"center":"random"}]},{"zoneId":"field-se","rules":[{"kind":"along","assets":["fence"],"offset":[0.35,0.35],"spacing":[2.08,2.08],"facing":"toward"},{"kind":"scatter","assets":["bush"],"density":0.04}]},{"zoneId":"field-sw","rules":[{"kind":"along","assets":["fence"],"offset":[0.35,0.35],"spacing":[2.08,2.08],"facing":"toward"},{"kind":"scatter","assets":["bush"],"density":0.04}]},{"zoneId":"lot-1","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-2","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-3","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-4","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"lot-5","rules":[{"kind":"lot","assets":["house_large","house_small","tavern"]}]},{"zoneId":"spawn-w","rules":[{"kind":"ring","assets":["lamp_post"],"center":"centroid","radius":2,"count":2,"facing":"inward"}]},{"zoneId":"open","rules":[{"kind":"scatter","assets":["oak","pine"],"density":0.1},{"kind":"scatter","assets":["bush"],"density":0.07},{"kind":"scatter","assets":["rock"],"density":0.03}]}],"notes":"preset plan: fantasy-village"},"placements":[{"assetId":"well","zoneId":"market","position":{"x":66.4794,"y":0,"z":-40.7875},"rotation":{"quaternion":[0,0,0,1],"eulerDeg":{"x":0,"y":0,"z":0}},"scale":1},{"assetId":"house_small","zoneId":"lot-1","position":{"x":86,"y":0,"z":-40},"rotation":{"quaternion":[0,0,0,1],"eulerDeg":{"x":0,"y":0,"z":0}},"scale":1},{"assetId":"house_large","zoneId":"lot-2","position":{"x":62,"y":0,"z":-12},"rotation":{"quaternion":[0,0.707107,0,0.707107],"eulerDeg":{"x":0,"y":90,"z":0}},"scale":1},{"assetId":"tavern","zoneId":"lot-3","position":{"x":41,"y":0,"z":-59},"rotation":{"quaternion":[0,-0.707107,0,0.707107],"eulerDeg":{"x":0,"y":-90,"z":0}},"scale":1},{"assetId":"house_small","zoneId":"lot-4","position":{"x":59,"y":0,"z":-57},"rotation":{"quaternion":[0,0.707107,0,0.707107],"eulerDeg":{"x":0,"y":90,"z":0}},"scale":1}],"stats":{"total":295,"byCategory":{"prop":5,"house":5,"light":7,"fence":116,"rock":10,"tree":43,"bush":109},"overlaps":0,"reachable":true,"removedForReachability":[]},"previews":{"topDown":"https://rengi.dev/files/example/top-down.png","perspective":"https://rengi.dev/files/example/perspective.png","ground":"https://rengi.dev/files/example/ground.png"},"viewer":"https://rengi.dev/files/example/viewer.html","sceneJson":"https://rengi.dev/files/example/scene.json","note":"placements trimmed to 5 of 295 for the example","diff":{"added":14,"removed":3,"moved":0,"kept":120}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.50 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"instruction":{"type":"string","maxLength":2000},"edits":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"density":{"type":"number","minimum":0,"maximum":1},"minSpacing":{"type":"number","minimum":0,"maximum":50},"falloff":{"type":"object","properties":{"from":{"type":"string","enum":["edge","point"]},"point":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["from","strength"],"additionalProperties":false}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":60},"center":{"anyOf":[{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}]},{"type":"string","const":"random"}],"default":"random"}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"offset":{"type":"array","minItems":2,"maxItems":2,"items":false,"description":"Distance inside the zone edge, meters [min, max].","prefixItems":[{"type":"number","minimum":0},{"type":"number","minimum":0}]},"spacing":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}]},"facing":{"type":"string","enum":["along","toward","away","random"],"default":"along"}},"required":["kind","offset","spacing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ring"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."},"center":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"radius":{"type":"number","exclusiveMinimum":0,"maximum":80},"count":{"type":"integer","minimum":1,"maximum":60},"facing":{"type":"string","enum":["inward","outward"],"default":"inward"}},"required":["kind","radius","count"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lot"},"assets":{"type":"array","items":{"type":"string"},"description":"Asset ids."},"categories":{"type":"array","items":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"description":"Pick from the catalog by category."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"asset":{"type":"string"},"category":{"type":"string","enum":["house","tree","rock","bush","fence","wall","prop","light","path","water","other"]},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"},"yawDeg":{"type":"number"}},"required":["kind"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":50}},"required":["jobId"],"additionalProperties":false},"example":{"jobId":"job_0123456789abcdef0123","instruction":"make the market denser"}}}}}},"/v1/level-design/place-2d":{"post":{"operationId":"level-design_post_place_2d","summary":"Fill a 2D tilemap: terrain with proper corner transitions, decorations, obstacles and multi-tile stamps; Tiled .tmj, Unity Tilemap JSON and a preview.","tags":["level-design"],"x-price-usd":"1.00","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"planner":{"type":"string","enum":["model","preset","given"]},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"density":{"type":"number","minimum":0,"maximum":1}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"inset":{"type":"integer","minimum":0,"maximum":10,"default":0},"spacing":{"type":"integer","minimum":1,"maximum":20,"default":1}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":40}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stamp"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"count":{"type":"integer","minimum":1,"maximum":30,"default":1,"description":"Stamps per zone; building lots usually take 1."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"name":{"type":"string"},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"}},"required":["kind","name"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}}},"required":["id","kind","polygon"],"additionalProperties":false}},"layers":{"type":"object","properties":{"ground":{"type":"array","items":{"type":"integer"}},"details":{"type":"array","items":{"type":"integer"}},"obstacles":{"type":"array","items":{"type":"integer"}},"objects":{"type":"array","items":{"type":"integer"}}},"required":["ground","details","obstacles","objects"],"additionalProperties":false,"description":"Row-major tile ids, -1 = empty, top-left origin."},"tiled":{"type":"string"},"unity":{"type":"string"},"preview":{"type":"string"},"stats":{"type":"object","properties":{"tilesByRole":{"type":"object","additionalProperties":{"type":"number"}},"reachable":{"type":"boolean"},"removedForReachability":{"type":"number"},"missingTransitions":{"type":"array","items":{"type":"string"}}},"required":["tilesByRole","reachable","removedForReachability","missingTransitions"],"additionalProperties":false},"diff":{"type":"object","properties":{"changedCells":{"type":"number"}},"required":["changedCells"],"additionalProperties":false}},"required":["jobId","width","height","planner","plan","zones","layers","tiled","unity","preview","stats"],"additionalProperties":false},"example":{"jobId":"job2d_0123456789abcdef0123","width":48,"height":32,"tiled":"https://rengi.dev/files/<id>/map.tmj","unity":"https://rengi.dev/files/<id>/map.unity.json","preview":"https://rengi.dev/files/<id>/preview.png"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $1.00 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tileset":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"tileWidth":{"type":"integer","minimum":1,"maximum":512},"tileHeight":{"type":"integer","minimum":1,"maximum":512},"margin":{"type":"integer","minimum":0,"default":0},"spacing":{"type":"integer","minimum":0,"default":0}},"required":["tileWidth","tileHeight"],"additionalProperties":false},"tileRoles":{"type":"object","properties":{"terrains":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"tiles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":0},"weight":{"type":"number","exclusiveMinimum":0,"default":1}},"required":["id"],"additionalProperties":false},"minItems":1,"description":"Plain fill tiles; weighted variants keep ground from looking stamped."},"walkable":{"type":"boolean","default":true}},"required":["name","tiles"],"additionalProperties":false},"minItems":1,"maxItems":12},"sets":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"corner16"},"over":{"type":"string"},"under":{"type":"string"},"firstTile":{"type":"integer","minimum":0}},"required":["kind","over","under","firstTile"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"blob47"},"over":{"type":"string"},"under":{"type":"string"},"tiles":{"type":"array","items":{"type":"integer","minimum":0},"minItems":47,"maxItems":47}},"required":["kind","over","under","tiles"],"additionalProperties":false}]},"maxItems":40,"default":[]},"decorations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":0},"name":{"type":"string","minLength":1,"maxLength":40},"layer":{"type":"string","enum":["detail","obstacle"],"description":"detail: walkable ground clutter; obstacle: blocks walking"},"on":{"type":"array","items":{"type":"string"},"description":"Terrains it may stand on (default: any walkable)."},"tags":{"type":"array","items":{"type":"string"},"maxItems":10,"default":[]}},"required":["id","name","layer"],"additionalProperties":false},"maxItems":200,"default":[]},"stamps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"width":{"type":"integer","minimum":1,"maximum":16},"height":{"type":"integer","minimum":1,"maximum":16},"tiles":{"type":"array","items":{"type":"integer","minimum":-1},"description":"Row-major tile ids, width x height; -1 leaves a cell empty."},"walkable":{"type":"boolean","default":false},"tags":{"type":"array","items":{"type":"string"},"maxItems":10,"default":[]}},"required":["name","width","height","tiles"],"additionalProperties":false},"maxItems":60,"default":[]},"terrainFor":{"type":"object","additionalProperties":{"type":"string"},"default":{}}},"required":["terrains"],"additionalProperties":false},"layout":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"zones"},"width":{"type":"integer","minimum":4,"maximum":400,"description":"Map width in tiles."},"height":{"type":"integer","minimum":4,"maximum":400,"description":"Map height in tiles."},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":60},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"minItems":3,"maxItems":400,"description":"Tile units: x right, y down."},"polyline":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":400},"width":{"type":"number","exclusiveMinimum":0,"maximum":50}},"required":["kind"],"additionalProperties":false},"maxItems":200},"requiredPoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"x":{"type":"number"},"z":{"type":"number"}},"required":["id","x","z"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["kind","width","height","zones"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"image"},"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"width":{"type":"integer","minimum":4,"maximum":400},"height":{"type":"integer","minimum":4,"maximum":400},"requiredPoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"x":{"type":"number"},"z":{"type":"number"}},"required":["id","x","z"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["kind","width","height"],"additionalProperties":false}]},"brief":{"type":"string","maxLength":4000,"default":""},"preset":{"type":"string","enum":["fantasy-village","dungeon","forest"],"default":"fantasy-village"},"density":{"type":"number","minimum":0,"maximum":1,"default":0.5},"seed":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":64}],"default":1},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"density":{"type":"number","minimum":0,"maximum":1}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"inset":{"type":"integer","minimum":0,"maximum":10,"default":0},"spacing":{"type":"integer","minimum":1,"maximum":20,"default":1}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":40}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stamp"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"count":{"type":"integer","minimum":1,"maximum":30,"default":1,"description":"Stamps per zone; building lots usually take 1."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"name":{"type":"string"},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"}},"required":["kind","name"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false}},"required":["tileset","tileRoles","layout"],"additionalProperties":false},"example":{"tileset":{"imageUrl":"https://rengi.dev/samples/tileset.png","tileWidth":16,"tileHeight":16},"tileRoles":{"terrains":[{"name":"grass","tiles":[{"id":0,"weight":4},{"id":1,"weight":1}]},{"name":"dirt","tiles":[{"id":2}]}],"sets":[{"kind":"corner16","over":"dirt","under":"grass","firstTile":8}],"decorations":[{"id":59,"name":"tree","layer":"obstacle","tags":["tree"]}],"stamps":[{"name":"house","width":2,"height":2,"tiles":[62,63,70,71],"tags":["house"]}],"terrainFor":{"road":"dirt","default":"grass"}},"layout":{"kind":"zones","width":48,"height":32,"zones":[{"id":"road","kind":"road","polyline":[[0,16],[48,16]],"width":3},{"id":"woods","kind":"forest","polygon":[[0,0],[20,0],[20,12],[0,12]]}],"requiredPoints":[]},"seed":1}}}}}},"/v1/level-design/revise-2d":{"post":{"operationId":"level-design_post_revise_2d","summary":"Change a 2D map by instruction or zone edits; untouched zones keep their tiles.","tags":["level-design"],"x-price-usd":"0.30","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"planner":{"type":"string","enum":["model","preset","given"]},"plan":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"density":{"type":"number","minimum":0,"maximum":1}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"inset":{"type":"integer","minimum":0,"maximum":10,"default":0},"spacing":{"type":"integer","minimum":1,"maximum":20,"default":1}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":40}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stamp"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"count":{"type":"integer","minimum":1,"maximum":30,"default":1,"description":"Stamps per zone; building lots usually take 1."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"name":{"type":"string"},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"}},"required":["kind","name"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":200},"notes":{"type":"string","maxLength":2000}},"required":["zones"],"additionalProperties":false},"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["road","plaza","water","forest","field","building-lot","keep-clear","spawn","open"]},"polygon":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}}},"required":["id","kind","polygon"],"additionalProperties":false}},"layers":{"type":"object","properties":{"ground":{"type":"array","items":{"type":"integer"}},"details":{"type":"array","items":{"type":"integer"}},"obstacles":{"type":"array","items":{"type":"integer"}},"objects":{"type":"array","items":{"type":"integer"}}},"required":["ground","details","obstacles","objects"],"additionalProperties":false,"description":"Row-major tile ids, -1 = empty, top-left origin."},"tiled":{"type":"string"},"unity":{"type":"string"},"preview":{"type":"string"},"stats":{"type":"object","properties":{"tilesByRole":{"type":"object","additionalProperties":{"type":"number"}},"reachable":{"type":"boolean"},"removedForReachability":{"type":"number"},"missingTransitions":{"type":"array","items":{"type":"string"}}},"required":["tilesByRole","reachable","removedForReachability","missingTransitions"],"additionalProperties":false},"diff":{"type":"object","properties":{"changedCells":{"type":"number"}},"required":["changedCells"],"additionalProperties":false}},"required":["jobId","width","height","planner","plan","zones","layers","tiled","unity","preview","stats"],"additionalProperties":false},"example":{"jobId":"job2d_fedcba9876543210fedc","diff":{"changedCells":41}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.30 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"instruction":{"type":"string","maxLength":2000},"edits":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"rules":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scatter"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"density":{"type":"number","minimum":0,"maximum":1}},"required":["kind","density"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"along"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"inset":{"type":"integer","minimum":0,"maximum":10,"default":0},"spacing":{"type":"integer","minimum":1,"maximum":20,"default":1}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cluster"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"clusters":{"type":"integer","minimum":1,"maximum":30,"default":1},"count":{"type":"integer","minimum":1,"maximum":60},"radius":{"type":"number","exclusiveMinimum":0,"maximum":40}},"required":["kind","count","radius"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stamp"},"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"count":{"type":"integer","minimum":1,"maximum":30,"default":1,"description":"Stamps per zone; building lots usually take 1."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"anchor"},"name":{"type":"string"},"at":{"anyOf":[{"type":"string","const":"centroid"},{"type":"array","minItems":2,"maxItems":2,"items":false,"prefixItems":[{"type":"number"},{"type":"number"}]}],"default":"centroid"}},"required":["kind","name"],"additionalProperties":false}]},"maxItems":12}},"required":["zoneId","rules"],"additionalProperties":false},"maxItems":50}},"required":["jobId"],"additionalProperties":false},"example":{"jobId":"job2d_0123456789abcdef0123","instruction":"denser forest"}}}}}},"/v1/level-design/example":{"get":{"operationId":"level-design_get_example","summary":"A full worked request and response from the bundled fixtures, free.","tags":["level-design"],"x-price-usd":null,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"request":{},"response":{}},"additionalProperties":false},"example":{"request":"...","response":"..."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[]}},"/v1/asset-render/views":{"post":{"operationId":"asset-render_post_views","summary":"Render a GLB model to four PNG views (three-quarter, front, side, top) for thumbnails and previews, plus mesh stats and size.","tags":["asset-render"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"views":{"type":"object","properties":{"threeQuarter":{"type":"string"},"front":{"type":"string"},"side":{"type":"string"},"top":{"type":"string"}},"required":["threeQuarter","front","side","top"],"additionalProperties":false},"stats":{"type":"object","properties":{"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"materials":{"type":"number"},"bounds":{"type":"object","properties":{"min":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"max":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]}},"required":["min","max"],"additionalProperties":false},"height":{"type":"number"},"footprintRadius":{"type":"number"},"upAxis":{"type":"string","enum":["y","z"]},"upAxisGuessed":{"type":"boolean"}},"required":["triangles","vertices","primitives","materials","bounds","height","footprintRadius","upAxis","upAxisGuessed"],"additionalProperties":false}},"required":["views","stats"],"additionalProperties":false},"example":{"views":{"threeQuarter":"https://rengi.dev/files/<id>/three-quarter.png","front":"...","side":"...","top":"..."},"stats":{"triangles":172,"vertices":516,"primitives":3,"materials":3,"bounds":{"min":[-2.6,0,-3.1],"max":[2.6,5,3.1]},"height":5,"footprintRadius":3.62,"upAxis":"y","upAxisGuessed":true}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string","description":"Base64 GLB."},"glbUrl":{"type":"string","format":"uri"},"upAxis":{"type":"string","enum":["auto","y","z"],"default":"auto"},"size":{"type":"number","enum":[256,512,1024],"default":512},"background":{"type":"string","enum":["neutral","transparent"],"default":"neutral"},"lighting":{"type":"string","enum":["lit","unlit"],"default":"lit","description":"unlit: base color only, no scene lighting (for models with lighting baked into the texture)"}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/house.glb","size":512}}}}}},"/v1/asset-render/turntable":{"post":{"operationId":"asset-render_post_turntable","summary":"Render a GLB model as a looping turntable GIF, one full revolution, plus mesh stats.","tags":["asset-render"],"x-price-usd":"0.25","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"gif":{"type":"string"},"frames":{"type":"number"},"stats":{"type":"object","properties":{"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"materials":{"type":"number"},"bounds":{"type":"object","properties":{"min":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"max":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]}},"required":["min","max"],"additionalProperties":false},"height":{"type":"number"},"footprintRadius":{"type":"number"},"upAxis":{"type":"string","enum":["y","z"]},"upAxisGuessed":{"type":"boolean"}},"required":["triangles","vertices","primitives","materials","bounds","height","footprintRadius","upAxis","upAxisGuessed"],"additionalProperties":false}},"required":["gif","frames","stats"],"additionalProperties":false},"example":{"gif":"https://rengi.dev/files/<id>/turntable.gif","frames":36,"stats":{"triangles":172,"vertices":516,"primitives":3,"materials":3,"bounds":{"min":[-2.6,0,-3.1],"max":[2.6,5,3.1]},"height":5,"footprintRadius":3.62,"upAxis":"y","upAxisGuessed":true}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.25 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string","description":"Base64 GLB."},"glbUrl":{"type":"string","format":"uri"},"upAxis":{"type":"string","enum":["auto","y","z"],"default":"auto"},"size":{"type":"number","enum":[256,512],"default":256},"frames":{"type":"integer","minimum":12,"maximum":72,"default":36}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/house.glb","frames":36}}}}}},"/v1/asset-render/sprites":{"post":{"operationId":"asset-render_post_sprites","summary":"Transparent isometric sprite sheet, 4 or 8 directions in one row (south first, clockwise), with frame JSON.","tags":["asset-render"],"x-price-usd":"0.40","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"sheet":{"type":"string"},"json":{"type":"string"},"cellSize":{"type":"number"},"frames":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["direction","x","y","w","h"],"additionalProperties":false}},"stats":{"type":"object","properties":{"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"materials":{"type":"number"},"bounds":{"type":"object","properties":{"min":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"max":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]}},"required":["min","max"],"additionalProperties":false},"height":{"type":"number"},"footprintRadius":{"type":"number"},"upAxis":{"type":"string","enum":["y","z"]},"upAxisGuessed":{"type":"boolean"}},"required":["triangles","vertices","primitives","materials","bounds","height","footprintRadius","upAxis","upAxisGuessed"],"additionalProperties":false}},"required":["sheet","json","cellSize","frames","stats"],"additionalProperties":false},"example":{"sheet":"https://rengi.dev/files/<id>/sprites.png","json":"https://rengi.dev/files/<id>/sprites.json","cellSize":128,"frames":[{"direction":"south","x":0,"y":0,"w":128,"h":128}],"stats":{"triangles":172,"vertices":516,"primitives":3,"materials":3,"bounds":{"min":[-2.6,0,-3.1],"max":[2.6,5,3.1]},"height":5,"footprintRadius":3.62,"upAxis":"y","upAxisGuessed":true}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.40 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string","description":"Base64 GLB."},"glbUrl":{"type":"string","format":"uri"},"upAxis":{"type":"string","enum":["auto","y","z"],"default":"auto"},"directions":{"type":"number","enum":[4,8],"default":8},"cellSize":{"type":"integer","minimum":32,"maximum":512,"default":128},"elevationDeg":{"type":"number","minimum":0,"maximum":89,"default":30},"pixelArt":{"type":"boolean","default":false}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/knight.glb","directions":8,"cellSize":128}}}}}},"/v1/sprite-tools/slice":{"post":{"operationId":"sprite-tools_post_slice","summary":"Cut a sprite sheet into frames by grid or by transparent gaps; frame PNGs plus a ZIP.","tags":["sprite-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rect":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"],"additionalProperties":false},"trim":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"sourceW":{"type":"number"},"sourceH":{"type":"number"}},"required":["x","y","sourceW","sourceH"],"additionalProperties":false},"url":{"type":"string"}},"required":["name","rect","trim","url"],"additionalProperties":false}},"zip":{"type":"string"}},"required":["frames","zip"],"additionalProperties":false},"example":{"frames":[{"name":"frame_000","rect":{"x":0,"y":0,"w":64,"h":64},"trim":{"x":0,"y":0,"sourceW":64,"sourceH":64},"url":"https://rengi.dev/files/<id>/frames/frame_000.png"}],"zip":"https://rengi.dev/files/<id>/frames.zip"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 PNG, JPEG or WebP."},"imageUrl":{"type":"string","format":"uri"},"mode":{"type":"string","enum":["grid","auto"],"default":"auto"},"cols":{"type":"integer","minimum":1,"maximum":256},"rows":{"type":"integer","minimum":1,"maximum":256},"cellWidth":{"type":"integer","minimum":1,"maximum":4096},"cellHeight":{"type":"integer","minimum":1,"maximum":4096},"margin":{"type":"integer","minimum":0,"maximum":512,"default":0},"spacing":{"type":"integer","minimum":0,"maximum":512,"default":0},"minArea":{"type":"integer","minimum":1,"default":4,"description":"auto mode: ignore islands smaller than this many pixels"},"mergeDistance":{"type":"integer","minimum":0,"maximum":64,"default":1,"description":"auto mode: islands closer than this merge into one sprite"},"trim":{"type":"boolean","default":false}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/sheet.png","mode":"grid","cols":8,"rows":4}}}}}},"/v1/sprite-tools/pack":{"post":{"operationId":"sprite-tools_post_pack","summary":"Pack frames into one atlas (MaxRects) with padding and edge extrusion; TexturePacker JSON and Unity JSON.","tags":["sprite-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"atlas":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"texturepacker":{"type":"string"},"unity":{"type":"string"},"rects":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"},"trim":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"sourceW":{"type":"number"},"sourceH":{"type":"number"}},"required":["x","y","sourceW","sourceH"],"additionalProperties":false}},"required":["name","x","y","w","h","trim"],"additionalProperties":false}}},"required":["atlas","width","height","texturepacker","unity","rects"],"additionalProperties":false},"example":{"atlas":"https://rengi.dev/files/<id>/atlas.png","width":136,"height":68,"texturepacker":"https://rengi.dev/files/<id>/atlas.json","unity":"https://rengi.dev/files/<id>/atlas.unity.json","rects":[{"name":"run_0","x":2,"y":2,"w":64,"h":64,"trim":{"x":0,"y":0,"sourceW":64,"sourceH":64}}]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"required":["name"],"additionalProperties":false},"minItems":1,"maxItems":2048},"maxSize":{"type":"integer","minimum":64,"maximum":8192,"default":2048},"padding":{"type":"integer","minimum":0,"maximum":32,"default":2},"extrude":{"type":"integer","minimum":0,"maximum":8,"default":1},"trim":{"type":"boolean","default":true},"powerOfTwo":{"type":"boolean","default":false}},"required":["frames"],"additionalProperties":false},"example":{"frames":[{"name":"run_0","imageUrl":"https://rengi.dev/samples/run_0.png"},{"name":"run_1","imageUrl":"https://rengi.dev/samples/run_1.png"}],"padding":2,"extrude":1}}}}}},"/v1/sprite-tools/pixelate":{"post":{"operationId":"sprite-tools_post_pixelate","summary":"Clean pixel art: find the true pixel grid, downscale to it, snap to a palette, hard alpha.","tags":["sprite-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string"},"preview":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"scale":{"type":"number"},"scaleDetected":{"type":"boolean"},"offset":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false},"palette":{"type":"array","items":{"type":"string"}}},"required":["image","preview","width","height","scale","scaleDetected","offset","palette"],"additionalProperties":false},"example":{"image":"https://rengi.dev/files/<id>/pixel.png","preview":"https://rengi.dev/files/<id>/preview.png","width":32,"height":32,"scale":8,"scaleDetected":true,"offset":{"x":0,"y":0},"palette":["#1a1c2c","#5d275d"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 PNG, JPEG or WebP."},"imageUrl":{"type":"string","format":"uri"},"scale":{"type":"integer","minimum":1,"maximum":64,"description":"Size of one art pixel in image pixels; detected when omitted."},"palette":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":256,"description":"Hex colors to snap to."},"colors":{"type":"integer","minimum":2,"maximum":64,"default":16},"alphaThreshold":{"type":"integer","minimum":1,"maximum":255,"default":128}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/ai-knight.png","colors":16}}}}}},"/v1/sprite-tools/remove-bg":{"post":{"operationId":"sprite-tools_post_remove_bg","summary":"Cut a sprite, prop or character out of its background: exact keying for one-color backgrounds (text and holes too), AI segmentation for busy ones; clean edges with no halo, trimmed, with a pivot. AI mode handles one main subject, not text on photos.","tags":["sprite-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string"},"mask":{"type":"string"},"preview":{"type":"string"},"mode":{"type":"string","enum":["flat","ai","existing"]},"backgroundColor":{"type":["string","null"]},"width":{"type":"number"},"height":{"type":"number"},"box":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"],"additionalProperties":false,"description":"Where the result sits in the source image."},"pivot":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false,"description":"Normalized, Unity convention (0,0 = bottom-left)."},"pivotPx":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false,"description":"Pixels from the top-left of the result."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["image","mask","preview","mode","backgroundColor","width","height","box","pivot","pivotPx","warnings"],"additionalProperties":false},"example":{"image":"https://rengi.dev/files/<id>/sprite.png","mask":"https://rengi.dev/files/<id>/mask.png","preview":"https://rengi.dev/files/<id>/preview.png","mode":"flat","backgroundColor":"#ffffff","width":420,"height":610,"box":{"x":302,"y":140,"w":416,"h":606},"pivot":{"x":0.5,"y":0.0033},"pivotPx":{"x":210,"y":608},"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 PNG, JPEG or WebP."},"imageUrl":{"type":"string","format":"uri"},"mode":{"type":"string","enum":["auto","flat","ai"],"default":"auto","description":"auto: flat key when the border is one color, AI segmentation otherwise."},"keep":{"type":"string","enum":["auto","main","all"],"default":"auto","description":"main: only the main subject and what touches it; all: everything that is not background. auto: all for flat backgrounds, main after AI."},"trim":{"type":"boolean","default":true},"padding":{"type":"integer","minimum":0,"maximum":256,"default":2},"pivot":{"type":"string","enum":["bottom","center"],"default":"bottom"}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/prop-on-white.png"}}}}}},"/v1/sprite-tools/video-to-sheet":{"post":{"operationId":"sprite-tools_post_video_to_sheet","summary":"Turn an animation video or GIF (from Kling, Veo, Sora or a capture) into a sprite sheet: frames at your fps, background removed, every frame aligned to one box and pivot so it does not jitter, the best loop point, TexturePacker JSON, Godot SpriteFrames and a GIF preview.","tags":["sprite-tools"],"x-price-usd":"0.15","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"string"},"sheet":{"type":"string"},"frames":{"type":"string"},"texturepacker":{"type":"string"},"godot":{"type":"string"},"frameCount":{"type":"number"},"frameWidth":{"type":"number"},"frameHeight":{"type":"number"},"columns":{"type":"number"},"fps":{"type":"number"},"background":{"type":"string","enum":["keep","flat","ai"]},"pivot":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false},"loop":{"type":"object","properties":{"frames":{"type":"number"},"difference":{"type":"number"}},"required":["frames","difference"],"additionalProperties":false,"description":"Frames 0..frames-1 make the cleanest loop; difference 0 = identical."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["preview","sheet","frames","texturepacker","godot","frameCount","frameWidth","frameHeight","columns","fps","background","pivot","loop","warnings"],"additionalProperties":false},"example":{"sheet":"https://rengi.dev/files/<id>/sheet.png","frames":"https://rengi.dev/files/<id>/frames.zip","texturepacker":"https://rengi.dev/files/<id>/sheet.json","godot":"https://rengi.dev/files/<id>/sheet.tres","preview":"https://rengi.dev/files/<id>/preview.gif","frameCount":12,"frameWidth":192,"frameHeight":160,"columns":4,"fps":12,"background":"flat","pivot":{"x":0.5,"y":0.0125},"loop":{"frames":12,"difference":0.012},"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.15 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"video":{"type":"string","description":"Base64 MP4, WebM, MOV or GIF."},"videoUrl":{"type":"string","format":"uri"},"fps":{"type":"number","minimum":1,"maximum":60,"default":12},"start":{"type":"number","minimum":0,"default":0},"end":{"type":"number","exclusiveMinimum":0},"maxFrames":{"type":"integer","minimum":1,"maximum":120,"default":48},"background":{"type":"string","enum":["auto","keep","flat","ai"],"default":"auto","description":"auto: keep the video's own transparency, key a one-color background, or use AI (max 24 frames)."},"frameSize":{"type":"integer","minimum":16,"maximum":1024,"default":256,"description":"Longest side of one frame."},"pixelArt":{"type":"boolean","default":false,"description":"Scale with nearest neighbour."},"columns":{"type":"integer","minimum":1,"maximum":64}},"additionalProperties":false},"example":{"videoUrl":"https://rengi.dev/samples/slime-jump.mp4","fps":12}}}}}},"/v1/sprite-tools/normal-map":{"post":{"operationId":"sprite-tools_post_normal_map","summary":"Normal map for a sprite or sprite sheet, for 2D lights in Unity URP 2D and Godot: a rounded bevel from the silhouette plus surface detail, alpha kept, OpenGL or DirectX; a height map and a preview lit by a moving light.","tags":["sprite-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"string"},"normal":{"type":"string"},"height":{"type":"string"},"width":{"type":"number"},"height_px":{"type":"number"},"bevel":{"type":"number"},"convention":{"type":"string"}},"required":["preview","normal","height","width","height_px","bevel","convention"],"additionalProperties":false},"example":{"normal":"https://rengi.dev/files/<id>/normal.png","height":"https://rengi.dev/files/<id>/height.png","preview":"https://rengi.dev/files/<id>/lit.gif","width":128,"height_px":128,"bevel":28,"convention":"opengl"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 PNG sprite or sheet with transparency."},"imageUrl":{"type":"string","format":"uri"},"bevel":{"type":"number","minimum":1,"maximum":256,"description":"Rim width in pixels; from the sprite size when omitted."},"strength":{"type":"number","minimum":0.1,"maximum":8,"default":1},"detail":{"type":"number","minimum":0,"maximum":2,"default":0.5,"description":"How much surface detail from the colors goes into the bumps."},"convention":{"type":"string","enum":["opengl","directx"],"default":"opengl","description":"opengl (green up) for Unity and Godot."}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/orb.png","strength":1}}}}}},"/v1/sprite-tools/autotile":{"post":{"operationId":"sprite-tools_post_autotile","summary":"Two terrain textures (grass over dirt, sand over water) to a full 47-tile autotile set with natural, seamless edges, outer and inner corners, plus ready rules: Tiled wang set, Godot 4 TileSet terrains, Unity Rule Tile (editor script), JSON, and a painted preview map.","tags":["sprite-tools"],"x-price-usd":"0.15","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"string"},"tileset":{"type":"string"},"zip":{"type":"string"},"json":{"type":"string"},"tiled":{"type":"string"},"godot":{"type":"string"},"unityMeta":{"type":"string"},"unityScript":{"type":"string"},"tiles":{"type":"number"},"tileSize":{"type":"number"},"columns":{"type":"number"},"madeSeamless":{"type":"array","items":{"type":"string"}},"howTo":{"type":"object","additionalProperties":{"type":"string"}}},"required":["preview","tileset","zip","json","tiled","godot","unityMeta","unityScript","tiles","tileSize","columns","madeSeamless","howTo"],"additionalProperties":false},"example":{"tileset":"https://rengi.dev/files/<id>/tileset.png","preview":"https://rengi.dev/files/<id>/preview.png","zip":"https://rengi.dev/files/<id>/autotile.zip","json":"https://rengi.dev/files/<id>/autotile.json","tiled":"https://rengi.dev/files/<id>/tileset.tsx","godot":"https://rengi.dev/files/<id>/tileset.tres","unityMeta":"https://rengi.dev/files/<id>/tileset.png.meta","unityScript":"https://rengi.dev/files/<id>/RengiAutotile.cs","tiles":48,"tileSize":32,"columns":8,"madeSeamless":[],"howTo":{"tiled":"Add tileset.tsx to a map and paint with the Terrain brush (wang set 'terrain')."}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.15 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base":{"type":"string","description":"Base terrain texture (what is underneath: dirt, water), base64 PNG/JPEG/WebP."},"baseUrl":{"type":"string","format":"uri"},"top":{"type":"string","description":"Top terrain texture (what you paint: grass, sand), base64."},"topUrl":{"type":"string","format":"uri"},"tileSize":{"type":"integer","minimum":8,"maximum":256,"default":32},"edge":{"type":"string","enum":["soft","crisp"],"default":"soft","description":"soft for painted styles, crisp for pixel art."},"rim":{"type":"boolean","default":false,"description":"crisp only: a dark 1 px outline on the top terrain's edge."},"edgeWidth":{"type":"number","minimum":0.1,"maximum":0.45,"default":0.18,"description":"How deep the transition sits into a tile, as a fraction of the tile."},"roughness":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"0 = straight edges, 1 = very irregular."},"seed":{"type":"integer","minimum":0,"maximum":1000000,"default":1}},"additionalProperties":false},"example":{"baseUrl":"https://rengi.dev/samples/dirt.png","topUrl":"https://rengi.dev/samples/grass.png","tileSize":32}}}}}},"/v1/glb-optimizer/optimize":{"post":{"operationId":"glb-optimizer_post_optimize","summary":"Shrink a GLB (up to 10 MB) for web or mobile: dedup, join draw calls, gentle simplify, textures to WebP at a max size, meshopt or Draco compression; before/after renders, size report and loader notes for three.js and Unity.","tags":["glb-optimizer"],"x-price-usd":"0.20","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"before":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"after":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"savedPercent":{"type":"number"},"steps":{"type":"object","properties":{"applied":{"type":"array","items":{"type":"string"}},"skipped":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"reason":{"type":"string"}},"required":["step","reason"],"additionalProperties":false}}},"required":["applied","skipped"],"additionalProperties":false},"visual":{"type":"object","properties":{"difference":{"type":"number"},"ok":{"type":"boolean"},"beforeUrl":{"type":"string"},"afterUrl":{"type":"string"}},"required":["difference","ok","beforeUrl","afterUrl"],"additionalProperties":false},"validation":{"type":"object","properties":{"errors":{"type":"number"},"warnings":{"type":"number"},"messages":{"type":"array","items":{"type":"string"}}},"required":["errors","warnings","messages"],"additionalProperties":false},"loaderNote":{"type":"string"}},"required":["glb","before","after","savedPercent","steps","visual","validation","loaderNote"],"additionalProperties":false},"example":{"glb":"https://rengi.dev/files/<id>/optimized.glb","before":{"fileBytes":18400000,"triangles":420000,"vertices":260000,"primitives":84,"drawCalls":84,"meshes":84,"materials":12,"textures":9,"textureMemoryBytes":600000000,"animations":0,"skins":0,"morphTargets":0},"after":{"fileBytes":2100000,"triangles":180000,"vertices":260000,"primitives":84,"drawCalls":14,"meshes":14,"materials":12,"textures":9,"textureMemoryBytes":150000000,"animations":0,"skins":0,"morphTargets":0},"savedPercent":88.6,"steps":{"applied":["dedup","prune","instance","join","weld","simplify (error 0.001)","textures (max 2048, webp)","meshopt compression"],"skipped":[]},"visual":{"difference":0.012,"ok":true,"beforeUrl":"https://rengi.dev/files/<id>/before.png","afterUrl":"https://rengi.dev/files/<id>/after.png"},"validation":{"errors":0,"warnings":0,"messages":[]},"loaderNote":"Uses EXT_meshopt_compression: ..."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.20 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string","description":"Base64 GLB."},"glbUrl":{"type":"string","format":"uri"},"preset":{"type":"string","enum":["web","mobile","preview"],"default":"web"},"maxTextureSize":{"type":"integer","minimum":64,"maximum":8192},"simplifyRatio":{"type":"number","minimum":0,"maximum":1,"description":"Target share of triangles to keep (0 = only the error bound decides)."},"compression":{"type":"string","enum":["meshopt","draco","none"],"default":"meshopt"},"textureFormat":{"type":"string","enum":["webp","png","keep"],"default":"webp"}},"additionalProperties":false,"description":"GLB up to 10 MB."},"example":{"glbUrl":"https://rengi.dev/samples/castle.glb","preset":"web"}}}}}},"/v1/glb-optimizer/optimize-large":{"post":{"operationId":"glb-optimizer_post_optimize_large","summary":"Shrink a large GLB (up to 50 MB) for web or mobile, same pipeline as optimize: dedup, join, simplify, WebP textures, meshopt or Draco.","tags":["glb-optimizer"],"x-price-usd":"0.50","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"before":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"after":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"savedPercent":{"type":"number"},"steps":{"type":"object","properties":{"applied":{"type":"array","items":{"type":"string"}},"skipped":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"reason":{"type":"string"}},"required":["step","reason"],"additionalProperties":false}}},"required":["applied","skipped"],"additionalProperties":false},"visual":{"type":"object","properties":{"difference":{"type":"number"},"ok":{"type":"boolean"},"beforeUrl":{"type":"string"},"afterUrl":{"type":"string"}},"required":["difference","ok","beforeUrl","afterUrl"],"additionalProperties":false},"validation":{"type":"object","properties":{"errors":{"type":"number"},"warnings":{"type":"number"},"messages":{"type":"array","items":{"type":"string"}}},"required":["errors","warnings","messages"],"additionalProperties":false},"loaderNote":{"type":"string"}},"required":["glb","before","after","savedPercent","steps","visual","validation","loaderNote"],"additionalProperties":false},"example":{"glb":"https://rengi.dev/files/<id>/optimized.glb","before":{"fileBytes":18400000,"triangles":420000,"vertices":260000,"primitives":84,"drawCalls":84,"meshes":84,"materials":12,"textures":9,"textureMemoryBytes":600000000,"animations":0,"skins":0,"morphTargets":0},"after":{"fileBytes":2100000,"triangles":180000,"vertices":260000,"primitives":84,"drawCalls":14,"meshes":14,"materials":12,"textures":9,"textureMemoryBytes":150000000,"animations":0,"skins":0,"morphTargets":0},"savedPercent":88.6,"steps":{"applied":["dedup","prune","instance","join","weld","simplify (error 0.001)","textures (max 2048, webp)","meshopt compression"],"skipped":[]},"visual":{"difference":0.012,"ok":true,"beforeUrl":"https://rengi.dev/files/<id>/before.png","afterUrl":"https://rengi.dev/files/<id>/after.png"},"validation":{"errors":0,"warnings":0,"messages":[]},"loaderNote":"Uses EXT_meshopt_compression: ..."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.50 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string","description":"Base64 GLB."},"glbUrl":{"type":"string","format":"uri"},"preset":{"type":"string","enum":["web","mobile","preview"],"default":"web"},"maxTextureSize":{"type":"integer","minimum":64,"maximum":8192},"simplifyRatio":{"type":"number","minimum":0,"maximum":1,"description":"Target share of triangles to keep (0 = only the error bound decides)."},"compression":{"type":"string","enum":["meshopt","draco","none"],"default":"meshopt"},"textureFormat":{"type":"string","enum":["webp","png","keep"],"default":"webp"}},"additionalProperties":false,"description":"GLB up to 50 MB."},"example":{"glbUrl":"https://rengi.dev/samples/castle.glb","preset":"web"}}}}}},"/v1/glb-optimizer/inspect":{"post":{"operationId":"glb-optimizer_post_inspect","summary":"Inspect a GLB without changing it: triangles, draw calls, materials, texture memory, animations, glTF validator errors, and concrete suggestions to make it lighter.","tags":["glb-optimizer"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"suggestions":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"errors":{"type":"number"},"warnings":{"type":"number"},"messages":{"type":"array","items":{"type":"string"}}},"required":["errors","warnings","messages"],"additionalProperties":false}},"required":["report","suggestions","validation"],"additionalProperties":false},"example":{"report":{"fileBytes":18400000,"triangles":420000,"vertices":260000,"primitives":84,"drawCalls":84,"meshes":84,"materials":12,"textures":9,"textureMemoryBytes":600000000,"animations":0,"skins":0,"morphTargets":0},"suggestions":["Textures take about 572 MB of GPU memory; resize to 2048 or less (1024 on mobile).","420,000 triangles is heavy for the web; simplify or add LODs.","84 draw calls; join meshes that share a material or instance repeated ones.","Many separate meshes; check for repeated geometry that could be instanced.","No mesh compression; meshopt usually cuts geometry size by 3-10x."],"validation":{"errors":0,"warnings":3,"messages":[]}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"glbUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/castle.glb"}}}}}},"/v1/glb-optimizer/convert":{"post":{"operationId":"glb-optimizer_post_convert","summary":"Convert FBX, OBJ (zip with .mtl and textures), glTF (zip), STL, PLY, DAE or 3DS to one GLB: Y-up, in meters, materials and FBX animations kept. Returns the GLB, a report, a validator pass and a preview render.","tags":["glb-optimizer"],"x-price-usd":"0.15","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"preview":{"type":"string"},"format":{"type":"string"},"upAxis":{"type":"string","enum":["y","z"],"description":"Up axis of the source"},"unitScale":{"type":"number"},"sizeMeters":{"type":"array","minItems":3,"maxItems":3,"items":false,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"report":{"type":"object","properties":{"fileBytes":{"type":"number"},"triangles":{"type":"number"},"vertices":{"type":"number"},"primitives":{"type":"number"},"drawCalls":{"type":"number"},"meshes":{"type":"number"},"materials":{"type":"number"},"textures":{"type":"number"},"textureMemoryBytes":{"type":"number"},"animations":{"type":"number"},"skins":{"type":"number"},"morphTargets":{"type":"number"}},"required":["fileBytes","triangles","vertices","primitives","drawCalls","meshes","materials","textures","textureMemoryBytes","animations","skins","morphTargets"],"additionalProperties":false},"validation":{"type":"object","properties":{"errors":{"type":"number"},"warnings":{"type":"number"},"messages":{"type":"array","items":{"type":"string"}}},"required":["errors","warnings","messages"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"string"}}},"required":["glb","preview","format","upAxis","unitScale","sizeMeters","report","validation","warnings"],"additionalProperties":false},"example":{"glb":"https://rengi.dev/files/<id>/model.glb","preview":"https://rengi.dev/files/<id>/preview.png","format":"fbx","upAxis":"y","unitScale":1,"sizeMeters":[1,2,0.5],"report":{"fileBytes":18400000,"triangles":420000,"vertices":260000,"primitives":84,"drawCalls":84,"meshes":84,"materials":12,"textures":9,"textureMemoryBytes":600000000,"animations":0,"skins":0,"morphTargets":0},"validation":{"errors":0,"warnings":0,"messages":[]},"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.15 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Model file as base64: FBX, GLB, STL, PLY, DAE, 3DS, or a ZIP holding an OBJ/glTF with its .mtl/.bin and textures."},"fileUrl":{"type":"string","format":"uri"},"fileName":{"type":"string","maxLength":200,"description":"Original file name, helps tell the format apart."},"upAxis":{"type":"string","enum":["auto","y","z"],"default":"auto","description":"auto trusts FBX/glTF/DAE metadata, assumes Y-up for OBJ and Z-up for STL/PLY/3DS."},"unitScale":{"anyOf":[{"type":"string","const":"auto"},{"type":"number","exclusiveMinimum":0,"maximum":1000}],"default":"auto","description":"Multiply sizes by this to get meters; auto reads FBX units and treats large STLs as millimeters."}},"additionalProperties":false},"example":{"fileUrl":"https://rengi.dev/samples/crate.fbx"}}}}}},"/v1/glb-optimizer/lod":{"post":{"operationId":"glb-optimizer_post_lod","summary":"Generate a LOD chain from a GLB (default 100/50/25/10% of triangles) with locked borders so UV seams and silhouettes hold; one GLB per level, a side-by-side render and Unity LODGroup transition heights.","tags":["glb-optimizer"],"x-price-usd":"0.20","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"lods":{"type":"array","items":{"type":"object","properties":{"level":{"type":"number"},"ratio":{"type":"number"},"triangles":{"type":"number"},"glb":{"type":"string"}},"required":["level","ratio","triangles","glb"],"additionalProperties":false}},"sourceTriangles":{"type":"number"},"sheet":{"type":"string"},"unityTransitions":{"type":"array","items":{"type":"number"},"description":"LODGroup screen-relative transition height per level; the last one culls."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["lods","sourceTriangles","sheet","unityTransitions","warnings"],"additionalProperties":false},"example":{"lods":[{"level":0,"ratio":1,"triangles":96000,"glb":"https://rengi.dev/files/<id>/lod0.glb"},{"level":1,"ratio":0.5,"triangles":48010,"glb":"https://rengi.dev/files/<id>/lod1.glb"}],"sourceTriangles":96000,"sheet":"https://rengi.dev/files/<id>/lods.png","unityTransitions":[0.6,0.3,0.15,0.02],"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.20 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"glbUrl":{"type":"string","format":"uri"},"ratios":{"type":"array","items":{"type":"number","minimum":0.01,"maximum":1},"minItems":2,"maxItems":6,"default":[1,0.5,0.25,0.1]},"lockBorder":{"type":"boolean","default":true,"description":"Keep open edges and UV seams in place (recommended)."}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/castle.glb"}}}}}},"/v1/glb-optimizer/colliders":{"post":{"operationId":"glb-optimizer_post_colliders","summary":"Collision for a model: a set of convex hulls that hug the shape (V-HACD), ready for Godot (-convcolonly nodes), Unreal (UCX_ names) and Unity (convex MeshColliders via an editor script), plus hulls.json for any engine and a see-through overlay to check.","tags":["glb-optimizer"],"x-price-usd":"0.15","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"overlay":{"type":"string","description":"The model with see-through colored hulls, for checking."},"godot":{"type":"string"},"unreal":{"type":"string"},"unity":{"type":"string"},"unityScript":{"type":"string"},"hullsJson":{"type":"string"},"preview":{"type":"string"},"hulls":{"type":"number"},"hullTriangles":{"type":"number"},"volumeRatio":{"type":["number","null"],"description":"Hull volume / model volume; null when the model is not closed."},"simple":{"type":"object","properties":{"box":{"type":"object","properties":{"center":{"type":"array","items":{"type":"number"}},"size":{"type":"array","items":{"type":"number"}}},"required":["center","size"],"additionalProperties":false}},"required":["box"],"additionalProperties":false},"howTo":{"type":"object","additionalProperties":{"type":"string"}}},"required":["overlay","hullsJson","preview","hulls","hullTriangles","volumeRatio","simple","howTo"],"additionalProperties":false},"example":{"overlay":"https://rengi.dev/files/<id>/overlay.glb","godot":"https://rengi.dev/files/<id>/godot.glb","unreal":"https://rengi.dev/files/<id>/unreal.glb","unity":"https://rengi.dev/files/<id>/unity.glb","unityScript":"https://rengi.dev/files/<id>/RengiColliders.cs","hullsJson":"https://rengi.dev/files/<id>/hulls.json","preview":"https://rengi.dev/files/<id>/preview.png","hulls":5,"hullTriangles":60,"volumeRatio":1.04,"simple":{"box":{"center":[0,0.4,0],"size":[1.2,0.8,0.7]}},"howTo":{"godot":"Import godot.glb: nodes ending in -convcolonly become StaticBody3D convex shapes."}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.15 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"glb":{"type":"string"},"glbUrl":{"type":"string","format":"uri"},"engine":{"type":"string","enum":["all","godot","unreal","unity"],"default":"all"},"maxHulls":{"type":"integer","minimum":1,"maximum":64,"default":16,"description":"Upper limit; the fewest hulls that fit the shape (within 3% of the volume the limit gives) are used."},"resolution":{"type":"integer","minimum":10000,"maximum":1000000,"default":100000,"description":"Voxels used to read the shape; higher follows small details."},"maxVerticesPerHull":{"type":"integer","minimum":8,"maximum":255,"default":64,"description":"64 keeps every hull valid for Unity convex MeshColliders (255 polygons)."}},"additionalProperties":false},"example":{"glbUrl":"https://rengi.dev/samples/table.glb","maxHulls":16}}}}}},"/v1/texture-tools/seamless":{"post":{"operationId":"texture-tools_post_seamless","summary":"Make a texture tile without visible seams: removes baked lighting, hides the seam along the path where the image already matches. Returns the tile and a 2x2 preview.","tags":["texture-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tile":{"type":"string"},"preview":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"seamScore":{"type":"number","description":"Edge difference / interior difference across the wrap; about 1 means invisible."}},"required":["tile","preview","width","height","seamScore"],"additionalProperties":false},"example":{"tile":"https://rengi.dev/files/<id>/tile.png","preview":"https://rengi.dev/files/<id>/preview-2x2.png","width":450,"height":450,"seamScore":1.02}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Texture as base64 (PNG, JPEG or WebP)."},"imageUrl":{"type":"string","format":"uri","description":"Texture as a URL."},"delight":{"type":"boolean","default":true,"description":"Remove baked light/dark gradients first so the tile does not show bands."},"blendWidth":{"type":"number","minimum":0.04,"maximum":0.3,"default":0.12,"description":"Overlap used to hide the seam, as a fraction of the size. The tile is smaller by this much."}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/stone.png","delight":true}}}}}},"/v1/texture-tools/pbr":{"post":{"operationId":"texture-tools_post_pbr","summary":"PBR maps from one albedo image: normal (OpenGL for Unity/three.js and DirectX for Unreal), 16-bit height, roughness and ambient occlusion, plus a lit preview.","tags":["texture-tools"],"x-price-usd":"0.15","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"maps":{"type":"object","properties":{"albedo":{"type":"string"},"normal":{"type":"string"},"normalDx":{"type":"string"},"height":{"type":"string"},"roughness":{"type":"string"},"ao":{"type":"string"}},"required":["albedo","normal","normalDx","height","roughness","ao"],"additionalProperties":false},"preview":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"notes":{"type":"string"}},"required":["maps","preview","width","height","notes"],"additionalProperties":false},"example":{"maps":{"albedo":"https://rengi.dev/files/<id>/albedo.png","normal":"https://rengi.dev/files/<id>/normal-gl.png","normalDx":"https://rengi.dev/files/<id>/normal-dx.png","height":"https://rengi.dev/files/<id>/height.png","roughness":"https://rengi.dev/files/<id>/roughness.png","ao":"https://rengi.dev/files/<id>/ao.png"},"preview":"https://rengi.dev/files/<id>/lit-preview.png","width":512,"height":512,"notes":"normal is OpenGL (green up) for Unity and three.js; normalDx is for Unreal."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.15 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Albedo (base color) texture as base64 (PNG, JPEG or WebP)."},"imageUrl":{"type":"string","format":"uri","description":"Albedo (base color) texture as a URL."},"height":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Optional height map you already have."},"delight":{"type":"boolean","default":false},"normalStrength":{"type":"number","minimum":0.1,"maximum":10,"default":2},"invertHeight":{"type":"boolean","default":false,"description":"Set when dark areas are raised (e.g. light grout between dark stones)."},"roughness":{"anyOf":[{"type":"string","const":"auto"},{"type":"number","minimum":0,"maximum":1}],"default":"auto"}},"additionalProperties":false},"example":{"imageUrl":"https://rengi.dev/samples/stone-tile.png","normalStrength":2}}}}}},"/v1/texture-tools/pack":{"post":{"operationId":"texture-tools_post_pack","summary":"Pack grayscale maps into one texture for an engine preset: Unreal ORM, Unity URP metallic/smoothness, Unity HDRP mask map. Missing maps get sensible constants.","tags":["texture-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"channels":{"type":"object","properties":{"r":{"type":"string"},"g":{"type":"string"},"b":{"type":"string"},"a":{"type":"string"}},"required":["r","g","b","a"],"additionalProperties":false},"notes":{"type":"string"}},"required":["image","width","height","channels","notes"],"additionalProperties":false},"example":{"image":"https://rengi.dev/files/<id>/packed-unreal-orm.png","width":512,"height":512,"channels":{"r":"ao (constant 1)","g":"roughness","b":"metallic (constant 0)","a":"unused"},"notes":"Unreal ORM: R ambient occlusion, G roughness, B metallic."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preset":{"type":"string","enum":["unreal-orm","unity-urp-metallic","unity-hdrp-mask"]},"ao":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"roughness":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"smoothness":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Give roughness or smoothness; the other is derived (smoothness = 1 - roughness)."},"metallic":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"detail":{"type":"object","properties":{"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"size":{"type":"integer","minimum":16,"maximum":4096,"description":"Output side; default is the largest input."}},"required":["preset"],"additionalProperties":false},"example":{"preset":"unreal-orm","roughness":{"imageUrl":"https://rengi.dev/samples/stone.png"}}}}}}},"/v1/texture-tools/atlas":{"post":{"operationId":"texture-tools_post_atlas","summary":"Pack textures into one atlas with edge-filled gutters so mipmaps do not bleed; UV rects for bottom-left (Unity, OpenGL) and top-left (DirectX, Unreal) origins.","tags":["texture-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"atlas":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"rects":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"},"uv":{"type":"object","properties":{"u0":{"type":"number"},"v0":{"type":"number"},"u1":{"type":"number"},"v1":{"type":"number"}},"required":["u0","v0","u1","v1"],"additionalProperties":false,"description":"Bottom-left origin (OpenGL, Unity, three.js with flipY)"},"uvTopLeft":{"type":"object","properties":{"u0":{"type":"number"},"v0":{"type":"number"},"u1":{"type":"number"},"v1":{"type":"number"}},"required":["u0","v0","u1","v1"],"additionalProperties":false,"description":"Top-left origin (DirectX, Unreal)"}},"required":["name","x","y","w","h","uv","uvTopLeft"],"additionalProperties":false}},"json":{"type":"string"}},"required":["atlas","width","height","rects","json"],"additionalProperties":false},"example":{"atlas":"https://rengi.dev/files/<id>/atlas.png","width":1024,"height":512,"rects":[{"name":"stone","x":8,"y":8,"w":450,"h":450,"uv":{"u0":0.0078,"v0":0.1094,"u1":0.4473,"v1":0.9844},"uvTopLeft":{"u0":0.0078,"v0":0.0156,"u1":0.4473,"v1":0.8906}}],"json":"https://rengi.dev/files/<id>/atlas.json"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"textures":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"image":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"required":["name"],"additionalProperties":false},"minItems":1,"maxItems":256},"padding":{"type":"integer","minimum":0,"maximum":64,"default":8,"description":"Gutter around each texture, filled with its edge pixels so mipmaps do not bleed."},"powerOfTwo":{"type":"boolean","default":true},"maxSize":{"type":"integer","minimum":64,"maximum":8192,"default":4096}},"required":["textures"],"additionalProperties":false},"example":{"textures":[{"name":"stone","imageUrl":"https://rengi.dev/samples/stone-tile.png"},{"name":"crate","imageUrl":"https://rengi.dev/samples/crate.png"}],"padding":8}}}}}},"/v1/audio-tools/clean":{"post":{"operationId":"audio-tools_post_clean","summary":"Trim silence, normalize loudness to a LUFS target with a -1 dBTP ceiling, add anti-click fades and convert (ogg, wav, mp3; mono for SFX). Returns the file, a waveform and measured stats.","tags":["audio-tools"],"x-price-usd":"0.05","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string"},"waveform":{"type":"string"},"stats":{"type":"object","properties":{"durationSec":{"type":"number"},"sampleRate":{"type":"number"},"channels":{"type":"number"},"integratedLufs":{"type":"number"},"truePeakDb":{"type":"number"}},"required":["durationSec","sampleRate","channels","integratedLufs","truePeakDb"],"additionalProperties":false},"before":{"type":"object","properties":{"durationSec":{"type":"number"},"integratedLufs":{"type":"number"}},"required":["durationSec","integratedLufs"],"additionalProperties":false},"limitedByPeak":{"type":"boolean","description":"true when the target would push the peak over -1 dBTP, so the sound ends a little quieter than the target"}},"required":["file","waveform","stats","before","limitedByPeak"],"additionalProperties":false},"example":{"file":"https://rengi.dev/files/<id>/clean.ogg","waveform":"https://rengi.dev/files/<id>/waveform.png","stats":{"durationSec":0.42,"sampleRate":44100,"channels":1,"integratedLufs":-16.1,"truePeakDb":-1.2},"before":{"durationSec":1.5,"integratedLufs":-27.3},"limitedByPeak":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.05 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","description":"Audio file as base64 (wav, mp3, ogg, flac, m4a)."},"audioUrl":{"type":"string","format":"uri","description":"Audio file URL."},"format":{"type":"string","enum":["ogg","wav","mp3"],"default":"ogg"},"kind":{"type":"string","enum":["sfx","music","ambience","voice"],"default":"sfx","description":"Sets the loudness target and channel default: sfx -16 LUFS mono, music -18 stereo, ambience -20 stereo, voice -16 mono."},"targetLufs":{"type":"number","minimum":-40,"maximum":-6},"trimSilence":{"type":"boolean","default":true},"silenceThresholdDb":{"type":"number","minimum":-90,"maximum":-20,"default":-50},"mono":{"type":"boolean"},"sampleRate":{"type":"number","enum":[22050,44100,48000]}},"additionalProperties":false},"example":{"audioUrl":"https://rengi.dev/samples/hit.wav","kind":"sfx","format":"ogg"}}}}}},"/v1/audio-tools/loop":{"post":{"operationId":"audio-tools_post_loop","summary":"Turn music or ambience into a seamless loop: cuts at zero crossings and crossfades the end into the start with an equal-power curve. Returns the loop, a 3x preview and loop points in samples.","tags":["audio-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string"},"preview":{"type":"string","description":"The loop played three times, to listen for the join."},"waveform":{"type":"string"},"loopStartSample":{"type":"number"},"loopEndSample":{"type":"number"},"sampleRate":{"type":"number"},"durationSec":{"type":"number"}},"required":["file","preview","waveform","loopStartSample","loopEndSample","sampleRate","durationSec"],"additionalProperties":false},"example":{"file":"https://rengi.dev/files/<id>/loop.ogg","preview":"https://rengi.dev/files/<id>/loop-x3.ogg","waveform":"https://rengi.dev/files/<id>/waveform.png","loopStartSample":0,"loopEndSample":211500,"sampleRate":44100,"durationSec":4.8}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","description":"Audio file as base64 (wav, mp3, ogg, flac, m4a)."},"audioUrl":{"type":"string","format":"uri","description":"Audio file URL."},"format":{"type":"string","enum":["ogg","wav","mp3"],"default":"ogg"},"startSec":{"type":"number","minimum":0},"endSec":{"type":"number","minimum":0},"crossfadeMs":{"type":"number","minimum":5,"maximum":2000,"default":120},"mono":{"type":"boolean","default":false}},"additionalProperties":false},"example":{"audioUrl":"https://rengi.dev/samples/ambience.wav","crossfadeMs":250}}}}}},"/v1/audio-tools/variations":{"post":{"operationId":"audio-tools_post_variations","summary":"Make 2-12 variations of one sound effect with small pitch and volume changes, so repeated footsteps or hits do not sound copy-pasted. Returns each file and a ZIP.","tags":["audio-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"variations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"file":{"type":"string"},"semitones":{"type":"number"},"gainDb":{"type":"number"},"durationSec":{"type":"number"}},"required":["name","file","semitones","gainDb","durationSec"],"additionalProperties":false}},"zip":{"type":"string"},"waveform":{"type":"string"}},"required":["variations","zip","waveform"],"additionalProperties":false},"example":{"variations":[{"name":"hit_01","file":"https://rengi.dev/files/<id>/hit_01.ogg","semitones":-1.2,"gainDb":0.8,"durationSec":0.48}],"zip":"https://rengi.dev/files/<id>/variations.zip","waveform":"https://rengi.dev/files/<id>/waveform.png"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","description":"Audio file as base64 (wav, mp3, ogg, flac, m4a)."},"audioUrl":{"type":"string","format":"uri","description":"Audio file URL."},"format":{"type":"string","enum":["ogg","wav","mp3"],"default":"ogg"},"count":{"type":"integer","minimum":2,"maximum":12,"default":5},"pitchSemitones":{"type":"number","minimum":0,"maximum":6,"default":2,"description":"Max pitch change either way."},"volumeDb":{"type":"number","minimum":0,"maximum":12,"default":2,"description":"Max volume change either way."},"seed":{"type":"integer","default":1},"mono":{"type":"boolean"}},"additionalProperties":false},"example":{"audioUrl":"https://rengi.dev/samples/hit.wav","count":5}}}}}},"/v1/audio-tools/voice":{"post":{"operationId":"audio-tools_post_voice","summary":"Make a voice recording or TTS take game-ready: rumble high-passed, noise reduced against the measured floor, sibilance tamed, dialogue loudness (-18 LUFS) with a -1 dBTP ceiling, and a long take split into one file per phrase with a CSV cue sheet.","tags":["audio-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"durationSec":{"type":"number"}},"required":["file","start","end","durationSec"],"additionalProperties":false}},"csv":{"type":"string"},"zip":{"type":"string"},"waveformBefore":{"type":"string"},"waveform":{"type":"string"},"stats":{"type":"object","properties":{"durationSec":{"type":"number"},"sampleRate":{"type":"number"},"channels":{"type":"number"},"integratedLufs":{"type":"number"},"truePeakDb":{"type":"number"}},"required":["durationSec","sampleRate","channels","integratedLufs","truePeakDb"],"additionalProperties":false},"noiseFloor":{"type":"object","properties":{"beforeDb":{"type":"number"},"afterDb":{"type":"number"}},"required":["beforeDb","afterDb"],"additionalProperties":false},"limitedByPeak":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["file","lines","csv","zip","waveformBefore","waveform","stats","noiseFloor","limitedByPeak","warnings"],"additionalProperties":false},"example":{"file":"https://rengi.dev/files/<id>/voice.ogg","lines":[{"file":"https://rengi.dev/files/<id>/lines/line_001.ogg","start":0.54,"end":1.76,"durationSec":1.22}],"csv":"https://rengi.dev/files/<id>/lines.csv","zip":"https://rengi.dev/files/<id>/voice.zip","waveformBefore":"https://rengi.dev/files/<id>/waveform-before.png","waveform":"https://rengi.dev/files/<id>/waveform.png","stats":{"durationSec":7,"sampleRate":48000,"channels":1,"integratedLufs":-18,"truePeakDb":-2.1},"noiseFloor":{"beforeDb":-52.3,"afterDb":-71.8},"limitedByPeak":false,"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","description":"Audio file as base64 (wav, mp3, ogg, flac, m4a)."},"audioUrl":{"type":"string","format":"uri","description":"Audio file URL."},"format":{"type":"string","enum":["ogg","wav","mp3"],"default":"ogg"},"targetLufs":{"type":"number","minimum":-30,"maximum":-10,"default":-18,"description":"Dialogue loudness; -18 LUFS is a common game VO target."},"denoise":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"0 gentle, 1 strong. Strong denoising can make a voice sound metallic."},"split":{"type":"boolean","default":true,"description":"One file per phrase."},"minSilenceMs":{"type":"integer","minimum":100,"maximum":3000,"default":350,"description":"A pause at least this long separates two phrases."}},"additionalProperties":false},"example":{"audioUrl":"https://rengi.dev/samples/voice-take.wav"}}}}}},"/v1/store-assets/steam":{"post":{"operationId":"store-assets_post_steam","summary":"Every Steam store and library capsule from one key art at the exact required sizes: logo composited per Steam rules, Library Hero without logo, separate transparent Library Logo, page background, a contact sheet and a ZIP.","tags":["store-assets"],"x-price-usd":"0.20","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","properties":{"header":{"type":"string"},"small":{"type":"string"},"main":{"type":"string"},"vertical":{"type":"string"},"libraryCapsule":{"type":"string"},"libraryHeader":{"type":"string"},"libraryHero":{"type":"string"},"pageBackground":{"type":"string"},"libraryLogo":{"type":"string"}},"required":["header","small","main","vertical","libraryCapsule","libraryHeader","libraryHero","pageBackground"],"additionalProperties":false},"contactSheet":{"type":"string"},"zip":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["files","contactSheet","zip","warnings"],"additionalProperties":false},"example":{"files":{"header":"https://rengi.dev/files/<id>/header_capsule.png","small":"https://rengi.dev/files/<id>/small_capsule.png","main":"https://rengi.dev/files/<id>/main_capsule.png","vertical":"https://rengi.dev/files/<id>/vertical_capsule.png","libraryCapsule":"https://rengi.dev/files/<id>/library_capsule.png","libraryHeader":"https://rengi.dev/files/<id>/library_header.png","libraryHero":"https://rengi.dev/files/<id>/library_hero.png","pageBackground":"https://rengi.dev/files/<id>/page_background.png","libraryLogo":"https://rengi.dev/files/<id>/library_logo.png"},"contactSheet":"https://rengi.dev/files/<id>/contact_sheet.png","zip":"https://rengi.dev/files/<id>/steam_assets.zip","warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.20 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyArt":{"type":"object","properties":{"image":{"type":"string","description":"key art, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Your main artwork, ideally without text, at least 1920 px wide."},"logo":{"type":"object","properties":{"image":{"type":"string","description":"logo, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Game logo with a transparent background. Steam wants it on every capsule."},"heroArt":{"type":"object","properties":{"image":{"type":"string","description":"hero art, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Artwork for the Library Hero with no logo or text; key art is used when omitted."},"dimBackground":{"type":"number","minimum":0,"maximum":0.9,"default":0.45,"description":"How much to darken the page background so text stays readable."}},"required":["keyArt"],"additionalProperties":false},"example":{"keyArt":{"imageUrl":"https://rengi.dev/samples/key-art.png"},"logo":{"imageUrl":"https://rengi.dev/samples/logo.png"}}}}}}},"/v1/store-assets/icons":{"post":{"operationId":"store-assets_post_icons","summary":"App icons from one square art: iOS 1024 with Contents.json, Android adaptive icon layers at every density plus legacy and Play Store 512, and web favicons with a manifest snippet. Preview with the masks launchers apply.","tags":["store-assets"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ios":{"type":"object","properties":{"icon":{"type":"string"},"contentsJson":{"type":"string"}},"required":["icon","contentsJson"],"additionalProperties":false},"android":{"type":"object","properties":{"playStore":{"type":"string"},"foreground":{"type":"string"},"background":{"type":"string"},"adaptiveXml":{"type":"string"}},"required":["playStore","foreground","background","adaptiveXml"],"additionalProperties":false},"web":{"type":"object","properties":{"favicon32":{"type":"string"},"appleTouch":{"type":"string"},"icon512":{"type":"string"},"manifest":{"type":"string"}},"required":["favicon32","appleTouch","icon512","manifest"],"additionalProperties":false},"preview":{"type":"string"},"zip":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["ios","android","web","preview","zip","warnings"],"additionalProperties":false},"example":{"ios":{"icon":"https://rengi.dev/files/<id>/ios/AppIcon-1024.png","contentsJson":"https://rengi.dev/files/<id>/ios/Contents.json"},"android":{"playStore":"https://rengi.dev/files/<id>/android/play_store_512.png","foreground":"https://rengi.dev/files/<id>/android/mipmap-xxxhdpi/ic_launcher_foreground.png","background":"https://rengi.dev/files/<id>/android/mipmap-xxxhdpi/ic_launcher_background.png","adaptiveXml":"https://rengi.dev/files/<id>/android/mipmap-anydpi-v26/ic_launcher.xml"},"web":{"favicon32":"https://rengi.dev/files/<id>/web/favicon-32.png","appleTouch":"https://rengi.dev/files/<id>/web/apple-touch-icon.png","icon512":"https://rengi.dev/files/<id>/web/icon-512.png","manifest":"https://rengi.dev/files/<id>/web/site.webmanifest"},"preview":"https://rengi.dev/files/<id>/preview.png","zip":"https://rengi.dev/files/<id>/icons.zip","warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"art":{"type":"object","properties":{"image":{"type":"string","description":"icon art, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Square artwork, at least 1024x1024. Used as is for iOS and legacy icons."},"foreground":{"type":"object","properties":{"image":{"type":"string","description":"adaptive foreground, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Android adaptive icon foreground with transparency; the art is used when omitted."},"background":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Android adaptive background colour; sampled from the art's edge when omitted."},"name":{"type":"string","minLength":1,"maxLength":40,"default":"My Game"}},"required":["art"],"additionalProperties":false},"example":{"art":{"imageUrl":"https://rengi.dev/samples/icon-art.png"},"name":"My Game"}}}}}},"/v1/store-assets/stores":{"post":{"operationId":"store-assets_post_stores","summary":"One key art and logo to the store images beyond Steam: itch.io cover 630x500, Google Play feature graphic 1024x500, Epic landscape 2560x1440 and portrait 1200x1600; gameplay screenshots fitted to Google Play 1920x1080 and App Store iPhone 6.9\", 6.3\" and iPad 13\" sizes without stretching, no alpha where stores reject it.","tags":["store-assets"],"x-price-usd":"0.20","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","additionalProperties":{"type":"string"}},"contactSheet":{"type":"string"},"zip":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["files","contactSheet","zip","warnings"],"additionalProperties":false},"example":{"files":{"itch/cover.png":"https://rengi.dev/files/<id>/itch/cover.png","googlePlay/feature_graphic.png":"https://rengi.dev/files/<id>/googlePlay/feature_graphic.png"},"contactSheet":"https://rengi.dev/files/<id>/contact_sheet.png","zip":"https://rengi.dev/files/<id>/stores.zip","warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.20 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyArt":{"type":"object","properties":{"image":{"type":"string","description":"key art, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Main artwork without text, at least 1920 px wide."},"logo":{"type":"object","properties":{"image":{"type":"string","description":"logo, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false,"description":"Game logo with a transparent background."},"screenshots":{"type":"array","items":{"type":"object","properties":{"image":{"type":"string","description":"screenshot, base64 PNG/JPEG/WebP"},"imageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"maxItems":10,"description":"Gameplay screenshots to fit to Google Play and App Store sizes."},"stores":{"type":"array","items":{"type":"string","enum":["itch","googlePlay","epic","appStore"]},"minItems":1,"default":["itch","googlePlay","epic","appStore"]}},"required":["keyArt"],"additionalProperties":false},"example":{"keyArt":{"imageUrl":"https://rengi.dev/samples/key-art.png"},"logo":{"imageUrl":"https://rengi.dev/samples/logo.png"}}}}}}},"/v1/font-tools/bitmap":{"post":{"operationId":"font-tools_post_bitmap","summary":"Bitmap font from a TTF/OTF: atlas PNG, BMFont .fnt with kerning, JSON and a preview of a sample line. Pixel mode snaps glyphs to whole pixels with no antialiasing.","tags":["font-tools"],"x-price-usd":"0.10","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"atlas":{"type":"string"},"fnt":{"type":"string","description":"AngelCode BMFont text format (.fnt): Unity TextMeshPro/BMFont importers, Godot, Phaser, LibGDX."},"json":{"type":"string"},"preview":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"glyphs":{"type":"number"},"missing":{"type":"array","items":{"type":"string"},"description":"Characters the font does not have."},"lineHeight":{"type":"number"},"base":{"type":"number"}},"required":["atlas","fnt","json","preview","width","height","glyphs","missing","lineHeight","base"],"additionalProperties":false},"example":{"atlas":"https://rengi.dev/files/<id>/font.png","fnt":"https://rengi.dev/files/<id>/font.fnt","json":"https://rengi.dev/files/<id>/font.json","preview":"https://rengi.dev/files/<id>/preview.png","width":256,"height":128,"glyphs":191,"missing":[],"lineHeight":19,"base":15}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $0.10 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"font":{"type":"string","description":"TTF or OTF file as base64."},"fontUrl":{"type":"string","format":"uri"},"size":{"type":"integer","minimum":6,"maximum":256,"default":16,"description":"Pixel size (em)."},"mode":{"type":"string","enum":["pixel","smooth"],"default":"pixel","description":"pixel: crisp, no antialiasing, for pixel art games; smooth: antialiased."},"charset":{"type":"string","enum":["ascii","latin1","cyrillic","custom"],"default":"cyrillic"},"chars":{"type":"string","maxLength":4000,"description":"charset=custom: exactly these characters."},"color":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","default":"#ffffff","description":"Glyph colour baked into the atlas (white lets the engine tint it)."},"outline":{"type":"integer","minimum":0,"maximum":8,"default":0},"outlineColor":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","default":"#000000"},"padding":{"type":"integer","minimum":0,"maximum":8,"default":1},"sample":{"type":"string","maxLength":200,"default":"The quick brown fox 0123 Привіт, як справи?"}},"additionalProperties":false},"example":{"fontUrl":"https://rengi.dev/samples/DejaVuSans.ttf","size":16,"mode":"pixel","charset":"cyrillic"}}}}}},"/v1/leaderboard/boards":{"post":{"operationId":"leaderboard_post_boards","summary":"Create a board with 100,000 submissions and 365 days; returns keys and a ready JS snippet.","tags":["leaderboard"],"x-price-usd":"1.00","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"boardId":{"type":"string"},"submitKey":{"type":"string"},"adminKey":{"type":"string"},"quota":{"type":"number"},"expiresAt":{"type":"string"},"periods":{"type":"array","items":{"type":"string","enum":["alltime","daily","weekly"]}},"snippet":{"type":"string"},"note":{"type":"string"}},"required":["boardId","submitKey","adminKey","quota","expiresAt","periods","snippet","note"],"additionalProperties":false},"example":{"boardId":"lb_0123456789abcdef","submitKey":"sk_...","adminKey":"ak_...","quota":100000,"expiresAt":"2027-10-20T00:00:00.000Z","periods":["alltime","daily"],"snippet":"const LB = { ... }","note":"The admin key is shown once. Ship only the submit key in the game."}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $1.00 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"sort":{"type":"string","enum":["desc","asc"],"default":"desc","description":"desc: higher is better; asc: lower is better (times)"},"minScore":{"type":"number"},"maxScore":{"type":"number"},"periods":{"type":"array","items":{"type":"string","enum":["alltime","daily","weekly"]},"minItems":1,"maxItems":3,"default":["alltime"]},"signed":{"type":"boolean","default":false,"description":"Require HMAC-signed submissions (for games with a server)."}},"required":["name"],"additionalProperties":false},"example":{"name":"Endless Runner","sort":"desc","minScore":0,"maxScore":1000000,"periods":["alltime","daily"]}}}}}},"/v1/leaderboard/topup":{"post":{"operationId":"leaderboard_post_topup","summary":"Add 100,000 submissions and 365 days to a board.","tags":["leaderboard"],"x-price-usd":"1.00","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"boardId":{"type":"string"},"quota":{"type":"number"},"used":{"type":"number"},"expiresAt":{"type":"string"}},"required":["boardId","quota","used","expiresAt"],"additionalProperties":false},"example":{"boardId":"lb_0123456789abcdef","quota":200000,"used":91234,"expiresAt":"2028-10-20T00:00:00.000Z"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"402":{"description":"Payment required: $1.00 USDC via x402 (see PAYMENT-REQUIRED header)"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"boardId":{"type":"string"},"adminKey":{"type":"string"}},"required":["boardId","adminKey"],"additionalProperties":false},"example":{"boardId":"lb_0123456789abcdef","adminKey":"ak_..."}}}}}},"/v1/leaderboard/submit":{"post":{"operationId":"leaderboard_post_submit","summary":"Submit a score from the game (free, needs the submit key). Returns the player's rank per period.","tags":["leaderboard"],"x-price-usd":null,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ranks":{"type":"object","additionalProperties":{"type":"object","properties":{"rank":{"type":"number"},"best":{"type":"number"}},"required":["rank","best"],"additionalProperties":false}},"remainingQuota":{"type":"number"}},"required":["ranks","remainingQuota"],"additionalProperties":false},"example":{"ranks":{"alltime":{"rank":7,"best":1234}},"remainingQuota":99812}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"boardId":{"type":"string"},"submitKey":{"type":"string"},"playerId":{"type":"string","minLength":1,"maxLength":64},"playerName":{"type":"string","minLength":1,"maxLength":32},"score":{"type":"number"},"signature":{"type":"string","maxLength":128},"timestamp":{"type":"integer"}},"required":["boardId","submitKey","playerId","playerName","score"],"additionalProperties":false},"example":{"boardId":"lb_0123456789abcdef","submitKey":"sk_...","playerId":"p-42","playerName":"Ana","score":1234}}}}}},"/v1/leaderboard/top":{"get":{"operationId":"leaderboard_get_top","summary":"Top entries for a period (free).","tags":["leaderboard"],"x-price-usd":null,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"board":{"type":"string"},"period":{"type":"string","enum":["alltime","daily","weekly"]},"entries":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number"},"playerId":{"type":"string"},"playerName":{"type":"string"},"score":{"type":"number"}},"required":["rank","playerId","playerName","score"],"additionalProperties":false}}},"required":["board","period","entries"],"additionalProperties":false},"example":{"board":"Endless Runner","period":"alltime","entries":[{"rank":1,"playerId":"p-1","playerName":"Kim","score":99120}]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"name":"boardId","in":"query","required":true,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["alltime","daily","weekly"],"default":"alltime"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}]}},"/v1/leaderboard/rank":{"get":{"operationId":"leaderboard_get_rank","summary":"One player's rank and the five entries around them (free).","tags":["leaderboard"],"x-price-usd":null,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"rank":{"type":"number"},"score":{"type":"number"},"around":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number"},"playerId":{"type":"string"},"playerName":{"type":"string"},"score":{"type":"number"}},"required":["rank","playerId","playerName","score"],"additionalProperties":false}}},"required":["rank","score","around"],"additionalProperties":false},"example":{"rank":7,"score":1234,"around":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"name":"boardId","in":"query","required":true,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["alltime","daily","weekly"],"default":"alltime"}},{"name":"playerId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}]}},"/v1/leaderboard/admin":{"post":{"operationId":"leaderboard_post_admin","summary":"Admin actions with the admin key: reset a period, delete a player, rotate the submit key, read the signing secret (free).","tags":["leaderboard"],"x-price-usd":null,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"submitKey":{"type":"string"},"signingSecret":{"type":"string"}},"required":["ok"],"additionalProperties":false},"example":{"ok":true}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"boardId":{"type":"string"},"adminKey":{"type":"string"},"action":{"type":"string","enum":["reset-period","delete-player","rotate-submit-key","get-signing-secret"]},"period":{"type":"string","enum":["alltime","daily","weekly"]},"playerId":{"type":"string"}},"required":["boardId","adminKey","action"],"additionalProperties":false},"example":{"boardId":"lb_0123456789abcdef","adminKey":"ak_...","action":"delete-player","playerId":"cheater-1"}}}}}}}}