# glbshot

glbshot is an alpha HTTP screenshot service for GLB, GLTF, and VRM assets.

- Root service URL: https://glbshot.com
- Human landing page: https://glbshot.com/
- Agent-oriented docs: https://glbshot.com/.well-known/llms.txt
- Agent-friendly markdown mirror: https://glbshot.com/index.html.md

## API shape

`GET /api/v1/screenshot/{args}/{url}`

`args` is a comma-separated `key:value` list.

Limits:

- output width max: `2048`
- output height max: `2048`
- source GLB max size: `100MB`

Supported keys:

- `w`: output width in pixels, max `2048`
- `h`: output height in pixels, max `2048`
- `t`: timeout in milliseconds
- `c`: background color
- `@`: `model-viewer` version, such as `4.1`
- `m`: raw `model-viewer` attributes as a URL query string
- `q`: image quality from `0-100` or `0-1`
- `f`: output format, one of `png`, `jpg`, `jpeg`, `webp`
- `o`: full `camera-orbit` string
- `ot`: `camera-orbit` theta component
- `op`: `camera-orbit` phi component
- `or`: `camera-orbit` radius component
- `r`: `orientation` roll component
- `p`: `orientation` pitch component
- `y`: `orientation` yaw component

Orbit merge priority:

1. `ot`, `op`, `or`
2. `o`
3. `camera-orbit` inside `m`
4. default `model-viewer` orbit values

Orientation merge priority:

1. `r`, `p`, `y`
2. `orientation` inside `m`
3. default `model-viewer` orientation values

## Interactive guide

The root landing page progressively enhances into a live usage guide.

- It uses the local sample model at `https://glbshot.com/samples/Duck.glb`
- It exposes UI controls for all API parameters listed above
- It shows the corresponding live API request URL
- It includes a client-side screenshot button so the sample preview can be downloaded directly in the browser

## Example requests

Default-style JPEG request using the sample duck:

```text
https://glbshot.com/api/v1/screenshot/w:512,h:512,q:90,f:jpg,t:120000,m:camera-controls/https%3A%2F%2Fglbshot.com%2Fsamples%2FDuck.glb
```

Transparent PNG:

```text
https://glbshot.com/api/v1/screenshot/w:512,h:512,q:90,f:png,t:120000,m:camera-controls/https%3A%2F%2Fglbshot.com%2Fsamples%2FDuck.glb
```

Specific orbit:

```text
https://glbshot.com/api/v1/screenshot/w:512,h:512,q:90,f:webp,t:120000,m:camera-controls,ot:-180deg,or:2.2m/https%3A%2F%2Fglbshot.com%2Fsamples%2FDuck.glb
```

Specific orientation:

```text
https://glbshot.com/api/v1/screenshot/w:512,h:512,q:90,f:jpg,t:120000,m:camera-controls,r:15deg,p:-20deg,y:180deg/https%3A%2F%2Fglbshot.com%2Fsamples%2FDuck.glb
```

## Operational notes

Oversized requests:

- width or height above `2048` return an error
- source GLB files above `100MB` return an error

glbshot is an alpha project by Boxtree, Inc.

- No uptime guarantees
- No SLA

If you want to use glbshot on a pay-per-use or subscription basis, send your intended use case to [hello@boxtree.gg](mailto:hello@boxtree.gg).

Thank you to:

- [`<model-viewer>`](https://modelviewer.dev)
- [`screenshot-glb`](https://github.com/Shopify/screenshot-glb)

Boxtree website: https://www.boxtree.gg
