OpenBot Avatars API

OpenBot Avatars API docs

Add a bot avatar to your app with one image URL. No account, API key, or package installation required.

  • 47 designs across two collections.
  • Random images, repeatable seeds, and exact avatar URLs.
  • Transparent 512 × 512 PNGs, plus native SVGs for Open Bot Avatar.

Try requests in the API playground. Artwork credits and MIT license details are on the license page.

Quick start

Use the image endpoint directly in an image tag. Each request without a seed or avatar picks a random design; repeats are possible.

<img src="https://open-bot-avatars-api.vercel.app/api/avatar?v=5" width="64" height="64" alt="Bot avatar">

These examples use the hosted API at https://open-bot-avatars-api.vercel.app and work from your app’s domain. If you host your own copy, replace this origin with your deployment’s public URL.

curl "https://open-bot-avatars-api.vercel.app/api/avatar?v=5&seed=user-42" --output avatar.png

Endpoints

GET requestResponse
/api/avatar?v=5A random avatar image. Defaults to flat PNG.
/api/avatars?v=5Version 5 catalog with 47 designs, explicit variants, and image URLs for supported finishes.
/api/avatarsVersion 5 catalog, the default when v is omitted.

Repeatable avatars with seeds

Use /api/avatar?v=5&seed=user-42 to select an avatar consistently for a user. Include the version and keep the collection, format, and style filters the same to retain the selection. Candidate membership and ordering are frozen within each version. Different seeds can select the same design.

Seeds are visible in URLs. Use a public identifier rather than an email address, password, or other private value. Encode seed values with URLSearchParams.

export function UserAvatar({ userId }: { userId: string }) {
  const params = new URLSearchParams({ v: "5", seed: userId });
  return (
    <img
      src={"https://open-bot-avatars-api.vercel.app/api/avatar?" + params}
      width={64}
      height={64}
      alt="User avatar"
    />
  );
}

Choose a specific design

Read the catalog for valid IDs and supported combinations. Use collection and avatar together for an exact selection.

ExampleResult
/api/avatar?v=5&collection=open-bot-avatar&avatar=mugMug in its original color, flat PNG
/api/avatar?v=5&collection=open-bot-avatar&avatar=mug&style=fluffyMug with baked fur, transparent PNG
/api/avatar?v=5&collection=open-bot-avatar&avatar=controller&format=svgController as a flat native SVG
/api/avatar?v=5&collection=bot-avatars&style=originalRandom Libraries.dev design in its original plush style
const response = await fetch('https://open-bot-avatars-api.vercel.app/api/avatars?v=5');
if (!response.ok) throw new Error('Could not load the catalog');
const { total, avatars } = await response.json();

// Use entry.variants for valid format/style pairs.
// fluffyUrl and originalUrl are null when that finish is unavailable.
const avatarUrl = new URL(avatars[0].url, response.url).href;

Query parameters

These parameters apply to GET /api/avatar. Omitting v selects version 5 for all requests, including seeds and fluffy PNGs. Version 4 remains available with its original 41 designs. Include v=5 in saved URLs.

v5 (default and only supported version). Include v=5 in saved URLs to keep the same selection when future versions are added.
seedA public identifier of 1–128 JavaScript string code units. The same seed with the same version and filters selects the same avatar. Cannot be combined with avatar.
collectionopen-bot-avatar or bot-avatars. Omit to select from collections compatible with the requested format and style.
avatarAn exact design ID from /api/avatars. Requires collection. Omit both avatar and seed for a random selection.
formatpng (default) or svg. SVG is available only for Open Bot with flat style; fluffy SVG is rejected.
styleflat (default), fluffy (Open Bot PNG only), or original (Libraries.dev PNG only). Check the catalog variants for valid pairs.

Save a random result

A random request returns the chosen image’s exact, reusable path in the Content-Location response header. Resolve it against the API host and save that URL to keep the same image.

const response = await fetch('https://open-bot-avatars-api.vercel.app/api/avatar?v=5');
if (!response.ok) {
  const { error } = await response.json();
  throw new Error(error);
}

const location = response.headers.get('Content-Location');
if (!location) throw new Error('Missing avatar URL');
const avatarUrl = new URL(location, response.url).href;
// Store avatarUrl on the user's profile to keep this exact image.

Responses, caching, and CORS

200The image bytes, or JSON for the catalog. Images use image/png or image/svg+xml.
Content-LocationRelative URL of the exact selected image, including its version, collection, ID, format, and style.
X-Avatar-Collection / X-Avatar-IdIdentify the returned design.
Cache-ControlRandom images use no-store. Seeded images, exact image URLs, and the JSON catalog use public, max-age=86400 (one day).
ETag / 304Image responses include an ETag. For seeded or exact image requests, send it as If-None-Match to receive 304 with no body when unchanged.
CORSBoth endpoints allow requests from any origin. Image responses expose Content-Location, X-Avatar-Collection, X-Avatar-Id, and ETag to browser JavaScript.

Errors

Both endpoints share a limit of 180 requests per minute per client IP at the application server. Excess requests return 429; wait for the number of seconds in Retry-After before retrying. Cached images do not consume this quota. If the shared limiter is unavailable, requests return 503 with retry guidance.

Invalid requests return 400 with a JSON error message and Cache-Control: no-store. Unknown or duplicate parameters, invalid values, unknown avatar IDs, and unsupported format or style combinations are rejected.

{
  "error": "Choose an avatar or a seed, not both."
}

For example, do not combine seed with avatar, request SVG for Libraries.dev, fluffy SVG, or original plush for Open Bot Avatar. Check each v5 catalog entry’s variants pairs before constructing a URL; the format/style summaries are not a Cartesian product.

Hosted images and the editor

The hosted API serves pre-generated images with the catalog’s original colors and fixed poses. All 29 Open Bot designs support v=5&style=fluffy as PNG; Libraries.dev’s original plush images use style=original. Requests read saved files and do not render fur on the server. Custom editor colors, mood, rotation, and animation remain editor controls.

Fluffy previews animate by default. Choose Preview PNG to inspect the actual returned image, then Show animation to return to the live preview. Live fur can fall back to flat when WebGL2 is unavailable; the saved PNG keeps its fluffy finish on every device. Copied URLs, shared picker links, and downloads preserve the selected version and finish.

Use the API playground to choose a hosted image, copy its URL or HTML embed, and download supported formats.

In the editor, choose Export → Download current preview for a transparent PNG with the visible material, color, pose, and angle. Download flat SVG keeps the selected color, mood, state, and angle in a still vector image. The original-color API URL always points to the hosted catalog image.