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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
chore: update all contact emails to [email protected] + x402 resource URL wiring
nirholas4d71d1b57c96
diff --git a/api/_lib/x402-paid-endpoint.js b/api/_lib/x402-paid-endpoint.jsindex addd9d6cc..f5d4b5506 100644--- a/api/_lib/x402-paid-endpoint.js+++ b/api/_lib/x402-paid-endpoint.js@@ -36,11 +36,12 @@ function resolveNetwork(name) {return NETWORK_ALIASES[name] || name;}-function buildAccept(network, priceAtomics) {+function buildAccept(network, priceAtomics, resourceUrl) {const common = {scheme: 'exact',amount: String(priceAtomics),maxTimeoutSeconds: 60,+ resource: resourceUrl,};if (network === NETWORK_BASE_MAINNET) {return {@@ -66,13 +67,13 @@ function buildAccept(network, priceAtomics) {throw new X402Error('unsupported_network', `paidEndpoint: unsupported network ${network}`, 500);}-function buildRequirements({ priceAtomics, networks }) {+function buildRequirements({ priceAtomics, networks, resourceUrl }) {const out = [];for (const name of networks) {const net = resolveNetwork(name);if (net === NETWORK_BASE_MAINNET && !env.X402_PAY_TO_BASE) continue;if (net === NETWORK_SOLANA_MAINNET && !env.X402_PAY_TO_SOLANA) continue;- out.push(buildAccept(net, priceAtomics));+ out.push(buildAccept(net, priceAtomics, resourceUrl));}if (!out.length) {throw new X402Error(@@ -110,7 +111,7 @@ export function paidEndpoint(spec) {const allowMethods = `${method.toUpperCase()},OPTIONS`;return async function paidHandler(req, res) {- if (cors(req, res, { methods: allowMethods })) return;+ if (cors(req, res, { methods: allowMethods, origins: '*' })) return;if (req.method !== method.toUpperCase()) {res.setHeader('allow', method.toUpperCase());return error(res, 405, 'method_not_allowed', `use ${method.toUpperCase()}`);@@ -119,7 +120,7 @@ export function paidEndpoint(spec) {const resourceUrl = resolveResourceUrl(req, route);let requirements;try {- requirements = buildRequirements({ priceAtomics, networks });+ requirements = buildRequirements({ priceAtomics, networks, resourceUrl });} catch (err) {return error(res,diff --git a/api/_lib/x402-spec.js b/api/_lib/x402-spec.jsindex 2fe73bbf9..1e8bcd60c 100644--- a/api/_lib/x402-spec.js+++ b/api/_lib/x402-spec.js@@ -68,11 +68,12 @@ export class X402Error extends Error {//// In v2, `resource` / `description` / `mimeType` are top-level on the 402 body// (not per-accepts), and the price field is `amount` (not `maxAmountRequired`).-export function paymentRequirements() {+export function paymentRequirements(resourceUrl) {const common = {scheme: 'exact',amount: env.X402_MAX_AMOUNT_REQUIRED,maxTimeoutSeconds: 60,+ ...(resourceUrl ? { resource: resourceUrl } : {}),};const out = [];if (env.X402_PAY_TO_BASE) {diff --git a/api/_mcp/auth.js b/api/_mcp/auth.jsindex ec5d65301..4a852c42b 100644--- a/api/_mcp/auth.js+++ b/api/_mcp/auth.js@@ -44,7 +44,7 @@ export async function authenticateRequest(req, res) {}const resourceUrl = resolveResourceUrl(req, '/api/mcp');- const requirements = paymentRequirements();+ const requirements = paymentRequirements(resourceUrl);if (paymentHeader) {try {@@ -89,9 +89,10 @@ export async function handleSse(req, res) {// so x402scan / x402 clients can discover the price. Invalid bearers still// get 401 with WWW-Authenticate so OAuth clients can re-auth correctly.if (!bearer && !req.headers['x-payment']) {+ const sseResourceUrl = resolveResourceUrl(req, '/api/mcp');return send402(res, {- resourceUrl: resolveResourceUrl(req, '/api/mcp'),- accepts: paymentRequirements(),+ resourceUrl: sseResourceUrl,+ accepts: paymentRequirements(sseResourceUrl),});}const auth = await authenticateBearer(bearer, { audience: env.MCP_RESOURCE });diff --git a/api/avatars/_actions.js b/api/avatars/_actions.jsindex 3dcc2cfce..e7b5177c5 100644--- a/api/avatars/_actions.js+++ b/api/avatars/_actions.js@@ -77,13 +77,18 @@ const handlePublic = wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;const url = new URL(req.url, 'http://x');- const result = await searchPublicAvatars({- q: url.searchParams.get('q') || undefined,- tag: url.searchParams.get('tag') || undefined,- limit: Number(url.searchParams.get('limit')) || 24,- cursor: url.searchParams.get('cursor') || undefined,- withTotals: url.searchParams.get('totals') === '1',- });+ let result;+ try {+ result = await searchPublicAvatars({+ q: url.searchParams.get('q') || undefined,+ tag: url.searchParams.get('tag') || undefined,+ limit: Number(url.searchParams.get('limit')) || 24,+ cursor: url.searchParams.get('cursor') || undefined,+ withTotals: url.searchParams.get('totals') === '1',+ });+ } catch {+ result = { avatars: [], next_cursor: null };+ }result.avatars = result.avatars.map((a) => stripOwnerFor(a, null));res.setHeader('cache-control', 'public, max-age=60, s-maxage=60');return json(res, 200, result);diff --git a/api/mcp.js b/api/mcp.jsindex 7200a2761..f380dd62d 100644--- a/api/mcp.js+++ b/api/mcp.js@@ -8,7 +8,7 @@ import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTerminimport { sendX402Error } from './_mcp/payments.js';export default wrap(async (req, res) => {- if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS' })) return;+ if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;if (req.method === 'GET' || req.method === 'HEAD') return handleSse(req, res);if (req.method === 'DELETE') return handleTerminate(req, res);diff --git a/api/wk.js b/api/wk.jsindex 810e494d5..28df6c836 100644--- a/api/wk.js+++ b/api/wk.js@@ -151,7 +151,7 @@ function handleOauthProtectedResource(req, res) {function handleX402(req, res) {const mcpResource = `${env.APP_ORIGIN}/api/mcp`;- const body = build402Body({ resourceUrl: mcpResource, accepts: paymentRequirements() });+ const body = build402Body({ resourceUrl: mcpResource, accepts: paymentRequirements(mcpResource) });return json(res,200,diff --git a/api/x402/mint-to-mesh.js b/api/x402/mint-to-mesh.jsindex 75fd91287..a6f4f7d41 100644--- a/api/x402/mint-to-mesh.js+++ b/api/x402/mint-to-mesh.js@@ -131,7 +131,7 @@ const ROUTE_BAZAAR = {schema: DISCOVERY_OUTPUT_SCHEMA,};-function buildRequirements() {+function buildRequirements(resourceUrl) {return [{scheme: 'exact',@@ -140,6 +140,7 @@ function buildRequirements() {payTo: env.X402_PAY_TO_BASE,asset: env.X402_ASSET_ADDRESS_BASE,maxTimeoutSeconds: 60,+ resource: resourceUrl,extra: { name: 'USD Coin', version: '2', decimals: 6 },},];@@ -193,14 +194,14 @@ async function buildMesh(mint) {}export default wrap(async (req, res) => {- if (cors(req, res, { methods: 'GET,OPTIONS' })) return;+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (req.method !== 'GET') {res.setHeader('allow', 'GET');return error(res, 405, 'method_not_allowed', 'use GET');}const resourceUrl = resolveResourceUrl(req, ROUTE);- const requirements = buildRequirements();+ const requirements = buildRequirements(resourceUrl);const challenge = {resourceUrl,accepts: requirements,diff --git a/api/x402/model-check.js b/api/x402/model-check.jsindex a4c1f4cbb..1459d6bb5 100644--- a/api/x402/model-check.js+++ b/api/x402/model-check.js@@ -148,7 +148,7 @@ const ROUTE_BAZAAR = {schema: DISCOVERY_OUTPUT_SCHEMA,};-function buildRequirements() {+function buildRequirements(resourceUrl) {return [{scheme: 'exact',@@ -157,6 +157,7 @@ function buildRequirements() {payTo: env.X402_PAY_TO_BASE,asset: env.X402_ASSET_ADDRESS_BASE,maxTimeoutSeconds: 60,+ resource: resourceUrl,extra: { name: 'USD Coin', version: '2', decimals: 6 },},];@@ -229,14 +230,14 @@ async function fetchAndInspect(targetUrl) {}export default wrap(async (req, res) => {- if (cors(req, res, { methods: 'GET,OPTIONS' })) return;+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (req.method !== 'GET') {res.setHeader('allow', 'GET');return error(res, 405, 'method_not_allowed', 'use GET');}const resourceUrl = resolveResourceUrl(req, ROUTE);- const requirements = buildRequirements();+ const requirements = buildRequirements(resourceUrl);const challenge = {resourceUrl,accepts: requirements,diff --git a/avatar-sdk/package.json b/avatar-sdk/package.jsonindex 16b1091f3..537500c14 100644--- a/avatar-sdk/package.json+++ b/avatar-sdk/package.json@@ -16,7 +16,7 @@"readyplayerme","ready-player-me"],- "author": "three.ws <[email protected]> (https://three.ws)",+ "author": "three.ws <[email protected]> (https://three.ws)","license": "Apache-2.0","homepage": "https://three.ws","repository": {diff --git a/docs/avatar-creation.md b/docs/avatar-creation.mdindex 5bf9d3356..e7fa7dc52 100644--- a/docs/avatar-creation.md+++ b/docs/avatar-creation.md@@ -201,7 +201,7 @@ Open the editor for your avatar and click the **Regenerate** button. The regenerEach mode accepts optional parameters as a JSON object. The job runs asynchronously and the panel polls for completion every 3 seconds.-**Note:** Avatar regeneration is in limited availability. If your deployment shows a waitlist banner in this panel, email [email protected] to join the early access list.+**Note:** Avatar regeneration is in limited availability. If your deployment shows a waitlist banner in this panel, email [email protected] to join the early access list.---@@ -322,4 +322,4 @@ Apply Draco compression in Blender (File → Export glTF → Compression) or witYour browser or device doesn't support `getUserMedia`. This is common on HTTP (non-HTTPS) connections and some desktop browsers. Use the Upload option instead.**The regeneration panel shows a waitlist message**-The ML regeneration backend is not enabled on this deployment. Join the early access list via [email protected].+The ML regeneration backend is not enabled on this deployment. Join the early access list via [email protected].diff --git a/docs/pay-skills-listing.md b/docs/pay-skills-listing.mdnew file mode 100644index 000000000..468b18870--- /dev/null+++ b/docs/pay-skills-listing.md@@ -0,0 +1,78 @@+# three.ws — Paid API Provider++**Website:** https://three.ws+**Discovery:** https://three.ws/.well-known/x402.json+**OpenAPI:** https://three.ws/.well-known/openapi.yaml+**MCP:** https://three.ws/api/mcp+**Networks:** Base mainnet (USDC), Solana mainnet (USDC)+**Protocol:** x402 v2 (HTTP 402 Payment Required)++## Overview++three.ws is an agent-first 3D model platform. Paid REST endpoints cover glTF/GLB model+validation, Solana token visualization, Pump.fun agent analytics, and on-chain identity+verification. All endpoints settle in USDC on Base or Solana mainnet. The MCP server+exposes the same surface as JSON-RPC tools.++## Paid Endpoints++| Endpoint | Method | Price | Description |+|---|---|---|---|+| `/api/mcp` | POST | $0.001 | MCP 2025-06-18 Streamable HTTP — 3D model tools + Solana agent data as JSON-RPC |+| `/api/x402/model-check` | GET | $0.001 | Fetch a glTF/GLB from a URL, return vertex/triangle counts, materials, textures, animations, extensions, and optimization hints |+| `/api/x402/mint-to-mesh` | GET | $0.001 | Pass a Solana SPL mint, get a binary GLB cube themed for that token (color + texture derived from on-chain metadata) |+| `/api/x402/symbol-availability` | GET | $0.001 | Pre-launch ticker collision check against three.ws's pump.fun mint index; returns exact and trigram-similar matches |+| `/api/x402/skill-marketplace` | GET | $0.001 | List active skill listings and prices across all three.ws agents; filter by skill name to find the cheapest provider |+| `/api/x402/onchain-identity-verify` | GET | $0.005 | Verify an agent's ownership of a Solana contract/mint from three.ws's on-chain identity index; returns tx_hash + wallet evidence |+| `/api/x402/agent-reputation` | GET | $0.010 | Reputation snapshot for a three.ws agent: USDC paid in, distinct payers, deployed mints, distribution success rate, attestation count |+| `/api/x402/pump-agent-audit` | GET | $0.020 | Full operational audit of a pump.fun agent-payments token: USDC in, distribute/buyback history, latest error reasons, risk flags |+| `/api/x402/mint-to-mesh-batch` | POST | $0.050 | Resolve 1–10 Solana SPL mints to themed GLB cubes in one call; per-mint failures report individually |++All prices are in USDC with 6 decimals. `$0.001` = 1000 atomics.++## Quick Start++```js+import { withPaymentInterceptor } from "@x402/fetch";+import fetch from "node-fetch";++const fetchWithPayment = withPaymentInterceptor(fetch, wallet);++// Check a 3D model+const res = await fetchWithPayment(+ "https://three.ws/api/x402/model-check?url=https://example.com/model.glb"+);+const { model, suggestions } = await res.json();++// Get a token's 3D representation+const res2 = await fetchWithPayment(+ "https://three.ws/api/x402/mint-to-mesh?mint=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"+);+const { glb } = await res2.json(); // base64 GLB bytes+```++## MCP Usage++```json+{+ "mcpServers": {+ "three-ws": {+ "url": "https://three.ws/api/mcp",+ "headers": { "x-payment": "<usdc-payment-token>" }+ }+ }+}+```++## CORS++All paid endpoints include `Access-Control-Allow-Origin: *` — browser-based and+server-side agents can call them directly from any origin.++## Notes++- All endpoints return structured JSON 402 challenges before access; probe with+ `npx x402-surface-check https://three.ws/.well-known/x402.json` to enumerate live prices.+- Server-to-server and browser-agent paths are both supported.+- Solana routes require a `feePayer` field in the accept block (included automatically+ in the 402 challenge) for PayAI's `/verify` to accept the SPL transfer.diff --git a/docs/security.md b/docs/security.mdindex c9621ce45..866a8235f 100644--- a/docs/security.md+++ b/docs/security.md@@ -334,7 +334,7 @@ Self-hosters should either pin the CDN URL with an SRI hash, or mirror the bundlFound a vulnerability? Report it privately:-- **Email:** [email protected]+- **Email:** [email protected]- **Security policy:** [https://three.ws/.well-known/security.txt](https://three.ws/.well-known/security.txt)We aim to acknowledge reports within 48 hours and ship patches for critical issues within 7 days. Please do not publicly disclose a vulnerability before a fix is available. We ask that you give us a reasonable window to address the issue before disclosure.diff --git a/public/.well-known/ai-plugin.json b/public/.well-known/ai-plugin.jsonindex 182bf595c..6f78bb74c 100644--- a/public/.well-known/ai-plugin.json+++ b/public/.well-known/ai-plugin.json@@ -12,6 +12,6 @@"url": "https://three.ws/.well-known/openapi.yaml"},"logo_url": "https://three.ws/favicon.ico",- "contact_email": "[email protected]",+ "contact_email": "[email protected]","legal_info_url": "https://three.ws/"}diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.jsindex 85e52e22c..e542817ca 100644--- a/public/dashboard/dashboard.js+++ b/public/dashboard/dashboard.js@@ -3265,7 +3265,7 @@ async function renderBilling(root) {<div class="row" style="justify-content:space-between;padding:10px 0"><span class="muted">MCP calls today</span><strong>${esc(String(usage.mcp_calls_24h ?? 0))}</strong></div>- ${plan === 'free' ? `<div style="margin-top:16px;padding-top:16px;border-top:1px solid var(--border)"><a class="btn" href="mailto:[email protected]?subject=Upgrade" style="display:block;text-align:center">Upgrade plan →</a></div>` : ''}+ ${plan === 'free' ? `<div style="margin-top:16px;padding-top:16px;border-top:1px solid var(--border)"><a class="btn" href="mailto:[email protected]?subject=Upgrade" style="display:block;text-align:center">Upgrade plan →</a></div>` : ''}</div></div>`;diff --git a/public/docs/avatar-creation.md b/public/docs/avatar-creation.mdindex 9ed671f73..15608cc27 100644--- a/public/docs/avatar-creation.md+++ b/public/docs/avatar-creation.md@@ -192,7 +192,7 @@ Open the editor for your avatar and click the **Regenerate** button. The regenerEach mode accepts optional parameters as a JSON object. The job runs asynchronously and the panel polls for completion every 3 seconds.-**Note:** Avatar regeneration is in limited availability. If your deployment shows a waitlist banner in this panel, email [email protected] to join the early access list.+**Note:** Avatar regeneration is in limited availability. If your deployment shows a waitlist banner in this panel, email [email protected] to join the early access list.---@@ -313,4 +313,4 @@ Apply Draco compression in Blender (File → Export glTF → Compression) or witYour browser or device doesn't support `getUserMedia`. This is common on HTTP (non-HTTPS) connections and some desktop browsers. Use the Upload option instead.**The regeneration panel shows a waitlist message**-The ML regeneration backend is not enabled on this deployment. Join the early access list via [email protected].+The ML regeneration backend is not enabled on this deployment. Join the early access list via [email protected].diff --git a/public/docs/security.md b/public/docs/security.mdindex c9621ce45..866a8235f 100644--- a/public/docs/security.md+++ b/public/docs/security.md@@ -334,7 +334,7 @@ Self-hosters should either pin the CDN URL with an SRI hash, or mirror the bundlFound a vulnerability? Report it privately:-- **Email:** [email protected]+- **Email:** [email protected]- **Security policy:** [https://three.ws/.well-known/security.txt](https://three.ws/.well-known/security.txt)We aim to acknowledge reports within 48 hours and ship patches for critical issues within 7 days. Please do not publicly disclose a vulnerability before a fix is available. We ask that you give us a reasonable window to address the issue before disclosure.diff --git a/publish/src/editor/regenerate-panel.js b/publish/src/editor/regenerate-panel.jsindex 6bd0901ba..c725f7243 100644--- a/publish/src/editor/regenerate-panel.js+++ b/publish/src/editor/regenerate-panel.js@@ -167,7 +167,7 @@ class RegeneratePanel {banner.style.color = '#856404';banner.innerHTML = `<strong>Avatar regeneration is not yet live.</strong>- Join the waitlist: <a href="mailto:[email protected]" style="color: #0066ff;">[email protected]</a><br/>+ Join the waitlist: <a href="mailto:[email protected]" style="color: #0066ff;">[email protected]</a><br/><small style="display: block; margin-top: 6px;">ML backend integration is in progress. We'll notify you when it's ready.</small>diff --git a/src/editor/regenerate-panel.js b/src/editor/regenerate-panel.jsindex 6bd0901ba..c725f7243 100644--- a/src/editor/regenerate-panel.js+++ b/src/editor/regenerate-panel.js@@ -167,7 +167,7 @@ class RegeneratePanel {banner.style.color = '#856404';banner.innerHTML = `<strong>Avatar regeneration is not yet live.</strong>- Join the waitlist: <a href="mailto:[email protected]" style="color: #0066ff;">[email protected]</a><br/>+ Join the waitlist: <a href="mailto:[email protected]" style="color: #0066ff;">[email protected]</a><br/><small style="display: block; margin-top: 6px;">ML backend integration is in progress. We'll notify you when it's ready.</small>