The Kuberdons · Docs

How to use them

One image URL gives everyone in your app a friendly face. Free to use, no sign-up and no API key.

Quick start

Put an image tag where the avatar goes. Change the word at the end of the path and you get another Kuberdon.

HTML
<img src="https://cdn.kuberdon.eu/kuberdons/v1/Ada.svg" width="64" height="64" alt="">

This is the Kuberdon for Ada. It looks the same on every device, for as long as v1 exists.

The URL

https://cdn.kuberdon.eu/kuberdons/v1/{seed}.{svg|png}?{parameters}
v1
The version. v1 never changes. A new look would come as v2, at a new URL.
seed
Any text, up to 256 characters. The same seed always gives the same face. Encode it for a URL.
.svg or .png
SVG is a few kilobytes and sharp at any size. Use PNG where SVG is not welcome, like email.
parameters
All optional. Leave them out and the seed picks everything.

Parameters

Add them as a query, like ?size=64&shape=squircle. A trait you set wins over the one the seed picked; the rest stay as they were.

size
Width and height in pixels, a whole number.16 to 1024Default: 128
shape
The outline of the tile.circle, squircle, squareDefault: circle
palette
The colours: 16 palettes, a background and a body.burgundy, deep-blue, orange, forest, plum, ink, terracotta, teal, lavender, light-gold, mist-blue, sage, silver, blush, butter, mintDefault: from the seed
pose
How the body sits in the tile.rise, peek, peek-left, tiltDefault: from the seed
eyes
The eyes.dots, happy, wink, sleepy, big, side, surprisedDefault: from the seed
mouth
The mouth.smile, grin, o, flat, tongue, smirk, catDefault: from the seed
cheeks
1 adds blush, 0 leaves it out.0, 1Default: from the seed
extra
A small extra on top, or none.none, sprout, beanie, bow, glasses, headphones, flower, curl, earbudsDefault: from the seed
t
Sets every trait at once: k1, then the palette, pose, eyes, mouth, cheeks and extra as numbers, counted from 0 in the lists above. It wins over the other trait parameters.a trait code, like k1.9.0.1.0.1.8Default: none

Names are exact and lower case. The editor shows every part, and its Copy URL button gives you the address of the face you made.

Examples

  • The seed alonehttps://cdn.kuberdon.eu/kuberdons/v1/Ada.svg
  • A rounded squarehttps://cdn.kuberdon.eu/kuberdons/v1/Ada.svg?shape=squircle
  • Another palettehttps://cdn.kuberdon.eu/kuberdons/v1/Ada.svg?palette=mint
  • Glasses and happy eyeshttps://cdn.kuberdon.eu/kuberdons/v1/Ada.svg?extra=glasses&eyes=happy
  • A trait codehttps://cdn.kuberdon.eu/kuberdons/v1/Ada.svg?t=k1.9.0.5.4.1.8
Markdown
![Ada](https://cdn.kuberdon.eu/kuberdons/v1/Ada.png?size=128)
React
function Avatar({ seed, size = 40 }) {
  const src = `https://cdn.kuberdon.eu/kuberdons/v1/${encodeURIComponent(seed)}.svg`
  return <img src={src} width={size} height={size} alt="" />
}
CSS
.avatar {
  width: 40px;
  height: 40px;
  background: url("https://cdn.kuberdon.eu/kuberdons/v1/Ada.svg") center / cover;
}

Choosing a seed

Use something that stays the same for a person, like their user id. Please send a hash, never a raw email: anything in a URL can end up in logs along the way. Our own apps use the sha256 of the id.

Browser
async function kuberdonSeed(email) {
  const bytes = new TextEncoder().encode(email.trim().toLowerCase())
  const digest = await crypto.subtle.digest('SHA-256', bytes)
  return [...new Uint8Array(digest)].map(b => b.toString(16).padStart(2, '0')).join('')
}
Node
import { createHash } from 'node:crypto'

const seed = createHash('sha256').update(email.trim().toLowerCase()).digest('hex')

Small sizes

Below 24 pixels the extras (glasses stay) and the cheeks drop out, so the face stays clear. Ask for the size you show, or larger for sharp screens.

Caching

The same URL always gives the same bytes, so every answer can be kept for good.

  • Cache-Control: public, max-age=31536000, immutable: kept for a year.
  • A strong ETag, the same for every spelling of one avatar (parameter order and defaults do not matter).
  • Access-Control-Allow-Origin: *, so you can load them from any site.
  • SVG comes compressed (brotli or gzip) when your client asks for it.
  • No seeds or paths are logged. The server keeps request counts only, and the seed is never written into the image.

Errors and limits

Nothing falls back quietly. An unknown parameter, a name that is not in the list, a size out of range, a parameter given twice or a bad trait code gets a 400 that says what is wrong:

400
{ "error": "bad-request", "reason": "size must be a whole number from 16 to 1024" }

Each IP address can make 1,200 requests a minute. Past that you get a 429 until the minute is up. Let browsers cache the images and you will not come close.

Licence and credit

The code is MIT. The artwork, the faces themselves, is CC BY 4.0. You can use them anywhere, also in a commercial product, as long as you credit them as “Kuberdons by Kuberdon”. A line in your footer or credits is plenty.

Credit
Avatars: <a href="https://kuberdon.eu">Kuberdons by Kuberdon</a>, CC BY 4.0

The package, to draw them yourself offline, and the public code repository are coming soon Soon

Make one by hand and copy its URL.

Open the editor