Skip to main content

Create Avatars

FIXME: Enable this lock when the slots feature is up running and the slots are being consumed if slots.has_exhausted(): raise HTTPException( status_code=status.HTTP_406_NOT_ACCEPTABLE, detail="You have reached the maximum number of avatars", )

Request Body required
    name Name required
    output_format object
    style object
    img Img
    head object
    name Name required
    output_format OutputFormats

    Possible values: [glb, fbx, vrm, usdz]

    Default value: glb

    style AssetStyles

    Possible values: [phr, vox, sca, crt]

    Default value: phr

    version HeadVersion

    Possible values: [v1, v2, v3]

    Default value: v2

    selfie_img binary required
    hair_id Hair Id
    hair_color object
    use_lod Use Lod

    Default value: false

    When sending lod=True we're gonna generate your avatar with different level of detail, but process will take longer

    create_ar Create Ar

    Default value: false

    head_id Head Id
    outfit_id uuid required
    create_thumbnail Create Thumbnail

    Default value: false

    optimize Optimize

    Default value: false

    Only available for .glb files. You need to load KHR_mesh_quantization EXT_meshopt_compression, KHR_texture_transform extensions in your environment to be able to use optimized avatars.

    use_lod Use Lod

    Default value: false

    When sending lod=True we're gonna generate your avatar with different level of detail, but process will take longer

    atlas Atlas

    Default value: false

    It will generate a Color and Normal Atlas of all the avatar's textures. It will also merge all the meshes (except the head)

    create_vrm Create Vrm

    Default value: false

Responses

Successful Response


Schema
    name Name required
    output_format object
    style object
    id uuid required
    url uri required

    Possible values: non-empty

    source_type SourceTypes required

    Possible values: [custom, default, exclusive, payable, promotion, designed, external, assembled, generated]

    created_at date-time required
    updated_at date-time required
    thumbnail_url Thumbnail Url
    outfit_id Outfit Id
    head_id Head Id
    lod object
    vrm_url Vrm Url
    vrm_updated_at Vrm Updated At
    usdz_url Usdz Url
    usdz_updated_at Usdz Updated At
    halfbody_url Halfbody Url
    facial_exp object
    nft_url Nft Url
    armature_rest_pose Armature Rest Pose
    facial_morph_system Facial Morph System
    provider Provider
POST /avatars

Authorization

name: OAuth2PasswordBearertype: oauth2flows: {
  "password": {
    "scopes": {},
    "tokenUrl": "login"
  }
}

Request

Base URL
https://api.unionavatars.com/v2
Security Scheme
Bearer Token
Body required
{
"name": "string",
"output_format": "glb",
"style": "phr",
"img": "string",
"head": {
"name": "string",
"output_format": "glb",
"style": "phr",
"version": "v2",
"selfie_img": "string",
"hair_id": "string",
"hair_color": {},
"use_lod": false,
"create_ar": false
},
"head_id": "string",
"outfit_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"create_thumbnail": false,
"optimize": false,
"use_lod": false,
"atlas": false,
"create_vrm": false
}
curl -L -X POST 'https://api.unionavatars.com/v2/avatars' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
  "name": "string",
  "output_format": "glb",
  "style": "phr",
  "img": "string",
  "head": {
    "name": "string",
    "output_format": "glb",
    "style": "phr",
    "version": "v2",
    "selfie_img": "string",
    "hair_id": "string",
    "hair_color": {},
    "use_lod": false,
    "create_ar": false
  },
  "head_id": "string",
  "outfit_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "create_thumbnail": false,
  "optimize": false,
  "use_lod": false,
  "atlas": false,
  "create_vrm": false
}'