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
docs(forge): correct the image input limit to six views and lead with Solana
nirholas6b1809d9d625
diff --git a/README.md b/README.mdindex 1f9781e10..b5a216788 100644--- a/README.md+++ b/README.md@@ -8517,7 +8517,7 @@ three.ws is a full-stack system for creating, deploying, and embedding 3D AI ageAt its core, it does five things:-1. **Generate** — turns a text prompt, 1–4 photos, or a sketch into a textured, downloadable GLB via [Forge](https://three.ws/forge). Free draft tier, no account required; auto-rigging, restyling, and retexturing in the same flow.+1. **Generate**: turns a text prompt, up to 6 photos, or a sketch into a textured, downloadable GLB via [Forge](https://three.ws/forge). Free draft tier, no account required; auto-rigging, restyling, and retexturing in the same flow.2. **Render** — loads and validates glTF 2.0 / GLB models in WebGL 2.0 with zero server-side processing. Drag a file onto the browser and it renders instantly with full Draco, KTX2, and Meshopt decompression.@@ -8538,7 +8538,7 @@ three.ws is production-ready and serves [three.ws](https://three.ws) live on Goo**Text → 3D Generation (Forge)**- Prompt-to-3D at [three.ws/forge](https://three.ws/forge) — describe an object in a sentence and download a textured GLB-- Image→3D (one to four photos) and sketch→3D in the same composer+- Image→3D (one to six photos) and sketch→3D in the same composer- Multiple generation engines with live health checks: self-hosted lanes plus bring-your-own-key Meshy and Tripo (keys stay in the browser)- Prompt-to-avatar at [three.ws/create/prompt](https://three.ws/create/prompt) — a description becomes a rigged, animatable 3D avatar- Generated models carry straight into Scene Studio, embeds, worlds, and on-chain deployment@@ -8656,12 +8656,12 @@ More captures appear inline in the sections below: [Widget Studio](#widget-syste## Forge — Text & Image to 3D-Type a sentence, get a 3D model. [**Forge**](https://three.ws/forge) turns a text prompt, one to four photos, or a rough sketch into a textured, downloadable GLB — in the browser, with a free draft tier and no account required.+Type a sentence, get a 3D model. [**Forge**](https://three.ws/forge) turns a text prompt, one to six photos, or a rough sketch into a textured, downloadable GLB, in the browser, with a free draft tier and no account required.| Input | How it works | Typical time || --- | --- | --- || **Text** | Describe the object — *"a brass steampunk owl, full body"* | ~30–90 s |-| **Image** | Upload 1–4 reference views (front/back/left/right); multi-view removes back-of-object hallucination | ~30–90 s |+| **Image** | Upload 1 to 6 reference views (front/back/left/right/top/three-quarter); multi-view removes back-of-object hallucination | ~30 to 90 s || **Sketch** | Draw it and name it — TripoSG-scribble reconstructs the geometry | ~30–90 s |Three quality tiers — `draft` (~12k polygons), `standard` (~30k, default), `high` (~200k + PBR textures) — and two generation paths: the platform-keyed image pipeline (FLUX → TRELLIS) that works with no key at all, and bring-your-own-key native geometry via **Meshy** or **Tripo** for the cleanest quad topology (your key stays in your browser).@@ -8684,7 +8684,7 @@ curl 'https://three.ws/api/forge?job=<job_id>'# → { "status": "done", "glb_url": "https://…/model.glb", … }```-Image→3D is the same endpoint with `image_urls: ["https://…/front.png", …]` (1–4 views) instead of a prompt. `GET /api/forge?catalog` returns the live tier/backend/cost matrix.+Image→3D is the same endpoint with `image_urls: ["https://…/front.png", …]` (1 to 6 views) instead of a prompt. `GET /api/forge?catalog` returns the live tier/backend/cost matrix.### From Claude, Cursor, or any MCP client@@ -8692,12 +8692,12 @@ The **3D Studio MCP server** at `https://three.ws/api/mcp-3d` exposes the full p### Pay-per-call for autonomous agents (x402)-`POST /api/x402/forge` is the monetized twin: agents pay per generation in USDC on Base or Solana — no API key, no account. Draft $0.05, standard $0.15, high $0.50; polling is free; retried payments are idempotent and never double-charge. See [docs/api/forge-x402.md](docs/api/forge-x402.md).+`POST /api/x402/forge` is the monetized twin: agents pay per generation in USDC on Solana mainnet, with no API key and no account. Draft $0.05, standard $0.15, high $0.50; polling is free; retried payments are idempotent and never double-charge. See [docs/api/forge-x402.md](docs/api/forge-x402.md).### Learn more- [Tutorial: Turn a Text Prompt into a 3D Model](docs/tutorials/text-to-3d.md) — first model in about a minute-- [Tutorial: Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md) — reconstruct a real object from 1–4 photos+- [Tutorial: Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md): reconstruct a real object from up to 6 photos- [3D Studio MCP server](docs/mcp-3d-studio.md) — generate from inside Claude or Cursor- [Paid generation API (x402)](docs/api/forge-x402.md) — autonomous agent-to-agent generation@@ -9024,7 +9024,7 @@ The loader ([public/artifact.js](public/artifact.js)) mounts a rotatable 3D view| Tutorial | What you'll build | Time | Live || -------------------------------------------------------------- | -------------------------------------------------------------------- | ------- | ---- || [Turn a Text Prompt into a 3D Model](docs/tutorials/text-to-3d.md) | A real, textured, downloadable 3D model from a one-line description | ~5 min | [open](https://three.ws/tutorials/text-to-3d) |-| [Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md) | A GLB reconstructed from 1-4 photos of a real object | ~10 min | [open](https://three.ws/tutorials/image-to-3d) |+| [Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md) | A GLB reconstructed from up to 6 photos of a real object | ~10 min | [open](https://three.ws/tutorials/image-to-3d) || [Build Your First Agent](docs/tutorials/first-agent.md) | A talking 3D character on a shareable page, from zero | ~20 min | [open](https://three.ws/tutorials/first-agent) || [Embed on Your Website](docs/tutorials/embed-on-website.md) | Add an agent to any page: plain HTML, React, Webflow, WordPress | ~15 min | [open](https://three.ws/tutorials/embed-on-website) || [Write a Custom Skill](docs/tutorials/custom-skill.md) | A new tool the agent can call (e.g., fetch live weather data) | ~30 min | [open](https://three.ws/tutorials/custom-skill) |diff --git a/api/_lib/forge-listing.js b/api/_lib/forge-listing.jsindex 801a4b444..18b96b52f 100644--- a/api/_lib/forge-listing.js+++ b/api/_lib/forge-listing.js@@ -44,7 +44,7 @@ const HIGH_USD = priceUsdcForTier('high'); // "0.50"// order they need it. First sentence is the card headline; the rest is detail.export const FORGE_ROUTE_DESCRIPTION ='three.ws Forge — pay-per-call text→3D and image→3D generation for autonomous ' +- 'agents. Turn a text prompt (or up to four reference photos of one object) into ' ++ `agents. Turn a text prompt (or up to ${FORGE_MAX_VIEWS} reference photos of one object) into ` +'a production-ready GLB mesh for game assets, NFT collections, 3D scenes, and ' +'product visualization — the only real 3D generation on any agent marketplace. ' +`Three quality tiers in USDC: draft $${DRAFT_USD} (fast low-poly blockout), ` +@@ -87,7 +87,7 @@ export const FORGE_INPUT_SCHEMA = Object.freeze({minItems: 1,maxItems: FORGE_MAX_VIEWS,description:- 'Up to four public https reference views of one object for image→3D. ' ++ `Up to ${FORGE_MAX_VIEWS} public https reference views of one object for image→3D. ` +'Omit when supplying a prompt.',},tier: {diff --git a/docs/3d-api.md b/docs/3d-api.mdindex db1b7120b..8359f2cef 100644--- a/docs/3d-api.md+++ b/docs/3d-api.md@@ -284,7 +284,7 @@ Tests: [tests/api/forge-director.test.js](../tests/api/forge-director.test.js),## Forge Pro — paid quality tiers (`/api/x402/forge`)**`POST /api/x402/forge`** — the pay-per-call twin of the free draft lane. Same-inputs (a text prompt, or up to four reference photos of one object), but you pick+inputs (a text prompt, or up to six reference photos of one object), but you picka **quality tier**, and you pay per generation in USDC over[x402](https://x402.org) — no API key, no account, no signup. This is the onlyreal text→3D / image→3D generation on any agent marketplace, so it's built for@@ -335,7 +335,7 @@ tier at deploy time without touching settlement.-H 'content-type: application/json' \-d '{"prompt":"a brass steampunk owl, full body","tier":"standard"}'- # image → 3D — up to four public https views of ONE object (omit prompt)+ # image → 3D: up to six public https views of ONE object (omit prompt)curl -s -X POST https://three.ws/api/x402/forge \-H 'content-type: application/json' \-d '{"image_urls":["https://example.com/owl-front.png","https://example.com/owl-side.png"],"tier":"high"}'diff --git a/docs/api/forge-x402.md b/docs/api/forge-x402.mdindex cf51aea70..1b9264f51 100644--- a/docs/api/forge-x402.md+++ b/docs/api/forge-x402.md@@ -1,112 +1,382 @@-# Forge — paid 3D generation API (x402)+# Forge: paid 3D generation API (x402)-Pay-per-call text→3D and image→3D for AI agents. Settle in USDC autonomously —-no API key, no account, no signup. This is the monetized twin of the free,-browser-facing `/api/forge`.+Pay-per-call text→3D and image→3D for AI agents. One USDC payment buys one+generation, settled autonomously over [x402](https://x402.org): no API key, no+account, no signup. This is the monetized twin of the free, browser-facing+`/api/forge`.-- **Endpoint:** `POST /api/x402/forge`-- **Payment:** x402 over USDC on Base or Solana mainnet-- **Polling:** free, on the existing `GET /api/forge?job=<id>`-- **Discovery:** listed in `/.well-known/x402` and `/openapi.json`; the price is- in the 402 challenge and at `GET /api/x402/forge`.+| | |+|---|---|+| **Endpoint** | `POST https://three.ws/api/x402/forge` |+| **Price** | $0.05 / $0.15 / $0.50 USDC per generation, by quality tier |+| **Payment** | x402 `exact` scheme, USDC on **Solana mainnet** |+| **Polling** | free, on `GET /api/forge?job=<id>` |+| **Discovery** | `GET /api/x402/forge` (free), `/.well-known/x402`, `/openapi.json` |+| **Source** | [api/x402/forge.js](../../api/x402/forge.js), listing metadata in [api/_lib/forge-listing.js](../../api/_lib/forge-listing.js) |++New here? Prove the concept on the free, keyless draft lane at+`POST /api/3d/generate` ([3D API](../3d-api.md)) first, then pay for a tier when+you need standard/high quality or image→3D.## Pricing-Per quality tier, in USDC. Source of truth: `api/_lib/forge-tiers.js`-(`priceUsdcAtomics`). The 402 challenge quotes the exact price for the requested-tier.+Flat per-call retail price by tier. The single source of truth is+[api/_lib/forge-tiers.js](../../api/_lib/forge-tiers.js) (`priceUsdcAtomics`);+the 402 challenge quotes the exact price for the tier you asked for, so an agent+never has to hardcode a number from this page.-| Tier | Price | Polygon budget |-|---|---|---|-| `draft` | $0.05 | ~12k |-| `standard` (default) | $0.15 | ~30k |-| `high` | $0.50 | ~200k + PBR |+| Tier | Price (USDC) | Geometry | Textures | Best for |+|---|---|---|---|---|+| `draft` | **$0.05** | ~12k tris | none | Blockout, iteration, previews |+| `standard` (default) | **$0.15** | ~30k tris | none | Most shippable assets |+| `high` | **$0.50** | ~200k tris | PBR + HD | Hero assets, product and NFT renders |++The price is per generation and does not vary with which engine lane serves it+(see [Engine lanes](#engine-lanes)).++### Discover the price before paying (free)++<!-- runnable: 200 the free pricing catalog, no payment involved -->+```bash+curl -s https://three.ws/api/x402/forge+```-`GET /api/x402/forge` returns the live pricing table (free, no payment).+```jsonc+{+ "route": "/api/x402/forge",+ "description": "three.ws Forge: pay-per-call text→3D and image→3D ...",+ "method": "POST",+ "input_schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { /* … */ } },+ "poll": "GET /api/forge?job=<id>",+ "pricing_usdc": [+ { "tier": "draft", "price_usdc": "0.05" },+ { "tier": "standard", "price_usdc": "0.15" },+ { "tier": "high", "price_usdc": "0.50" }+ ]+}+```++The same schemas are mirrored into `/.well-known/x402` and into the 402+challenge's `bazaar` block, so a facilitator listing (CDP Bazaar, x402scan,+agentic.market) and the live endpoint can never disagree.## Request-`POST /api/x402/forge` with a JSON body:+`POST /api/x402/forge` with a JSON body. Provide **exactly one** of `prompt`+(text→3D) or `image_urls` (image→3D).++| Field | Type | Default | Notes |+|---|---|---|---|+| `prompt` | string | none | Text→3D. 3 to 1000 characters, describing one subject. |+| `image_urls` | string[] | none | Image→3D. 1 to 6 public `https` reference views of **one** object. |+| `image_url` | string | none | Convenience alias for a single reference view. |+| `tier` | `draft` / `standard` / `high` | `standard` | Quality and price. An unknown value falls back to `standard`. |+| `aspect_ratio` | `1:1` / `4:3` / `3:4` / `16:9` / `9:16` | `1:1` | Aspect ratio of the synthesized reference view. Text→3D only. |```jsonc{- "prompt": "a brass steampunk owl, full body", // text→3D (3–1000 chars)- // OR, for image→3D, omit prompt and supply public https reference views:- // "image_urls": ["https://.../front.png", "https://.../side.png"], // 1–4- "tier": "standard", // draft | standard | high- "aspect_ratio": "1:1" // 1:1 | 4:3 | 3:4 | 16:9 | 9:16 (text→3D only)+ "prompt": "a brass steampunk owl, full body",+ "tier": "standard",+ "aspect_ratio": "1:1"}```-Caller-supplied `image_urls` are SSRF-guarded before the reconstructor fetches-them.+```jsonc+{+ "image_urls": [+ "https://example.com/owl-front.png",+ "https://example.com/owl-side.png"+ ],+ "tier": "high"+}+```-## Flow+Input rules worth knowing before you pay:-1. **Unpaid request** → `402 Payment Required` with an `accepts[]` array quoting- the tier price on each supported network.-2. **Pay** with any x402 client (e.g. `@x402/fetch`, CDP, PayAI) — the payment- proof rides in the `X-PAYMENT` header.-3. **Paid request** → the server verifies payment, submits the generation job,- then settles. Generation is submitted **after verify but before settle**, so a- failed submit never charges you. Response:+- **Views past the sixth are dropped**, not rejected. Send your best six.+- **Non-`https` entries are dropped.** If you supplied `image_urls` and none+ survive that filter, the call fails with `400 invalid_image_urls` rather than+ silently degrading to a text prompt.+- **Caller-supplied urls are SSRF-guarded** before any reconstructor fetches+ them, on every lane. Private, link-local, and loopback targets are refused.+- **A body with neither field is a probe.** Unpaid, it still returns the 402+ challenge so an agent can discover the price with no input. Paid, it is+ rejected with `400 missing_input` before any settlement runs.- ```json- {- "job_id": "abcd1234efgh5678ij",- "status": "queued",- "poll_url": "/api/forge?job=abcd1234efgh5678ij",- "mode": "text_to_3d",- "tier": "standard",- "backend": "trellis",- "eta_seconds": 60,- "price_usdc": "0.15"- }- ```+## The 402 challenge-4. **Poll for free** until the GLB is ready:+An unpaid request is answered with `402 Payment Required` and an `accepts[]`+array quoting the price for the tier you requested.- <!-- runnable: no the job id is illustrative; use the one the submit call returned -->- ```bash- curl 'https://three.ws/api/forge?job=abcd1234efgh5678ij'- # → { "status": "done", "glb_url": "https://.../model.glb", ... }- ```+<!-- runnable: 402 the challenge is the lesson: an unpaid call must quote a price -->+```bash+curl -s -X POST https://three.ws/api/x402/forge \+ -H 'content-type: application/json' \+ -d '{"prompt":"a brass steampunk owl, full body","tier":"standard"}'+```- Fetch the `glb_url` promptly — provider delivery URLs are short-lived.+```jsonc+{+ "x402Version": 2,+ "error": "X-PAYMENT header is required",+ "resource": {+ "url": "https://three.ws/api/x402/forge",+ "serviceName": "three.ws Forge: text/image to 3D",+ "tags": ["3d", "ai", "text-to-3d", "image-to-3d", "utility"]+ },+ "accepts": [+ {+ "scheme": "exact",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", // Solana mainnet+ "amount": "150000", // 0.15 USDC, 6 decimals+ "payTo": "<the platform's live receiving address>",+ "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC mint+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/x402/forge",+ "extra": { "name": "USDC", "decimals": 6, "feePayer": "<sponsor>" }+ }+ ]+}+```++**Solana mainnet USDC only.** Every quote on the live route is a Solana 402, and+the fee payer is sponsored, so a buyer needs USDC but not SOL. A self-hosted or+preview deploy that has not configured `X402_PAY_TO_SOLANA` falls back to+quoting Base USDC (EIP-3009 plus a Permit2 variant) so the route never+dead-ends with an empty challenge; production sets it, so that branch never runs+on three.ws.++Pay the challenge with any x402 client (`@x402/fetch`, CDP, PayAI) and retry the+identical request with the proof in the `X-PAYMENT` header.++## Response++A paid call returns `200` in one of two shapes. `status` is the only guaranteed+field: branch on it.++**Queued** (the usual case) hands back a job token you poll for free:++```json+{+ "job_id": "f1.eyJwIjoibnZpZGlhIn0.sig",+ "status": "queued",+ "poll_url": "/api/forge?job=f1.eyJwIjoibnZpZGlhIn0.sig",+ "mode": "text_to_3d",+ "tier": "standard",+ "backend": "nvidia",+ "eta_seconds": 22,+ "price_usdc": "0.15"+}+```++**Done inline** happens when the lane finishes inside the submit window (common+on `draft`). There is nothing to poll, and `job_id` / `poll_url` are `null`:++```json+{+ "job_id": null,+ "status": "done",+ "poll_url": null,+ "glb_url": "https://three.ws/cdn/forge/nvidia/9f2c….glb",+ "mode": "text_to_3d",+ "tier": "draft",+ "backend": "nvidia",+ "eta_seconds": 13,+ "price_usdc": "0.05"+}+```++| Field | Type | Meaning |+|---|---|---|+| `status` | string | `queued` (poll it) or `done` (`glb_url` is ready). |+| `job_id` | string \| null | Poll token. `null` on inline completion. |+| `poll_url` | string \| null | Free status path. `null` on inline completion. |+| `glb_url` | string | The finished GLB. Present only when `status` is `done`. |+| `mode` | string | `text_to_3d` or `image_to_3d`. |+| `tier` | string | The resolved tier (after the default is applied). |+| `backend` | string | Which engine lane served the job. |+| `eta_seconds` | integer | Estimated time to completion for that lane and tier. |+| `price_usdc` | string | What you were charged, e.g. `"0.15"`. |-## Idempotency+The settlement receipt rides back in the `x-payment-response` header.-A retried payment (same payment id + same body) returns the **same** job token-instead of submitting a second generation, so a network retry never-double-charges.+Any client that only handles the queued shape will build a poll url out of+`null` and hang. Handle both, as the [example](#example-x402fetch) does.++## Engine lanes++One price, several engines. The endpoint is free-first internally: it spends+platform vendor credit only when no zero-cost lane can serve the job, and it+degrades rather than failing a paid call. `backend` in the response names the+lane that ran.++**Text→3D**, in order:++1. **NVIDIA NIM native text→mesh** (`nvidia`). Zero vendor cost, no intermediate+ image. Completes inline often enough that `draft` frequently skips polling.+2. **HuggingFace Spaces reconstruct** (`huggingface`). Free. Synthesizes a+ reference view, reconstructs it, and the result is copied into three.ws+ storage so the url outlives the Space's ephemeral files. Preference is+ controlled by `FORGE_PREFER_FREE`.+3. **FLUX→TRELLIS on Replicate** (`trellis`). The paid platform backstop.++**Image→3D** skips step 1 (NVIDIA's hosted preview is text-only) and runs the+reconstruct lanes on your supplied views.++Only the platform-keyed pipeline is sold here. The BYOK geometry backends+(Meshy, Tripo) bill through the caller's own provider key on the free+`/api/forge` and are not monetized via x402.++## Poll for free++Polling costs nothing and needs no payment header.++<!-- runnable: no the job id is illustrative; use the one the paid call returned -->+```bash+curl -s 'https://three.ws/api/forge?job=f1.eyJwIjoibnZpZGlhIn0.sig'+```++```json+{+ "job_id": "f1.eyJwIjoibnZpZGlhIn0.sig",+ "status": "done",+ "glb_url": "https://three.ws/cdn/forge/…/model.glb",+ "durable": true,+ "backend": "nvidia",+ "tier": "standard",+ "path": "x402"+}+```++| `status` | What to do |+|---|---|+| `queued` | Keep polling. The job is accepted and waiting on the engine. |+| `running` | Keep polling. A transient poll error also reports `running` rather than failing the job. |+| `done` | `glb_url` is ready. |+| `failed` | Stop. `error` carries a sanitized, buyer-safe reason. |++`durable: true` means the GLB was copied into three.ws storage and the url is+stable. `durable: false` means you are looking at the provider's own delivery+url, which expires: download it promptly.++A 2 second poll interval is polite and well inside every lane's ETA. Poll+`/api/forge?job=`, never `/api/x402/forge?job=`; the paid route answers that+mistake with `400 wrong_endpoint` and a pointer rather than a 404.++## Payment safety: verify, submit, settle++The handler runs in that order deliberately. The generation job is submitted+**after** your payment verifies but **before** it settles, so a submit that+fails (engine down, out of capacity, bad input) never takes your money. Every+error the endpoint returns from that window says so in plain language, and the+raw upstream text (which can carry the platform's own vendor billing state) is+logged, never relayed.++## Idempotency and replay protection++A retried payment returns the **same** job token instead of submitting a second+generation, so a network retry can never double-charge.++- The dedup key is the client's payment identifier when the client opts into the+ `payment-identifier` extension advertised in the challenge `extensions`. When+ it does not, the endpoint falls back to a hash of the payment proof itself,+ which only the original payer can reproduce. **Replay protection is therefore+ unconditional**, not opt-in.+- A replayed request that matches gets the original response body with+ `x-x402-idempotent: replay`.+- A second request carrying the same payment while the first is still running+ gets `409 payment_in_flight`, `x-x402-idempotent: in-flight`, and+ `retry-after: 1`. Retry to receive the cached response instead of paying again.+- Reusing one payment identifier for a **different** body gets+ `409 payment_identifier_conflict` with `attemptedPayloadHash` and+ `existingPayloadHash`. Retry the original payload or generate a fresh id.++## Errors++| Status | `error` | Meaning |+|---|---|---|+| `400` | `invalid_json` | Body was not valid JSON. |+| `400` | `invalid_prompt` | Prompt outside 3 to 1000 characters. |+| `400` | `invalid_image_urls` | You sent `image_urls` but none were public `https` urls. |+| `400` | `missing_input` | Paid call with neither `prompt` nor `image_urls`. |+| `400` | `body_read_failed` | Body unreadable or over the 1 MB cap. |+| `400` | `wrong_endpoint` | `GET /api/x402/forge?job=…`. Poll on `/api/forge?job=…`. |+| `402` | (challenge) | No `X-PAYMENT` header, or the proof failed verification. Re-read `accepts[]` and pay. |+| `405` | `method_not_allowed` | Use `POST` to generate, `GET` for pricing. |+| `409` | `payment_in_flight` | Same payment already being processed. Retry shortly. |+| `409` | `payment_identifier_conflict` | Payment identifier reused for a different body or a different proof. |+| `429` | `rate_limited` | Either the unpaid path's per-IP limit, or the engine is briefly busy. In the busy case **your payment was not taken**; honour `retry_after`. |+| `502` | `verify_failed` / `settle_failed` | Facilitator problem. On `verify_failed` nothing was charged. |+| `502` | `generation_failed` | Engine fault after verify, before settle. Not charged. |+| `503` | `generation_unavailable` | Every lane is down or out of capacity. Not charged; `retry_after: 30`. |+| `503` | `unconfigured` | Generation is not configured on this deployment. |++The unpaid path is IP rate limited so the challenge and validation cannot be+hammered; those responses carry `X-RateLimit-*` and `retry-after` headers.+Generation itself is paywalled, not rate limited.++Platform callers holding the `x402:bypass` scope (subscription or OAuth) skip+payment entirely and get the same response body plus an `x-payment-bypass`+header. Anonymous agents always pay.++## Provenance: paid generations join the public gallery++Every settled generation becomes a real row in the community gallery, stamped+with the paying wallet, the settle signature, and the price, and rendered with a+Solscan-linked "x402" provenance badge. Inline-done lanes publish immediately;+async lanes are completed server-side by `api/cron/forge-finalize`, so the+artifact lands even if you never poll. Recording happens after your response is+sent and never affects your result. See+[x402 endpoints](../x402-endpoints.md) and+[the autonomous economy](../autonomous-x402.md).++Treat prompts as public. If you need a private lane, use the account-scoped+surfaces instead of this one.## Example (`@x402/fetch`)+Handles both response shapes, the free poll, and terminal failure.+```jsimport { wrapFetchWithPayment } from '@x402/fetch';+const BASE = 'https://three.ws';const fetchWithPay = wrapFetchWithPayment(fetch, wallet);-const res = await fetchWithPay('https://three.ws/api/x402/forge', {++const res = await fetchWithPay(`${BASE}/api/x402/forge`, {method: 'POST',headers: { 'content-type': 'application/json' },- body: JSON.stringify({ prompt: 'a brass steampunk owl', tier: 'standard' }),+ body: JSON.stringify({ prompt: 'a brass steampunk owl, full body', tier: 'standard' }),});-const { poll_url } = await res.json();--let glb;-for (;;) {- const s = await (await fetch(`https://three.ws${poll_url}`)).json();- if (s.status === 'done') { glb = s.glb_url; break; }- if (s.status === 'failed') throw new Error(s.error);- await new Promise((r) => setTimeout(r, 2000));+if (!res.ok) throw new Error(`forge ${res.status}: ${(await res.json()).error}`);++const submitted = await res.json();++// The lane may have finished inside the submit window: there is nothing to poll.+let glbUrl = submitted.glb_url ?? null;++if (!glbUrl) {+ const deadline = Date.now() + 10 * 60 * 1000;+ while (Date.now() < deadline) {+ await new Promise((r) => setTimeout(r, 2000));+ const job = await (await fetch(`${BASE}${submitted.poll_url}`)).json();+ if (job.status === 'done') { glbUrl = job.glb_url; break; }+ if (job.status === 'failed') throw new Error(job.error);+ }+ if (!glbUrl) throw new Error('generation timed out');}++const glb = Buffer.from(await (await fetch(glbUrl)).arrayBuffer());```-## Notes+## Related-- The MCP-3D server (`/api/mcp-3d`) exposes the same generation as `text_to_3d` /- `image_to_3d` tools for in-conversation use; this REST endpoint is the- pay-per-call surface for autonomous agents.-- Only the platform image pipeline (FLUX→TRELLIS) is sold here. The BYOK geometry- backends (Meshy/Tripo) bill through the caller's own provider key on the free- `/api/forge` and are not monetized via x402.+- [3D API](../3d-api.md): the free draft lane, inspection, validation, and the+ full Forge Pro walkthrough.+- [Forge pipeline](../forge-pipeline.md): how the lanes, tiers, and failovers fit+ together internally.+- [3D Studio MCP server](../mcp-3d-studio.md): the same generation as+ `text_to_3d` / `image_to_3d` tools for in-conversation use, priced from the+ same tier table. This REST endpoint is the pay-per-call surface for autonomous+ agents.+- [x402 endpoints](../x402-endpoints.md): every paid endpoint on the platform.diff --git a/docs/forge.md b/docs/forge.mdindex a1f55bbf0..ed75c2468 100644--- a/docs/forge.md+++ b/docs/forge.md@@ -1,6 +1,6 @@# Forge: text and image to 3D, on a free-first engine grid-Forge is three.ws's text-and-image-to-3D generator. Type a prompt, drop in one to four photos of an object, or sketch a shape and name it, and Forge returns a downloadable, textured GLB you can orbit, view in AR, and take anywhere. It runs on a grid of real generation engines with live health status, and it is free-first by design: text prompts default to a zero-cost NVIDIA lane, photos default to a zero-cost reconstruction lane, and the paid engines stay explicitly selectable for when you want a specific vendor.+Forge is three.ws's text-and-image-to-3D generator. Type a prompt, drop in one to six photos of an object, or sketch a shape and name it, and Forge returns a downloadable, textured GLB you can orbit, view in AR, and take anywhere. It runs on a grid of real generation engines with live health status, and it is free-first by design: text prompts default to a zero-cost NVIDIA lane, photos default to a zero-cost reconstruction lane, and the paid engines stay explicitly selectable for when you want a specific vendor.Page: [/forge](https://three.ws/forge) and the feature landing [/features/forge](https://three.ws/features/forge) · API: `/api/forge`@@ -187,7 +187,7 @@ console.log(job.glb_url); // downloadable, textured GLB- **Every result** reports the path, tier, and backend that produced it, so you always know which engine ran.- **The High tier is $THREE hold-or-pay gated** in the handler regardless of which free engine serves it: we charge for quality, not to recover vendor cost. A verified $THREE tier pass also lifts the free-lane quota.- **BYOK engines** (Meshy, Tripo, Rodin, Stability, Replicate) require your own key; they are never billed to a platform account.-- **Photo input** accepts up to four views of one object; text-only engines are filtered out of the photo modes automatically.+- **Photo input** accepts up to six views of one object (front, back, left, right, top, three-quarter); text-only engines are filtered out of the photo modes automatically.- Rate limits are per client IP on the shared 3D generation buckets.## Measuring realismdiff --git a/docs/tutorials/generate-3d-api.md b/docs/tutorials/generate-3d-api.mdindex a0bbd2932..2cd76fb34 100644--- a/docs/tutorials/generate-3d-api.md+++ b/docs/tutorials/generate-3d-api.md@@ -145,7 +145,7 @@ async function uploadImage(buffer, contentType = 'image/jpeg') {// Then:const url = await uploadImage(await readFile('front.jpg'));-// 1–4 views of the same object; more views = better reconstruction+// 1 to 6 views of the same object; more views = better reconstructionconst submit = await fetch(`${BASE}/api/forge`, {method: 'POST',headers: { 'content-type': 'application/json' },diff --git a/docs/tutorials/image-to-3d.md b/docs/tutorials/image-to-3d.mdindex 5ec266d2c..84ada01cb 100644--- a/docs/tutorials/image-to-3d.md+++ b/docs/tutorials/image-to-3d.md@@ -2,7 +2,7 @@Have a real object you want in 3D? Photograph it from a few angles, drop the photos into the Forge, and get back a textured 3D model. This works for products, toys, sculptures, furniture, sneakers — anything you can put on a table and walk around.-**What you'll make:** a downloadable GLB model reconstructed from 1–4 photos of a real object.+**What you'll make:** a downloadable GLB model reconstructed from 1 to 6 photos of a real object.**Prerequisites:** none. A phone camera is plenty.@@ -15,10 +15,10 @@ This step decides 90% of your result quality. Five rules:1. **One object, plain background.** Put the object on a table against a wall, or hold it against the sky. Busy backgrounds get reconstructed as part of the object.2. **Even lighting, no harsh shadows.** Indirect daylight is ideal. Avoid a phone flash — it creates hotspots that become weird texture patches.3. **Fill the frame.** The object should take up most of the photo, in focus.-4. **Same object, different angles.** The ideal set of four: **front, back, left, right**. Keep the object the same way up in every shot.+4. **Same object, different angles.** The core set is **front, back, left, right**; two more slots take a **top** shot and a **three-quarter** shot. Keep the object the same way up in every shot.5. **Don't move the object between shots** — walk around it instead, so the lighting stays consistent.-One photo works. Four photos work noticeably better — every angle you provide is geometry the model doesn't have to guess.+One photo works. Four to six work noticeably better: every angle you provide is geometry the model doesn't have to guess.**Formats:** PNG, JPG, or WebP, up to 8 MB each.@@ -28,7 +28,7 @@ One photo works. Four photos work noticeably better — every angle you provideGo to [three.ws/forge](/forge) and switch to the **From photos** tab.-You'll see a grid of four upload slots. Drag your photos in, or click a slot to browse. After uploading you can **drag the thumbnails to reorder** them — put your best, clearest shot first.+You'll see a grid of six upload slots (front, back, left, right, top, and three-quarter). Drag your photos in, or click a slot to browse. After uploading you can **drag the thumbnails to reorder** them: put your best, clearest shot first.**No object on hand? Draw it.** The Forge also takes drawings, two ways. On this page, the **From a sketch** tab (it appears when the sketch engine is live) takes one drawing plus a short required description of what it depicts: dark strokes on a light background work best, and the result is untextured geometry you can then **Stylize** or **Retexture**. In the [Forge Studio](/forge-studio), click **Or draw it instead** below the photo grid to open an in-browser drawing canvas: draw with your mouse, finger, or stylus, then **Use sketch** to drop the PNG straight into the next open slot, where it rides the same reconstruction pipeline as an uploaded photo. Nothing is uploaded while you draw, only when you click **Use sketch**; cancelling discards it with zero network activity.@@ -81,7 +81,7 @@ Everything you generate is kept in **Your creations** at the bottom of the page,|---------|-------------|-----|| Background melted into the model | Busy backdrop in the photos | Reshoot against a plain wall, or note "no background" in the guidance field || Texture has bright patches | Flash or hard directional light | Reshoot in even, indirect light |-| Back of the model is wrong | Only front photos provided | Add back and side views — up to 4 |+| Back of the model is wrong | Only front photos provided | Add back, side, and three-quarter views, up to 6 || Object came out warped | Photos show the object in different positions/orientations | Keep the object still; you move, not it || Upload rejected | File too large or wrong type | PNG/JPG/WebP, max 8 MB each || "Generation limit reached" | Per-visitor rate limit | Wait a minute, try again |diff --git a/docs/tutorials/text-to-3d.md b/docs/tutorials/text-to-3d.mdindex 5ee38c91d..00cf567f5 100644--- a/docs/tutorials/text-to-3d.md+++ b/docs/tutorials/text-to-3d.md@@ -116,6 +116,6 @@ This is normal — prompt, generate, adjust, repeat is the workflow, not a failu## What's next- **Better prompts** → [Prompt Recipes for 3D Generation](/tutorials/prompts-for-3d) — copy-paste recipes by category, with the reasoning behind them.-- **Have photos of a real object?** → [Turn Photos into a 3D Model](/tutorials/image-to-3d) — reconstruct it from 1–4 pictures.+- **Have photos of a real object?** → [Turn Photos into a 3D Model](/tutorials/image-to-3d): reconstruct it from up to 6 pictures.- **Want to generate from code?** → [Generate 3D Models from Code](/tutorials/generate-3d-api) — the same engine, as a simple HTTP API.- **Use it as an agent body** → [Build your first agent](/tutorials/first-agent) — your generated GLB can be a talking 3D character.