X402 AI Avatar

External Configuration Guide - How to create and deploy custom AI avatars

외부 설정 주입 가이드 - 커스텀 AI 아바타를 생성하고 배포하는 방법

🚀 Quick Start빠른 시작

1

Create Config File

설정 파일 생성

Create a my-avatar.json file:

my-avatar.json 파일을 생성합니다:

my-avatar.json JSON
{
  "name": "MyAvatar",
  "type": "companion",
  "persona": "A friendly AI assistant",
  "systemPrompt": "You are MyAvatar, a helpful assistant...",

  "appearance": {
    "vrm": "https://your-server.com/models/avatar.vrm",
    "background": "https://your-server.com/images/bg.jpg"
  },

  "ui": {
    "title": "MyAvatar - AI Assistant"
  }
}
2

Host Config File

설정 파일 호스팅

Upload the JSON file to an HTTPS-accessible server (GitHub Pages, Cloudflare R2, etc.)

JSON 파일을 HTTPS로 접근 가능한 서버에 업로드합니다. (GitHub Pages, Cloudflare R2 등)

3

Access Avatar

아바타 접속

URL
https://x402.quasar.ggls.dev/avatar?config=https://your-server.com/my-avatar.json

🎮 Live Examples실사용 예제

Click the links below to see working avatars in action.

아래 링크를 클릭하여 실제 동작하는 아바타를 확인할 수 있습니다.

CRYPTO

Ria - Crypto Advisor

Crypto advisor avatar with wallet UI and trading features enabled.

크립토 어드바이저 아바타. 지갑 UI와 거래 기능이 활성화되어 있습니다.

URL
https://x402.quasar.ggls.dev/avatar?config=https://x402.quasar.ggls.dev/static/assets/config/ria.json
Open Ria Avatar → Ria 아바타 열기 →
COMPANION

Luna - AI Companion

General conversation companion avatar. Wallet UI is hidden and trading features are disabled.

일반 대화 친구 아바타. 지갑 UI가 숨겨져 있고 거래 기능이 비활성화되어 있습니다.

URL
https://x402.quasar.ggls.dev/avatar?config=https://x402.quasar.ggls.dev/static/assets/config/companion.json
Open Luna Avatar → Luna 아바타 열기 →
💡
Tip: Add &debug=true to the end of the URL to see detailed logs in the browser console. 팁: URL 끝에 &debug=true를 추가하면 브라우저 콘솔에서 상세 로그를 확인할 수 있습니다.

📋 Config Schema설정 스키마

Basic Fields

기본 필드

Field필드 Type타입 Required필수 Description설명
name string Avatar name아바타 이름
type string crypto (default) or(기본값) 또는 companion
persona string Avatar personality summary아바타 성격 요약
systemPrompt string AI system prompt (full)AI 시스템 프롬프트 (전체)

Avatar Types

아바타 타입

Type타입 Description설명 Wallet UI지갑 UI Trading거래 기능
crypto Crypto Advisor크립토 어드바이저 Shown표시 Enabled활성화
companion Conversation Companion일반 대화 친구 Hidden숨김 Disabled비활성화

🎨 appearance (Visual Settings)appearance (외관 설정)

appearance structureappearance 구조 JSON
{
  "appearance": {
    "vrm": "/static/assets/vrm/model.vrm",
    "background": "/static/assets/bg/bg01.jpg",
    "theme": {
      "primary": "#00f0ff",
      "secondary": "#ff00ff",
      "accent": "#ffff00",
      "success": "#00ff88",
      "warning": "#ff8800",
      "danger": "#ff0044"
    }
  }
}

VRM Model

VRM 모델

Supported Specs:지원 사양:

  • VRM 1.0 format recommended (VRM 0.x auto-converted)VRM 1.0 형식 권장 (VRM 0.x도 자동 변환)
  • Lip-sync available with ARKit 52 blendshapes supportARKit 52 블렌드셰이프 지원 시 립싱크 가능
  • Recommended polygon count: under 50,000권장 폴리곤 수: 50,000 이하
  • Max file size: 50MB최대 파일 크기: 50MB

