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
fix(ar): route the launcher through the Open Graph interstitial so links unfurl
nirholas81794c4cd3be
diff --git a/api/_lib/ar-launch.js b/api/_lib/ar-launch.jsindex e838225c5..dbbf77a24 100644--- a/api/_lib/ar-launch.js+++ b/api/_lib/ar-launch.js@@ -5,8 +5,11 @@//// • Android → Google Scene Viewer via an ARCore intent:// URL (the GLB is the// Scene Viewer source), with a browser fallback to the WebGL viewer.-// • iOS / desktop / any live avatar → a 302 to /ar/view (pages/ar-view.html,-// src/ar-view.js), a Vite-bundled page that generates a real USDZ+// • iOS / desktop / any live avatar → /ar/view (pages/ar-view.html,+// src/ar-view.js), reached through the Open-Graph interstitial+// api/ar.js serves so a pasted link still unfurls (a bare 302+// would drop the unfurl; crawlers do not follow its JS). That+// Vite-bundled page generates a real USDZ// from the GLB on the device (three.js USDZExporter) and sets it// as <model-viewer>'s ios-src before Quick Look is offered.// <model-viewer> does NOT convert GLB to USDZ on its own: andiff --git a/docs/ar.md b/docs/ar.mdindex b5b4c218f..de7ef8426 100644--- a/docs/ar.md+++ b/docs/ar.md@@ -54,7 +54,7 @@ You do not add an attribute to enable AR; you link to (or embed) one of the AR s| AR Forge | `/ar` | Generate a model from a prompt and place it immediately || Living-agent AR | `/irl?avatar=<glbUrl>` | A rigged avatar that walks and talks in your room (WebXR) |-The avatar AR page and the `/api/ar` launch page render the model in Google's `<model-viewer>` element with `ar ar-modes="webxr scene-viewer quick-look"`, so the same page covers Quick Look, Scene Viewer, and WebXR. The **Place in your space** button appears only when the device exposes a usable AR mode (model-viewer's `canActivateAR`); on desktop the page shows a QR code handoff instead.+The avatar AR page and `/ar/view` (the page `/api/ar` redirects to) render the model in Google's `<model-viewer>` element with `ar ar-modes="webxr scene-viewer quick-look"`, so the same page covers Quick Look, Scene Viewer, and WebXR. The **Place in your space** button appears only when the device exposes a usable AR mode (model-viewer's `canActivateAR`); on desktop the page shows a QR code handoff instead. `/api/ar` itself renders no 3D: it is a server-side router that either 302s into a Scene Viewer intent (plain Android) or serves a tiny Open-Graph interstitial that hands off to `/ar/view` (see [the launcher section](#one-tap-ar-for-any-glb--get-apiar--export_ar)).### Allow XR in iframes@@ -73,7 +73,7 @@ Without `xr-spatial-tracking`, the browser blocks `navigator.xr` inside the fram## Programmatic API-On pages that render the model with `<model-viewer>` (the avatar AR page at `/avatars/<id>/ar`, the `/api/ar` launch page, Forge results), AR is driven through model-viewer's API. This is exactly what [src/ar-page.js](../src/ar-page.js) does:+On pages that render the model with `<model-viewer>` (the avatar AR page at `/avatars/<id>/ar`, the `/ar/view` launch page, Forge results), AR is driven through model-viewer's API. This is exactly what [src/ar-page.js](../src/ar-page.js) does:```jsconst viewer = document.querySelector('model-viewer');@@ -424,9 +424,9 @@ The endpoint branches on the request's **User-Agent**, server-side:| Device | What happens ||---|---|-| **iOS** (iPhone/iPad) | Launch page → Apple **Quick Look**. The USDZ is generated from the GLB on the fly by model-viewer (three.js `USDZExporter`) — a real conversion, no server USD tooling. |+| **iOS** (iPhone/iPad) | An Open-Graph interstitial that hands off to the `/ar/view` launch page → Apple **Quick Look**. That page converts the GLB to a real USDZ on the device with three.js `USDZExporter` and sets it as model-viewer's `ios-src`; `<model-viewer>` does **not** do that conversion itself, which is why the launcher redirects to a Vite-bundled page instead of writing HTML inline. No server USD tooling. || **Android** | `302` → Google **Scene Viewer** ARCore intent (the GLB is the source), with a browser fallback to the WebGL viewer. |-| **Desktop** | Launch page → interactive **WebGL** viewer (no AR hardware). |+| **Desktop** | The same interstitial into the `/ar/view` launch page, which falls back to the interactive **WebGL** viewer (no AR hardware). |**`kind=avatar`: the living-agent lane.** AR on three.ws is not a prop viewer; it is how agents cross into physical space. When the GLB is a rigged avatar (an agent's body), add `kind=avatar`: the launch page then leads with a **Bring it to life** handoff into [`/irl?avatar=<glbUrl>`](/irl), where the avatar walks, animates, and talks with the user through their camera in their real room. Static placement stays available alongside it, and Android serves the launch page instead of the blind Scene Viewer redirect so the living path is always visible.diff --git a/docs/chatgpt-ar.md b/docs/chatgpt-ar.mdindex 8fc21e8a6..eed776b5c 100644--- a/docs/chatgpt-ar.md+++ b/docs/chatgpt-ar.md@@ -120,7 +120,7 @@ Everything above is public plumbing:- **Any MCP client:** the connector at `/api/mcp-studio` works in Claude and every other MCP host, not just ChatGPT. Every generation it returns already carries `arUrl` (and `irlUrl` for rigged avatars) plus a [Spatial MCP](./spatial-mcp.md) artifact, so no extra tool call is needed to get the AR link. To build that link set for a GLB the connector did **not** generate, use the read-only `export_ar` tool on the separate [`/api/mcp-3d` server](./mcp-3d-studio.md), which returns `arLaunchUrl`, `sceneViewerUrl`, `viewerUrl`, and `irlUrl`. That server is account- or payment-gated and is not part of the free connector.- **By hand:** the `arUrl` format is stable. If you have a public GLB, you can construct `https://three.ws/api/ar?src=<encoded GLB>&title=<name>` yourself and it will route correctly on every device.-The generation lane is operator-funded (NVIDIA NIM running Microsoft TRELLIS for text-to-3D), so the end user pays nothing and needs no account; real per-IP rate limits apply and are documented per endpoint.+The generation lane is operator-funded, so the end user pays nothing and needs no account. No backend is pinned: the health-aware router in [api/gpt-forge.js](../api/gpt-forge.js) walks the free lanes first (the self-hosted TRELLIS worker, the free NVIDIA NIM text→3D lane, the Hugging Face Spaces image→3D lane) and keeps the platform-keyed Replicate lane as a failover rung, so a cold or throttled free worker degrades to the next healthy engine instead of failing the request. Either way the cost lands on the platform. Real per-IP rate limits apply and are documented per endpoint (see [Funding & limits](./mcp-studio.md#funding--limits)).---