Skip to content

Save Avatar

POST
/api/v1/avatar

Create and save a new persistent avatar. You can create an avatar by providing either a previously generated image or an external avatar image URL.

Image Source (Required - choose one):

  • generation_result_id - ID of a previously generated image result to use for creating the avatar
  • avatar_url - External URL of an avatar image

Avatar Information:

  • avatar_name - A user-friendly name for your avatar

Avatar Description (Optional):

  • avatar_description.body - Physical description like "athletic male", "curvy female", etc.
  • avatar_description.age - Age in years (e.g., 20, 35)

Enhancement Options:

  • avatar_enhancement - Set to true to use AI vision to automatically generate body description and age from the image. This is useful when you don't have access to detailed avatar information or when your use case doesn't allow manual specification. Note: AI enhancement works well for average body types but may be less reliable for extreme cases. If both manual description and enhancement are provided, the AI-generated description will overwrite your manual input.

Authorizations

HTTPBearer
TypeHTTP (bearer)

Request Body

JSON
{
"avatar_name": "",
"generation_result_id": 0,
"avatar_url": "",
"avatar_description": {
"body": "",
"age": 0
},
"avatar_enhancement": true
}

Responses

Successful Response
application/json
JSON
{
"avatar_id": 0,
"avatar_name": "string",
"avatar_url": "string",
"avatar_description": {
"body": "",
"age": 0
},
"count_generation_results": 0,
"generation_result_id": 0,
"created_at": "string",
"updated_at": "string"
}

Samples

cURL
curl -X POST \
'https://api.uwear.ai/api/v1/avatar' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.uwear.ai/api/v1/avatar', {method:'POST',headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.uwear.ai/api/v1/avatar';
$method = 'POST';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.uwear.ai/api/v1/avatar'

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers)
print(response.json())
Powered by VitePress OpenAPI