# Embed KeenFace 3D heads

Web page: https://keenface.ai/docs/embed · API reference: https://keenface.ai/docs

Put any public KeenFace 3D head on a website with a standard HTML `<iframe>`. No SDK, script tag, or API key needed.

## Making a head embeddable

Only public heads load in embeds. Open the head in KeenFace Studio, click Share, and make it public. Copy the iframe from the Share dialog's Embed tab, or grab the head ID from its public link:

```text
https://keenface.ai/session/<id>
```

A private head will not load for other visitors, inside an iframe or on its own.

## Embed URL shape

```text
https://keenface.ai/session/<id>?iframe&<parameters>
```

The `iframe` flag is required. It switches the route to the chromeless embed viewer and sends no framing restriction, so any page can frame the head, including sandboxed previews such as AI chat artifacts and canvases, as long as the host page itself allows iframes. ChatGPT's in-chat HTML preview allows none, so a page shown there cannot load the head. Without `iframe`, the URL loads the full KeenFace page and browsers block framing on third-party sites.

## Presets

Replace `<id>` with your public head ID in any snippet below.

### Cover

A picture of the head that turns toward the pointer, shown without starting WebGL or downloading the 3D mesh. Clicking, tapping, or pressing Enter or Space opens live 3D at that angle. If a head has no thumbnail yet, cover mode requests one in the background and falls back straight to live 3D.

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&cover&view=3D&as=textured&bottom=style-new" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

### Hero

Live 3D at a three-quarter angle, wiping across material, wireframe, solid, and texture maps.

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=3D&as=textured&orbit=35&zoom=1.25&bottom=style-new&slideshow=pbr:5,mesh:3,solid:3,albedo:2,normal:2&transition=wipe&offset=0,0.08" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

### Texture maps

Fades through lit material, base color, normal, and roughness maps.

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=3D&as=textured&map=pbr&bottom=style-new&orbit=30&zoom=1.2&slideshow=pbr:4,albedo:2,normal:2,roughness:2&transition=fade" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

### Wireframe

3D wireframe at a three-quarter angle with no controls.

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=3D&as=mesh&orbit=30&zoom=1.2" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

### Photo match

2D head aligned over its photos, with a strip to switch shots.

*Uses the head's photos. Heads made in reference mode show their generated views.*

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=2D&as=solid&top=view-new&right=style-new-v&bottom=imgs-new&slideshow=mesh:3,solid:3,pbr:4&transition=wipe" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

### Animation

Plays ARKit animation in 3D with buttons to switch clips.

*Needs ARKit blendshapes. Heads served as a preview stay still.*

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=3D&as=solid&bottom=expressions-new&anims=idle,smile,wink,mouthOpen&autoplay=idle&orbit=25&zoom=1.3" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

## Query parameters

| Parameter | Values | Default | What it does |
| --- | --- | --- | --- |
| `iframe` | flag | off | Required. Enables the embed viewer and cross-origin framing. |
| `overlay` | flag | off | Floats control zones over the full-bleed head instead of shrinking the frame. Empty space between controls still lets visitors drag the head. |
| `cover` | flag | off | Shows a pre-rendered image that turns toward the pointer instead of starting WebGL until clicked, tapped, or activated with Enter or Space. Works in `view=3D` only and always opens in 3D. Falls back to live 3D if no thumbnail exists yet. |
| `view` | `3D`, `2D` | `2D` | Sets 3D orbit view or 2D photo overlay. Pass `view=3D` for a 3D head. In `view=2D`, `cover`, `orbit`, and `autoplay` have no effect. |
| `as` | `mesh`, `solid`, `textured` | `solid` | Sets wireframe, untextured clay, or textured rendering. On preview models, `mesh` falls back to `solid`. When `slideshow` is set, `as` sets only the opening look. |
| `map` | `pbr`, `albedo`, `normal`, `roughness`, `specular` | `pbr` | Texture channel for `as=textured`. `pbr` is lit material, `albedo` is unlit base color, and `normal`, `roughness`, and `specular` show baked skin maps when present on the head. Ignored unless `as=textured`, and overridden by `slideshow` after the first step. |
| `bg` | CSS color or `transparent` | `#212121` | Sets the iframe background color. URL-encode `#` as `%23`, for example `bg=%23212121` or `bg=%23ededed`. Omit `bg` for the default `#212121` canvas, or pass `bg=transparent` so your page shows through. |
| `orbit` | `yaw` or `yaw,pitch` in degrees | front (`0,0`) | Initial 3D camera angle on load. Applies in `view=3D` only. Yaw clamps to `-180` through `180`; pitch clamps to `-80` through `80`. In `cover` mode, sets the resting yaw and keeps pitch when 3D opens. Visitors can orbit afterward. |
| `zoom` | `1` to `5` | `1` | Initial zoom level in 2D and 3D. Embeds disable wheel and pinch zoom, so `zoom` and the `zoom-new` control are the only zoom inputs. |
| `offset` | `x` or `x,y` in `-0.3` to `0.3` | 3D: `0,0.11` at `zoom=1`; 2D: `0,0` | Shifts the head as a fraction of frame width and height. Positive `x` moves right; positive `y` moves up. In 3D, the default vertical lift tapers to `0` near `zoom=1.8`. Pass `0,0` to remove the default lift. |
| `slideshow` | `mode[:seconds],...` | off | Cycles render modes on a timer while visible in the viewport and active tab. Valid modes: `mesh`, `solid`, `pbr`, `albedo`, `normal`, `roughness`, `specular`. Duration clamps to `0.5` through `60` seconds and defaults to `3`. Unsupported modes are skipped, any interaction stops the slideshow, and in `cover` mode it starts after the visitor opens 3D. |
| `transition` | `cut`, `fade`, `wipe` | `cut` | Effect between `slideshow` steps. Used only when `slideshow` is set. `fade` and `wipe` run over `0.6` seconds; visitors with reduced motion get `cut`. |
| `top`, `bottom`, `left`, `right` | comma-separated controls | none | Places controls in each edge zone. See Controls below. |
| `controlsScale` | `0.75` to `2` | `1` | Scales floating controls. Applies only when `overlay` is on and at least one control is placed in a zone. |
| `autoplay` | `idle`, `smile`, `blink`, `mouthOpen`, `wink` | none | Starts an animation clip on load in `view=3D` on heads with ARKit blendshapes. Ignored in `view=2D`, waits for click in `cover` mode, and stays still on preview models. `idle` loops until stopped or replaced. |
| `anims` | comma-separated clip keys | all five public clips | Picks and orders the buttons shown by `expressions-new`. Used only when `expressions-new` is in a zone. Valid keys: `idle`, `smile`, `blink`, `mouthOpen`, `wink`. Unknown keys are ignored. |

