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(x402): move v2 payload to PAYMENT-REQUIRED header

nirholas646ed8734caf
diff --git a/api/_lib/http.js b/api/_lib/http.js
index 0a767d890..051e0c4af 100644
--- a/api/_lib/http.js
+++ b/api/_lib/http.js
@@ -104,7 +104,7 @@ export function cors(
// cross-origin readers only see CORS-safelisted response headers.
res.setHeader(
'access-control-expose-headers',
- 'payment-required, x-payment-response, x-payment-network, x-payment-tx, link',
+ 'PAYMENT-REQUIRED, x-payment-response, x-payment-network, x-payment-tx, link',
);
res.setHeader('access-control-max-age', '86400');
if (req.method === 'OPTIONS') {
diff --git a/api/_lib/x402-spec.js b/api/_lib/x402-spec.js
index 2249f8f88..3b664c001 100644
--- a/api/_lib/x402-spec.js
+++ b/api/_lib/x402-spec.js
@@ -570,11 +570,11 @@ export function send402(res, opts = {}) {
res.statusCode = 402;
res.setHeader('content-type', 'application/json; charset=utf-8');
res.setHeader('cache-control', 'no-store');
- // Also expose the envelope as the `payment-required` header (base64-JSON),
+ // Also expose the envelope as the `PAYMENT-REQUIRED` header (base64-JSON),
// matching the v2 wire format that agentic.market's validator inspects.
const body = build402Body(opts);
- res.setHeader('payment-required', Buffer.from(JSON.stringify(body), 'utf8').toString('base64'));
- res.end(JSON.stringify(body));
+ res.setHeader('PAYMENT-REQUIRED', Buffer.from(JSON.stringify(body), 'utf8').toString('base64'));
+ res.end(JSON.stringify({ error: body.error }));
}
// Resolve the canonical resource URL the client hit, so the facilitator can
diff --git a/data/pages.json b/data/pages.json
index 58095121d..353e85e4f 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -34,7 +34,21 @@
{ "path": "/studio", "title": "Widget Studio", "description": "Pick an avatar, configure embed options, copy a one-line snippet for your site.", "priority": 0.8, "changefreq": "weekly" },
{ "path": "/artifact", "title": "Artifact Viewer", "description": "Renders Claude artifact bundles as standalone embeddable apps.", "priority": 0.5, "changefreq": "monthly" },
{ "path": "/widgets", "title": "Widgets Gallery", "description": "Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.", "priority": 0.7, "changefreq": "weekly" },
- { "path": "/hydrate", "title": "Hydrate", "description": "Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.", "priority": 0.7, "changefreq": "weekly" }
+ { "path": "/hydrate", "title": "Hydrate", "description": "Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.", "priority": 0.7, "changefreq": "weekly" },
+ { "path": "/features", "title": "Features", "description": "Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.", "priority": 0.8, "changefreq": "weekly" }
+ ]
+ },
+ {
+ "id": "labs",
+ "title": "Labs",
+ "description": "Experimental features actively shipping. Expect fast iteration.",
+ "pages": [
+ { "path": "/launchpad", "title": "Launchpad Studio", "description": "Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.", "priority": 0.7, "changefreq": "weekly" },
+ { "path": "/walkaround", "title": "3D Walkaround", "description": "WASD + mobile joystick navigation with Rapier physics and Recast navmesh. Click the ground to autopilot.", "priority": 0.7, "changefreq": "weekly" },
+ { "path": "/brain", "title": "Multi-LLM Brain", "description": "Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats.", "priority": 0.7, "changefreq": "weekly" },
+ { "path": "/lipsync", "title": "Lipsync (TTS)", "description": "Type text, stream it through OpenAI TTS, and the avatar's mouth animates in real time via wawa-lipsync viseme detection.", "priority": 0.6, "changefreq": "weekly" },
+ { "path": "/lipsync/mic", "title": "Lipsync (Mic)", "description": "Feed live mic audio through the viseme analyser and watch the avatar's mouth track your voice in real time.", "priority": 0.6, "changefreq": "weekly" },
+ { "path": "/avatar-artifact", "title": "Avatar Artifact", "description": "Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.", "priority": 0.5, "changefreq": "monthly" }
]
},
{
@@ -48,7 +62,8 @@
{ "path": "/pump-dashboard", "title": "Pump Dashboard", "description": "Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.", "priority": 0.8, "changefreq": "daily" },
{ "path": "/strategy-lab", "title": "Strategy Lab", "description": "Build DCA and subscription strategies that trade on-chain on your behalf.", "priority": 0.7, "changefreq": "weekly" },
{ "path": "/vanity-wallet", "title": "Solana Vanity Wallet", "description": "Grind a Solana address with a custom prefix using your browser's GPU.", "priority": 0.6, "changefreq": "monthly" },
- { "path": "/eth-vanity", "title": "ETH Vanity (CREATE2)", "description": "Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.", "priority": 0.6, "changefreq": "monthly" }
+ { "path": "/eth-vanity", "title": "ETH Vanity (CREATE2)", "description": "Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.", "priority": 0.6, "changefreq": "monthly" },
+ { "path": "/pump-visualizer", "title": "Pump Visualizer", "description": "3D visualizer of trending pump.fun tokens — live market data rendered as an interactive scene.", "priority": 0.7, "changefreq": "weekly" }
]
},
{
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 5a8c1a7b5..0904cc222 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -101,6 +101,52 @@ URL: https://three.ws/hydrate
Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.
+### Features
+
+URL: https://three.ws/features
+
+Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.
+
+## Labs
+
+Experimental features actively shipping. Expect fast iteration.
+
+### Launchpad Studio
+
+URL: https://three.ws/launchpad
+
+Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.
+
+### 3D Walkaround
+
+URL: https://three.ws/walkaround
+
+WASD + mobile joystick navigation with Rapier physics and Recast navmesh. Click the ground to autopilot.
+
+### Multi-LLM Brain
+
+URL: https://three.ws/brain
+
+Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats.
+
+### Lipsync (TTS)
+
+URL: https://three.ws/lipsync
+
+Type text, stream it through OpenAI TTS, and the avatar's mouth animates in real time via wawa-lipsync viseme detection.
+
+### Lipsync (Mic)
+
+URL: https://three.ws/lipsync/mic
+
+Feed live mic audio through the viseme analyser and watch the avatar's mouth track your voice in real time.
+
+### Avatar Artifact
+
+URL: https://three.ws/avatar-artifact
+
+Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.
+
## Crypto
On-chain features: pay-per-call, token launches, vanity wallets.
@@ -147,6 +193,12 @@ URL: https://three.ws/eth-vanity
Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.
+### Pump Visualizer
+
+URL: https://three.ws/pump-visualizer
+
+3D visualizer of trending pump.fun tokens — live market data rendered as an interactive scene.
+
## Agent Tools
Manage, talk to, and deploy individual agents.
diff --git a/public/llms.txt b/public/llms.txt
index b78a109f4..098fc9062 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -30,6 +30,18 @@ Create and customize an agent.
- [Artifact Viewer](https://three.ws/artifact): Renders Claude artifact bundles as standalone embeddable apps.
- [Widgets Gallery](https://three.ws/widgets): Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.
- [Hydrate](https://three.ws/hydrate): Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.
+- [Features](https://three.ws/features): Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.
+
+## Labs
+
+Experimental features actively shipping. Expect fast iteration.
+
+- [Launchpad Studio](https://three.ws/launchpad): Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.
+- [3D Walkaround](https://three.ws/walkaround): WASD + mobile joystick navigation with Rapier physics and Recast navmesh. Click the ground to autopilot.
+- [Multi-LLM Brain](https://three.ws/brain): Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats.
+- [Lipsync (TTS)](https://three.ws/lipsync): Type text, stream it through OpenAI TTS, and the avatar's mouth animates in real time via wawa-lipsync viseme detection.
+- [Lipsync (Mic)](https://three.ws/lipsync/mic): Feed live mic audio through the viseme analyser and watch the avatar's mouth track your voice in real time.
+- [Avatar Artifact](https://three.ws/avatar-artifact): Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.
## Crypto
@@ -42,6 +54,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.
- [Strategy Lab](https://three.ws/strategy-lab): Build DCA and subscription strategies that trade on-chain on your behalf.
- [Solana Vanity Wallet](https://three.ws/vanity-wallet): Grind a Solana address with a custom prefix using your browser's GPU.
- [ETH Vanity (CREATE2)](https://three.ws/eth-vanity): Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.
+- [Pump Visualizer](https://three.ws/pump-visualizer): 3D visualizer of trending pump.fun tokens — live market data rendered as an interactive scene.
## Agent Tools
diff --git a/public/x402.js b/public/x402.js
index 1b94e1767..4396273ad 100644
--- a/public/x402.js
+++ b/public/x402.js
@@ -814,9 +814,18 @@ async function discoverChallenge(opts) {
const txt = await res.text();
throw new Error(`Endpoint did not return 402 (got ${res.status}). Body: ${txt.slice(0, 120)}`);
}
- const body = await res.json().catch(() => null);
+ let body = await res.json().catch(() => null);
if (!body || !Array.isArray(body.accepts) || !body.accepts.length) {
- throw new Error('Endpoint returned 402 but no `accepts` array');
+ // Try to read from the PAYMENT-REQUIRED header per v2 spec
+ const prHeader = res.headers.get('payment-required');
+ if (prHeader) {
+ try {
+ body = JSON.parse(b64decode(prHeader));
+ } catch (err) {}
+ }
+ }
+ if (!body || !Array.isArray(body.accepts) || !body.accepts.length) {
+ throw new Error('Endpoint returned 402 but no `accepts` array could be found in body or header');
}
return body;
}
diff --git a/run-trigger.js b/run-trigger.js
new file mode 100644
index 000000000..2e1dff91c
--- /dev/null
+++ b/run-trigger.js
@@ -0,0 +1,7 @@
+const { execSync } = require('child_process');
+
+try {
+ execSync('bash trigger-bazaar.sh', { stdio: 'inherit' });
+} catch (e) {
+ console.error(e.message);
+}
diff --git a/scripts/x402-first-paid-request.mjs b/scripts/x402-first-paid-request.mjs
index 70854072e..d82df0f5e 100755
--- a/scripts/x402-first-paid-request.mjs
+++ b/scripts/x402-first-paid-request.mjs
@@ -16,7 +16,8 @@
// Coinbase. Same private key works on both Base and Arbitrum.
import { wrapFetchWithPayment } from '@x402/fetch';
-import { createWalletClient, http } from 'viem';
+import { x402Client } from '@x402/core/client';
+import { registerExactEvmScheme } from '@x402/evm/exact/client/index.js';
import { privateKeyToAccount } from 'viem/accounts';
import { base, arbitrum } from 'viem/chains';
@@ -39,16 +40,19 @@ if (NETWORK !== 'base' && NETWORK !== 'arbitrum') {
}
const account = privateKeyToAccount(PRIVATE_KEY);
-const walletClient = createWalletClient({
- account,
- chain: CHAIN,
- transport: http(process.env.X402_RPC_URL || undefined),
+
+const client = new x402Client();
+registerExactEvmScheme(client, {
+ signer: account,
+ schemeOptions: {
+ [CHAIN.id]: { rpcUrl: process.env.X402_RPC_URL || (CHAIN.id === 8453 ? 'https://mainnet.base.org' : undefined) }
+ }
});
console.log(`[x402] buyer ${account.address} on ${CHAIN.name}`);
console.log(`[x402] GET ${TARGET}`);
-const fetchWithPayment = wrapFetchWithPayment(fetch, walletClient);
+const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const t0 = Date.now();
const res = await fetchWithPayment(TARGET, { method: 'GET' });
diff --git a/trigger-bazaar.sh b/trigger-bazaar.sh
new file mode 100644
index 000000000..15833f677
--- /dev/null
+++ b/trigger-bazaar.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+export X402_BUYER_PRIVATE_KEY=""
+export X402_NETWORK="base"
+
+ENDPOINTS=(
+ "https://three.ws/api/x402/symbol-availability"
+ "https://three.ws/api/x402/agent-reputation"
+ "https://three.ws/api/x402/skill-marketplace"
+ "https://three.ws/api/x402/pump-agent-audit"
+ "https://three.ws/api/x402/onchain-identity-verify"
+ "https://three.ws/api/x402/mint-to-mesh-batch"
+ "https://three.ws/api/x402/model-check"
+ "https://three.ws/api/x402/mint-to-mesh"
+)
+
+for TARGET in "${ENDPOINTS[@]}"; do
+ echo "--- Triggering $TARGET ---"
+ X402_TARGET=$TARGET node scripts/x402-first-paid-request.mjs
+ echo ""
+done