Theme Colors

테마 색상

primary
#00f0ff
secondary
#ff00ff
accent
#ffff00
success
#00ff88
warning
#ff8800
danger
#ff0044
Color색상 Usage용도
primary Buttons, emphasis text, active state버튼, 강조 텍스트, 활성 상태
secondary Hover effects, secondary emphasis호버 효과, 보조 강조
accent Badges, notifications, highlights배지, 알림, 하이라이트
success Success messages, completion status성공 메시지, 완료 상태
warning Warning messages경고 메시지
danger Errors, danger status에러, 위험 상태

capabilities (Feature Settings)capabilities (기능 설정)

capabilities structurecapabilities 구조 JSON
{
  "capabilities": {
    "tools": ["get_wallet_balance", "search_premium_coin_data"],
    "voice": "Kore",
    "defaultLanguage": "ko",
    "requireWallet": true
  }
}

Available Tools

사용 가능한 Tools

Tool NameTool 이름 Description설명 Type타입
get_wallet_balance Get wallet balance지갑 잔액 조회 Read-only읽기 전용
get_spending_status Get spending status지출 현황 조회 Read-only읽기 전용
search_premium_coin_data Search coin prices/trends코인 시세/트렌드 검색 Read-only읽기 전용
buy_coin_on_base Buy cryptocurrency코인 구매 Trading거래
sell_coin_on_base Sell cryptocurrency코인 판매 Trading거래
send_tip Send tip/transfer팁/송금 Trading거래
ℹ️
Note: Trading tools are automatically disabled when type: "companion". 참고: type: "companion"인 경우 거래 Tools는 자동으로 비활성화됩니다.

Voice Settings (30 voices available)

음성 설정 (30개 음성 지원)

Voice Characteristics특징
Bright / Upbeat밝음 / 경쾌함
ZephyrBright (밝음)
PuckUpbeat (경쾌함)
AutonoeBright (밝음)
LaomedeiaUpbeat (경쾌함)
SadachbiaLively (활기참)
Firm / Clear단단함 / 명확함
KoreFirm (단단함)Default기본값
FenrirExcitable (열정적)
OrusFirm (단단함)
IapetusClear (명확함)
ErinomeClear (명확함)
AlnilamFirm (단단함)
Informative / Knowledgeable정보적 / 박식함
CharonInformative (정보적)
RasalgethiInformative (정보적)
SadaltagerKnowledgeable (박식함)
Soft / Gentle / Warm부드러움 / 온화함 / 따뜻함
AoedeBreezy (산뜻함)
AchernarSoft (부드러움)
VindemiatrixGentle (온화함)
SulafatWarm (따뜻함)
Smooth / Easy-going부드러움 / 느긋함
CallirrhoeEasy-going (느긋함)
UmbrielEasy-going (느긋함)
AlgiebaSmooth (부드러움)
DespinaSmooth (부드러움)
ZubenelgenubiCasual (캐주얼)
Youthful / Friendly젊음 / 친근함
LedaYouthful (젊음)
AchirdFriendly (친근함)
Mature / Even성숙함 / 균형
GacruxMature (성숙함)
SchedarEven (균형잡힘)
PulcherrimaForward (적극적)
Unique독특함
EnceladusBreathy (숨결)
AlgenibGravelly (거친)
🎧
Tip: Preview all voices at Google AI Studio 팁: Google AI Studio에서 모든 음성을 미리 들어볼 수 있습니다

Language Settings

언어 설정

Option옵션 Description설명
autoAuto-detect browser language브라우저 언어 자동 감지
koKorean한국어
enEnglish영어
jaJapanese일본어
zhChinese중국어

🖥️ ui (UI Settings)ui (UI 설정)

