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.

14.5 KB
Raw Blame
openapi: 3.1.0
info:
  title: three.ws 3D Studio
  version: 1.0.0
  description: |
    Free text-to-3D generation for the "three.ws 3D Studio" custom GPT.
    Turn a short text prompt into a real, textured, downloadable 3D model (GLB)
    plus a browser viewer link. No account, no API key, no payment.

    Data handling: the prompt is forwarded to the generation provider solely to
    produce the model; the finished GLB is stored on a public CDN URL so the
    user can download and share it. No personal information is collected or
    returned by these operations. Requests are rate-limited per IP for abuse
    prevention. Full policy: https://three.ws/legal/privacy

    Contract: POST /api/3d/studio either finishes inline (status "done" with
    glbUrl + viewerUrl + arUrl) or returns status "pending" with a "job"
    handle and watchUrl - a live three.ws progress page (countdown + concept
    art, auto-opens the viewer when done) to hand the user immediately. Poll
    GET /api/3d/studio?job=... every few seconds until status is
    "done" or "error". Generation typically takes 20-60 seconds at the default
    tier; tier "high" produces far more detail and can take several minutes,
    so keep polling patiently. Responses may carry previewImageUrl - the
    concept image the generator paints first and then sculpts into 3D; show
    it to the user while the model is still generating. arUrl is the
    augmented-reality launch link: opened on a phone it places the model in
    the user's real room (Quick Look on iPhone, Scene Viewer on Android);
    always offer it alongside the viewer link. GET /api/ar is the endpoint
    behind that link and is described below, so the whole free surface of
    the studio is documented here.
  contact:
    name: three.ws
    url: https://three.ws
  license:
    name: three.ws Terms of Service
    url: https://three.ws/legal/tos
servers:
  - url: https://three.ws
# No authentication: the free text-to-3D lane needs no API key and no account.
# An explicit empty root security requirement declares that plainly.
security: []
paths:
  /api/3d/studio:
    post:
      operationId: generate3DModel
      x-openai-isConsequential: false
      summary: Generate a 3D model (GLB) from a text prompt
      description: >-
        Start a free text-to-3D generation. Describe ONE subject. Optional
        tier: draft (fastest), standard (default), high (max detail, takes
        minutes). Returns "done" with glbUrl + viewerUrl + arUrl, or
        "pending" with a job handle for checkModelJob plus watchUrl - the
        live progress page to give the user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [prompt]
              additionalProperties: false
              properties:
                prompt:
                  type: string
                  minLength: 3
                  maxLength: 1000
                  description: >-
                    A concrete description of one subject to model, e.g.
                    "a small ceramic robot figurine with round eyes".
                tier:
                  type: string
                  enum: [draft, standard, high]
                  description: >-
                    Quality tier. draft = fastest, low detail; standard
                    (default) = balanced; high = maximum geometric and
                    texture detail, takes several minutes - keep polling.
            examples:
              fox:
                summary: Low-poly animal
                value:
                  prompt: a low-poly orange fox sitting down
      responses:
        "200":
          description: Generation finished inline, or queued with a poll handle.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenerationState"
              examples:
                done:
                  summary: Finished inline
                  value:
                    status: done
                    glbUrl: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/04818491-d43e-4576-b245-22743bf125a6.glb
                    viewerUrl: https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2F04818491-d43e-4576-b245-22743bf125a6.glb
                    arUrl: https://three.ws/api/ar?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2F04818491-d43e-4576-b245-22743bf125a6.glb&title=a%20low-poly%20orange%20fox
                    format: glb
                pending:
                  summary: Queued - poll with the job handle
                  value:
                    status: pending
                    job: f1.eyJwIjoibnZpZGlhIn0.c2ln
                    poll: /api/3d/studio?job=f1.eyJwIjoibnZpZGlhIn0.c2ln&title=a%20low-poly%20orange%20fox
                    watchUrl: https://three.ws/watch?job=f1.eyJwIjoibnZpZGlhIn0.c2ln&title=a%20low-poly%20orange%20fox
                    format: glb
        "400":
          description: >-
            Invalid prompt (too short/long) or refused by the content-safety
            gate (error "prompt_rejected"). Relay the message to the user.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: Free generation limit reached - ask the user to try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "502":
          description: The generator could not start the job - safe to retry once.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: Generation temporarily unavailable - try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    get:
      operationId: checkModelJob
      x-openai-isConsequential: false
      summary: Check a pending 3D generation job
      description: >-
        Poll a generation started by generate3DModel. Use the pending
        response's "poll" path verbatim (it carries job and title). While
        "pending", offer watchUrl, show previewImageUrl if present, and keep
        polling. Stop on "done" (present glbUrl + viewerUrl + arUrl) or
        "error" (offer a free retry).
      parameters:
        - name: job
          in: query
          required: true
          schema:
            type: string
            minLength: 8
            maxLength: 1024
            pattern: "^[A-Za-z0-9._-]+$"
          description: The job handle returned by generate3DModel.
        - name: title
          in: query
          required: false
          schema:
            type: string
            maxLength: 120
          description: >-
            Short label for the finished model (usually the prompt) - it names
            the AR and viewer pages. Already embedded in the "poll" path of a
            pending response, so it never needs to be added by hand.
      responses:
        "200":
          description: Current job state.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenerationState"
              examples:
                done:
                  summary: Model ready
                  value:
                    status: done
                    job: f1.eyJwIjoibnZpZGlhIn0.c2ln
                    glbUrl: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/done.glb
                    viewerUrl: https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fdone.glb
                    arUrl: https://three.ws/api/ar?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fdone.glb
                    format: glb
                failed:
                  summary: Upstream failure - retrying is free
                  value:
                    status: error
                    job: f1.eyJwIjoibnZpZGlhIn0.c2ln
                    error: 3D generation hit a snag upstream - it costs nothing to try again.
        "400":
          description: Missing or malformed job handle.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: Polling too fast - wait for retry_after seconds.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/ar:
    get:
      operationId: openModelInAR
      x-openai-isConsequential: false
      summary: Augmented-reality launch for a finished model
      description: >-
        The endpoint every arUrl points at. Given a public https .glb, it
        serves a device-aware way to place that model in the user's real room:
        an Android phone is redirected into Google Scene Viewer, an iPhone gets
        a launch page whose "View in AR" button enters Apple Quick Look, and a
        desktop browser falls back to the interactive viewer. The response is a
        web page meant for a person to open, so the way to use this in a
        conversation is to hand the user the arUrl from generate3DModel or
        checkModelJob. Free and keyless like the rest of this API.
      parameters:
        - name: src
          in: query
          required: true
          schema:
            type: string
            format: uri
            maxLength: 2048
          description: >-
            Public https URL of the model to place, ending in .glb or .gltf.
            This is the glbUrl of a finished generation.
        - name: title
          in: query
          required: false
          schema:
            type: string
            maxLength: 120
          description: >-
            Short label for the model (usually the prompt). It names the AR
            launch page and its share card.
        - name: kind
          in: query
          required: false
          schema:
            type: string
            enum: [avatar]
          description: >-
            Set to "avatar" when the model is a rigged humanoid. It keeps
            Android on the launch page and adds the handoff that brings the
            character to life in the room instead of placing it as a static
            object.
      responses:
        "200":
          description: >-
            The AR launch page (iPhone and desktop, and any rigged avatar).
          content:
            text/html:
              schema:
                type: string
        "302":
          description: >-
            Redirect straight into Google Scene Viewer, for a static model on
            Android. The Location header carries the AR launch URL.
          headers:
            Location:
              description: The Scene Viewer launch URL.
              schema:
                type: string
        "400":
          description: >-
            The src value is missing, is not https, or does not point at a .glb
            or .gltf file. A designed error page explains what to fix.
          content:
            text/html:
              schema:
                type: string
