Seed 기반의 결정적(Deterministic) 픽셀 아바타 생성 API입니다. 같은 seed는 항상 같은 아바타를 생성하여 프로필 이미지 등에 활용할 수 있습니다.
Features
Deterministic
같은 seed는 항상 같은 아바타 생성
Multiple Formats
PNG, SVG, JSON 출력 지원
Scalable
16px ~ 512px 크기 지원
Base URL
https://studyroom.vercel.app/api/avatarEndpoints
GET
/api/avatar/{resolution}/random랜덤 아바타를 생성합니다. 매 요청마다 새로운 아바타가 생성됩니다.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| resolution | string | 8bit (16x16) 또는 16bit (32x32) |
Example Request
curl "https://studyroom.vercel.app/api/avatar/16bit/random?size=128"GET
/api/avatar/{resolution}/seed/{seed}Seed 기반 결정적 아바타를 생성합니다. 같은 seed는 항상 같은 아바타를 반환합니다.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| resolution | string | 8bit (16x16) 또는 16bit (32x32) |
| seed | string | 아무 문자열 (username, email, UUID 등) |
Example Request
curl "https://studyroom.vercel.app/api/avatar/8bit/seed/john@example.com?size=64"Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| size | number | 64 | 출력 크기 (16-512) |
| format | string | png | png - 래스터 이미지svg - 벡터 이미지json - 아바타 파라미터 |
Resolution
8bit
16x16 pixels
레트로 스타일
16bit
32x32 pixels
디테일한 스타일
Response Formats
PNG (default)
래스터 이미지로 반환됩니다.
Content-Type: image/pngSVG
벡터 이미지로 반환됩니다. 무한 확대 가능.
Content-Type: image/svg+xmlJSON
아바타 생성에 사용된 파라미터를 반환합니다.
{
"seed": "example",
"resolution": "16bit",
"face": { "type": "round", "skinTone": "#E8B88A", ... },
"hair": { "type": "medium", "color": "#2C1810", ... },
"accessories": { "hat": "none", "glasses": "none", ... }
}Usage Examples
HTML
<img
src="https://studyroom.vercel.app/api/avatar/16bit/seed/username"
alt="User Avatar"
style="image-rendering: pixelated;"
/>React
function Avatar({ userId, size = 64 }) {
return (
<img
src={`/api/avatar/16bit/seed/${userId}?size=${size}`}
alt="User Avatar"
style={{ imageRendering: 'pixelated' }}
/>
);
}cURL
# Download PNG avatar
curl -o avatar.png "https://studyroom.vercel.app/api/avatar/16bit/seed/myuser?size=256"
# Get SVG format
curl "https://studyroom.vercel.app/api/avatar/8bit/seed/myuser?format=svg" > avatar.svgCORS
모든 API 엔드포인트는 CORS가 활성화되어 있어 외부 도메인에서도 호출 가능합니다.