ui structureui 구조 JSON
{
  "ui": {
    "title": "MyAvatar - AI Assistant",
    "showWallet": true,
    "showChat": true,
    "allowVoice": true,
    "allowCamera": true,
    "allowScreenShare": false
  }
}
Field필드 Default기본값 Description설명
title Avatar name아바타 이름 Title displayed in header헤더에 표시되는 타이틀
showWallet true Show wallet panel지갑 패널 표시 여부
showChat true Show chat UI채팅 UI 표시 여부
allowVoice true Enable voice input button음성 입력 버튼 활성화
allowCamera true Enable camera button카메라 버튼 활성화
allowScreenShare true Enable screen share button화면 공유 버튼 활성화

🎬 animation & lipSync

animation (Animation Settings)

animation (애니메이션 설정)

animation structureanimation 구조 JSON
{
  "animation": {
    "crossFadeDuration": 2.4,
    "pingPongBlendThreshold": 0.85
  }
}
Field필드 Default기본값 Range범위 Description설명
crossFadeDuration 2.4 0.5 ~ 5.0 idle ↔ speaking transition time (seconds)idle ↔ speaking 전환 시간 (초)
pingPongBlendThreshold 0.85 0.5 ~ 0.95 Ping-pong animation transition threshold핑퐁 애니메이션 전환 임계값

lipSync (Lip Sync Settings)

lipSync (립싱크 설정)

lipSync structurelipSync 구조 JSON
{
  "lipSync": {
    "enabled": true,
    "bufferMs": 350,
    "smoothing": false
  }
}
Field필드 Default기본값 Description설명
enabled true Enable lip sync립싱크 활성화 여부
bufferMs 350 Audio-lipsync sync buffer (ms)오디오-립싱크 동기화 버퍼 (ms)
smoothing false Apply One Euro Filter smoothingOne Euro Filter 스무딩 적용

📷 camera (Camera Settings)camera (카메라 설정)

camera structurecamera 구조 JSON
{
  "camera": {
    "fov": 30,
    "position": { "x": 0, "y": 1.247, "z": 2.116 },
    "target": { "x": 0, "y": 0.944, "z": 0.152 }
  }
}

Camera Coordinates

카메라 좌표계

y (up)(위) │ │ target (avatar face)(아바타 얼굴) │ ● │ / │ / └───●────────── z (front)(앞) position (camera)(카메라)

Shot Type Guide

샷 타입 가이드

Shot Type샷 타입 fov position.z target.y Description설명
Close-up클로즈업 20 1.5 1.1 Face focus얼굴 중심
Medium미디엄 30 2.1 0.95 Upper body (default)상반신 (기본값)
Full shot풀샷 40 3.0 0.8 Full body전신

📝 Full Examples전체 예시

Crypto Type (with trading features)

Crypto 타입 (거래 기능 포함)

crypto-avatar.json JSON
{
  "name": "CryptoBot",
  "type": "crypto",
  "persona": "A knowledgeable crypto trading assistant",
  "systemPrompt": "You are CryptoBot, an expert in cryptocurrency...",

  "appearance": {
    "vrm": "https://example.com/models/cryptobot.vrm",
    "background": "https://example.com/bg/trading-floor.jpg",
    "theme": {
      "primary": "#00ff88",
      "secondary": "#0088ff",
      "accent": "#ffff00"
    }
  },

  "capabilities": {
    "tools": [
      "get_wallet_balance",
      "search_premium_coin_data",
      "buy_coin_on_base",
      "sell_coin_on_base"
    ],
    "voice": "Puck",
    "defaultLanguage": "en",
    "requireWallet": true
  },

  "limits": {
    "maxDailySpend": 10.0,
    "maxSingleTx": 2.0
  },

  "ui": {
    "title": "CryptoBot - Trading Assistant",
    "showWallet": true,
    "allowScreenShare": true
  },

  "camera": {
    "fov": 25,
    "position": { "x": 0, "y": 1.3, "z": 1.8 }
  }
}

Companion Type (conversation only)

Companion 타입 (대화 전용)

