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.

fix(agents): route /api/agents/:id/pricing[/:skill] through [id].js

nirholas99e620a6c953
diff --git a/api/agents/[id].js b/api/agents/[id].js
index 274a37376..267a033b4 100644
--- a/api/agents/[id].js
+++ b/api/agents/[id].js
@@ -123,6 +123,15 @@ export default wrap(async function handler(req, res) {
return mod.handlePayments(req, res, id);
}
+ if (sub === 'pricing') {
+ if (action) {
+ const mod = await import('./_id/pricing/[skill].js');
+ return mod.default(req, res);
+ }
+ const mod = await import('./_id/pricing/index.js');
+ return mod.default(req, res);
+ }
+
if (sub === 'reputation') {
const mod = await import('./_id/reputation.js');
return mod.handleReputation(req, res, id);
diff --git a/api/agents/_id/pricing/index.js b/api/agents/_id/pricing/index.js
index d2b24b72e..d332a5bd3 100644
--- a/api/agents/_id/pricing/index.js
+++ b/api/agents/_id/pricing/index.js
@@ -3,10 +3,14 @@ import { cors, json, method, wrap, error } from '../../../_lib/http.js';
import { limits, clientIp } from '../../../_lib/rate-limit.js';
// GET /api/agents/:id/pricing — public for all agents (x402 manifest reads this)
-export default wrap(async (req, res, id) => {
+export default wrap(async (req, res) => {
if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
if (!method(req, res, ['GET'])) return;
+ const parts = new URL(req.url, 'http://x').pathname.split('/').filter(Boolean);
+ const id = parts[2];
+ if (!id) return error(res, 400, 'bad_request', 'missing agent id');
+
const rl = await limits.pricingPerIp(clientIp(req));
if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
diff --git a/vercel.json b/vercel.json
index 28a65c342..89ec9d361 100644
--- a/vercel.json
+++ b/vercel.json
@@ -372,6 +372,14 @@
"src": "/api/agents/([^/]+)/payments",
"dest": "/api/agents/[id]"
},
+ {
+ "src": "/api/agents/([^/]+)/pricing",
+ "dest": "/api/agents/[id]"
+ },
+ {
+ "src": "/api/agents/([^/]+)/pricing/([^/]+)",
+ "dest": "/api/agents/[id]"
+ },
{
"src": "/api/agents/([^/]+)/reputation",
"dest": "/api/agents/[id]"
@@ -484,6 +492,94 @@
"src": "/api/pump/helius-webhook",
"dest": "/api/pump/helius-webhook"
},
+ {
+ "src": "/api/pump/balances",
+ "dest": "/api/pump/[action]?action=balances"
+ },
+ {
+ "src": "/api/pump/buy-prep",
+ "dest": "/api/pump/[action]?action=buy-prep"
+ },
+ {
+ "src": "/api/pump/buy-confirm",
+ "dest": "/api/pump/[action]?action=buy-confirm"
+ },
+ {
+ "src": "/api/pump/sell-prep",
+ "dest": "/api/pump/[action]?action=sell-prep"
+ },
+ {
+ "src": "/api/pump/sell-confirm",
+ "dest": "/api/pump/[action]?action=sell-confirm"
+ },
+ {
+ "src": "/api/pump/launch-prep",
+ "dest": "/api/pump/[action]?action=launch-prep"
+ },
+ {
+ "src": "/api/pump/launch-confirm",
+ "dest": "/api/pump/[action]?action=launch-confirm"
+ },
+ {
+ "src": "/api/pump/accept-payment-prep",
+ "dest": "/api/pump/[action]?action=accept-payment-prep"
+ },
+ {
+ "src": "/api/pump/accept-payment-confirm",
+ "dest": "/api/pump/[action]?action=accept-payment-confirm"
+ },
+ {
+ "src": "/api/pump/payments-list",
+ "dest": "/api/pump/[action]?action=payments-list"
+ },
+ {
+ "src": "/api/pump/portfolio",
+ "dest": "/api/pump/[action]?action=portfolio"
+ },
+ {
+ "src": "/api/pump/by-agent",
+ "dest": "/api/pump/[action]?action=by-agent"
+ },
+ {
+ "src": "/api/pump/quote",
+ "dest": "/api/pump/[action]?action=quote"
+ },
+ {
+ "src": "/api/pump/governance-prep",
+ "dest": "/api/pump/[action]?action=governance-prep"
+ },
+ {
+ "src": "/api/pump/withdraw-prep",
+ "dest": "/api/pump/[action]?action=withdraw-prep"
+ },
+ {
+ "src": "/api/pump/withdraw-confirm",
+ "dest": "/api/pump/[action]?action=withdraw-confirm"
+ },
+ {
+ "src": "/api/pump/strategy-backtest",
+ "dest": "/api/pump/[action]?action=strategy-backtest"
+ },
+ {
+ "src": "/api/pump/strategy-close-all",
+ "dest": "/api/pump/[action]?action=strategy-close-all"
+ },
+ {
+ "src": "/api/pump/strategy-run",
+ "dest": "/api/pump/[action]?action=strategy-run"
+ },
+ {
+ "src": "/api/pump/strategy-validate",
+ "dest": "/api/pump/[action]?action=strategy-validate"
+ },
+ {
+ "src": "/api/pump/live-stream",
+ "dest": "/api/pump/[action]?action=live-stream"
+ },
+ {
+ "src": "/api/pump/recent-graduations",
+ "dest": "/api/pump/[action]?action=recent-graduations"
+ },
{
"src": "/api/avatars/presign",
"dest": "/api/avatars/[id]"