REST API

Generate avatars remotely and get them as SVG, PNG, or WebP.
REST

1. REST API Base URL & Formats

The Space Avatar REST API generates vector SVGs, PNGs, and real WebP images. Raster output is rendered from the SVG server-side.

Supported Formats in REST Endpoints:
.svg.png.webp.json
HTTP Headers Provided:
Cache-Control: public, max-age=31536000, immutableETag: "base64url-hash"

2. REST Endpoints

GET/v1
Query Parameters Route
Returns avatar via query params. Default format is svg. Set format=png or format=webp for raster images.
GET/v1/[variant]/[name].[format]
Clean URL Route
Clean URL format for direct svg, png, or webp, or json.
GET/v1/schema
Machine Schema Route
Machine-readable API schema listing all 4 families, 21 variants, capabilities, and parameters.
JSONREST JSON Payload Response
format=json
When requesting format=json from the REST API, the response includes the SVG string, SVG data URI, base64 PNG and WebP data URIs, and parameterized route URLs.

3. REST Integration Code Examples

HTML <img> Embed

Fetch Base64 PNG via REST JSON Endpoint