Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: implement global circuit breaker for free 3D studio to manage capacity limits

zprv4f1dd9b8e8d0
diff --git a/api/mcp-studio.js b/api/mcp-studio.js
index 05c1a33dc..4fcd75b34 100644
--- a/api/mcp-studio.js
+++ b/api/mcp-studio.js
@@ -70,6 +70,11 @@ export default wrap(async (req, res) => {
if (!burst.success) return rateLimited(res, burst, 'generation rate limit — slow down and try again shortly');
const hourly = await limits.studioGenHourly(ip);
if (!hourly.success) return rateLimited(res, hourly, 'hourly generation limit reached — try again later');
+ // Platform-wide circuit breaker across ALL free-studio callers — backstops
+ // the shared GPU/provider budget when many distinct IPs, each under their
+ // own hourly cap, would collectively drain it. Fails closed in prod.
+ const global = await limits.studioGenerateGlobal();
+ if (!global.success) return rateLimited(res, global, 'the free 3D studio is at capacity right now — please try again later');
}
// Anonymous principal — no auth, no scope. rateKey carries the IP for usage logs.