companion-avatar.json JSON
{
  "name": "Luna",
  "type": "companion",
  "persona": "A friendly AI companion who loves chatting",
  "systemPrompt": "You are Luna, a warm and friendly AI friend...",

  "appearance": {
    "vrm": "https://example.com/models/luna.vrm",
    "background": "https://example.com/bg/cozy-room.jpg",
    "theme": {
      "primary": "#7c3aed",
      "secondary": "#4c1d95",
      "accent": "#a78bfa"
    }
  },

  "capabilities": {
    "tools": [],
    "voice": "Kore",
    "defaultLanguage": "ko",
    "requireWallet": false
  },

  "ui": {
    "title": "Luna - AI Companion",
    "showWallet": false,
    "allowScreenShare": false
  },

  "animation": {
    "crossFadeDuration": 3.0
  },

  "lipSync": {
    "smoothing": true
  }
}

☁️ Config File Hosting설정 파일 호스팅

Requirements

요구사항

  • HTTPS RequiredHTTPS 필수: All resource URLs must be HTTPS.모든 리소스 URL은 HTTPS여야 합니다.
  • CORS SettingsCORS 설정: Server must allow CORS headers.서버에서 CORS 헤더를 허용해야 합니다.
    Access-Control-Allow-Origin: *
  • Content-Type: JSON files must be served asJSON 파일은 application/json으로 제공되어야 합니다.

Recommended Hosting Options

권장 호스팅 옵션

Service서비스 Free무료 CORS Description설명
GitHub Pages Static file hosting정적 파일 호스팅
Cloudflare R2 ✓ (10GB) Object storage오브젝트 스토리지
AWS S3 Paid유료 Config needed설정 필요 Large-scale storage대용량 스토리지
Vercel Static site hosting정적 사이트 호스팅

GitHub Pages Example

GitHub Pages 예시

  1. Create GitHub repositoryGitHub 저장소 생성
  2. Upload config file:설정 파일 업로드: configs/my-avatar.json
  3. Enable GitHub Pages (Settings → Pages)GitHub Pages 활성화 (Settings → Pages)
  4. Access URL:접속 URL:
    https://x402.quasar.ggls.dev/avatar?config=https://username.github.io/repo/configs/my-avatar.json

🔧 Debugging디버깅

Enable Debug Mode

디버그 모드 활성화

Add ?debug=true to the URL to see detailed logs in the browser console:

URL에 ?debug=true를 추가하면 브라우저 콘솔에서 상세 로그를 확인할 수 있습니다:

https://x402.quasar.ggls.dev/avatar?config=https://...&debug=true

Check Config in Console

콘솔에서 설정 확인

Browser Console JavaScript
// Check loaded config로드된 설정 확인
console.log(window.avatarConfig);

// Check applied theme colors적용된 테마 색상 확인
getComputedStyle(document.documentElement).getPropertyValue('--cyber-primary');

Common Troubleshooting

일반적인 문제 해결

Problem문제 Cause원인 Solution해결
Config not loading설정이 로드되지 않음 CORS errorCORS 오류 Add CORS headers to server서버에 CORS 헤더 추가
VRM model load failureVRM 모델 로드 실패 URL or format errorURL 오류 또는 형식 문제 Check HTTPS URL, verify VRM 1.0 formatHTTPS URL 확인, VRM 1.0 형식 확인
Theme not applied테마가 적용되지 않음 Color format error색상 형식 오류 Use #RRGGBB format형식 사용
Lip sync not working립싱크 동작 안함 VRM missing blendshapesVRM에 블렌드셰이프 없음 Use ARKit-compatible VRMARKit 호환 VRM 사용
Wallet showing (companion)지갑이 표시됨 (companion) type or또는 showWallet not set미설정 "type": "companion" or또는 "showWallet": false

⚠️ Limitations제한사항

Item항목 Limit제한
VRM file sizeVRM 파일 크기 Max 50MB recommended최대 50MB 권장
Config file size설정 파일 크기 Max 100KB최대 100KB
systemPrompt lengthsystemPrompt 길이 Max 10,000 characters최대 10,000자
Polygon count폴리곤 수 Under 50,000 recommended50,000 이하 권장