components:
  schemas:
    GenerationState:
      type: object
      required: [status]
      properties:
        status:
          type: string
          enum: [done, pending, error]
          description: done = model ready; pending = keep polling; error = generation failed.
        glbUrl:
          type: string
          format: uri
          description: Public download URL of the generated GLB model (present when done).
        viewerUrl:
          type: string
          format: uri
          description: Interactive three.ws browser viewer for the model (present when done).
        arUrl:
          type: string
          format: uri
          description: >-
            Augmented-reality launch link (present when done). Opened on a
            phone it places the model in the user's real room: Quick Look on
            iPhone, Scene Viewer on Android; on desktop it falls back to the
            interactive viewer. Always present it to the user alongside the
            viewer link.
        format:
          type: string
          const: glb
          description: Output format - always GLB (binary glTF).
        previewImageUrl:
          type: string
          format: uri
          description: >-
            The concept image the generator paints first and then sculpts
            into 3D. Present on pending and done states once painted - show
            it to the user while the model is still generating.
        tier:
          type: string
          enum: [draft, standard, high]
          description: The quality tier this generation is running at.
        etaSeconds:
          type: integer
          description: >-
            Rough estimate of remaining generation time in seconds (pending
            states only). Returned on both the initial submit and every
            subsequent poll, recomputed from time already elapsed, so it
            counts down as the job progresses. Use it to decide how long to
            wait before calling checkModelJob again.
        elapsedSeconds:
          type: integer
          description: >-
            Seconds since the generation was submitted (pending states only).
        job:
          type: string
          description: Job handle to pass to checkModelJob (present when pending).
        poll:
          type: string
          description: Relative poll path for the pending job.
        watchUrl:
          type: string
          format: uri
          description: >-
            Live progress page for a pending generation - a three.ws link
            showing a real countdown and the concept art, which opens the
            interactive viewer automatically the moment the model is done.
            Give it to the user on the first pending response ("watch it
            being made here") so they can follow along outside the chat.
        error:
          type: string
          description: Human-readable failure message (present when status is error).
    ErrorResponse:
      type: object
      required: [error, message]
      properties:
        error:
          type: string
          description: Machine-readable error code (e.g. invalid_prompt, prompt_rejected, rate_limited).
        message:
          type: string
          description: Human-readable explanation to relay to the user.
        retry_after:
          type: integer
          description: Seconds to wait before retrying (rate-limit responses).