## Controls

Pass any combination of these control names in `top`, `bottom`, `left`, or `right`:

| Control | What it shows |
| --- | --- |
| `view-new` | 2D and 3D toggle. |
| `style-new` | Style buttons for wireframe, solid, and lit material, plus texture map buttons when the head carries baked skin maps. |
| `expressions-new` | Animation clip buttons driving the head's 51 ARKit blendshapes. Hidden on preview models. |
| `imgs-new` | Photo strip in `view=2D`. Hidden in `view=3D`. |
| `zoom-new` | Minus and plus zoom buttons scaling `1.25x` per press within `1` to `5`. `zoom` is an alias for `zoom-new`. |
| `shapes-new` | Grouped morph sliders for blendshapes present on the head. Hidden on preview models. |
| `rig-new` | Face control board for dragging ARKit blendshapes directly. Hidden on preview models. |

Add `-v` after `-new` to stack a control vertically in `left` or `right` zones, for example `right=style-new-v` or `left=view-new-v,zoom-v`. Always put `-new` before `-v`.

Example with floating controls, a three-quarter start angle, and an idle animation:

```html
<iframe src="https://keenface.ai/session/<id>?iframe&overlay&view=3D&as=textured&bottom=expressions-new&anims=idle,smile,wink,mouthOpen&autoplay=idle&orbit=25&zoom=1.3" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>
```

## Sizing, backgrounds, and loading

**Responsive square.** Give the iframe `width:100%;aspect-ratio:1/1;border:0` inside a container that caps width, or set explicit dimensions such as `width="480" height="480"` with `style="border:0"`. Non-square frames work too; use `offset` and `zoom` to adjust head framing for wide banners.

**Background colors.** Omitting `bg` uses the default dark `#212121` canvas. Pass a URL-encoded hex color such as `bg=%23212121` or `bg=%23ededed` to match a solid card. Pass `bg=transparent` to make the iframe document transparent so your page background or gradient shows behind the head. Both the 3D WebGL canvas and cover-mode images have alpha transparency; keep the `<iframe>` element's own CSS background unset or `transparent`.

**Lazy loading.** Keep `loading="lazy"` on below-the-fold iframes so browsers wait until the visitor scrolls near them. On pages with several heads, use the `cover` flag so only clicked heads start WebGL.

## Touch and scroll behavior

Embeds never capture page scroll. Mouse wheel zoom, trackpad pinch zoom, and canvas panning are disabled inside iframes, so scrolling past an embedded head works normally on desktop and mobile. Dragging orbits the head in 3D, and touch devices tap a `cover` embed to open 3D.

## Free accounts and preview models

A head whose owner has not bought credits, or whose purchases were refunded, may serve a lighter preview model to visitors instead of the full one. The preview has no ARKit blendshapes and no wireframe. On those heads, `as=mesh` falls back to `solid`, `mesh` steps in `slideshow` are skipped, and `expressions-new`, `shapes-new`, `rig-new`, and `autoplay` do nothing. Buying credits switches existing and new embeds of that account's heads to the full GLB.

## Building with an AI agent

Paste this prompt into Claude, ChatGPT, or your coding agent and say what you want to build:

```text
Embed this public KeenFace 3D head on a web page using this iframe:

<iframe src="https://keenface.ai/session/<your head id>?iframe&overlay&cover&view=3D&as=textured&bottom=style-new&bg=transparent" title="3D head" loading="lazy" allow="fullscreen" style="width:100%;aspect-ratio:1/1;border:0"></iframe>

Replace <your head id> with the ID from the head's public link at https://keenface.ai/session/<id>, made public via Share in Studio.
Read https://keenface.ai/docs/embed.md for every embed parameter, preset, control, and sizing option.
If I have not said what to build below, ask me first.
If you can render HTML in this chat, such as an artifact, canvas, or live preview, show a self-contained working page right here. ChatGPT's preview blocks every iframe, so in ChatGPT skip it and use the steps below.
If you can't show a working page here but can run commands on my computer, save it as index.html, serve it (for example `npx serve .` or `python3 -m http.server`) and give me the local URL to open.
Otherwise give me the complete index.html and the one command to serve it. Serve it over http: a page opened straight from a file:// path cannot load the embed.

What I want to build:
```
