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: cron handler improvements

nirholas9e2540fe8578
diff --git a/api/cron/[name].js b/api/cron/[name].js
index 79e52bd37..e1321d1c3 100644
--- a/api/cron/[name].js
+++ b/api/cron/[name].js
@@ -432,7 +432,18 @@ const PUBLIC_RPCS = {
function idxRpcUrls(chainId) {
const envUrl = process.env[`RPC_URL_${chainId}`];
- const fallbacks = PUBLIC_RPCS[chainId] ?? [];
+ const ankrKey = process.env.ANKR_API_KEY;
+ // Ankr sunset keyless access: every https://rpc.ankr.com/<chain> call now
+ // returns "Unauthorized: authenticate with an API key", so a keyless entry
+ // is a guaranteed failed attempt + error log each run. With a key, rewrite
+ // to Ankr's authenticated form (…/<chain>/<KEY>); without one, drop it so
+ // failover lands on a working public node instead.
+ const fallbacks = (PUBLIC_RPCS[chainId] ?? [])
+ .map((url) => {
+ if (!url.startsWith('https://rpc.ankr.com/')) return url;
+ return ankrKey ? `${url}/${ankrKey}` : null;
+ })
+ .filter(Boolean);
return envUrl ? [envUrl, ...fallbacks] : fallbacks;
}