Documentation
Everything to integrate Tronche into your projects
API Reference
Explore our complete REST API reference with interactive documentation. Try endpoints directly from your browser.
Open API Reference→Installation
npm install troncheUsage
Use the core generators directly — no framework required. Each variant provides three functions: generate*Data, render*Svg and generate*Svg for full control.
import { generateBeamSvg } from 'tronche'
const svg = generateBeamSvg('Clara Barton', ['#E07A5F', '#3D405B', '#81B29A', '#F4D06F', '#D8A47F'], {
size: 120,
})
document.getElementById('app')!.innerHTML = svgREST API
Generate avatars remotely via our API.
GET
/api/avatar/:name| Parameter | Type | Default | Description |
|---|---|---|---|
| variant | string | marble | marble, beam, pixel, sunset, ring, bauhaus |
| size | number | 80 | 16 to 512 |
| square | boolean | false | true or false |
| colors | string | — | Comma-separated hex colors |
Examples
curl "https://tronche.cc/api/avatar/Clara%20Barton?variant=beam"Rate limiting
The free plan allows 100 requests per minute per IP. For higher volume, create an account and use an API key.
Variants
beam
Expressive faces
pixel
8×8 pixel art
sunset
Color gradients
ring
Concentric circles
bauhaus
Geometric shapes
marble
Blurry organic shapes