Create Avatar
curl --request POST \
--url https://apis.viggle.ai/v1/avatars \
--header 'Authorization: Bearer <token>'import requests
url = "https://apis.viggle.ai/v1/avatars"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apis.viggle.ai/v1/avatars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apis.viggle.ai/v1/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apis.viggle.ai/v1/avatars"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apis.viggle.ai/v1/avatars")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.viggle.ai/v1/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body3D Conversion
Create Avatar
Create an asynchronous image-to-3D conversion.
POST
/
v1
/
avatars
Create Avatar
curl --request POST \
--url https://apis.viggle.ai/v1/avatars \
--header 'Authorization: Bearer <token>'import requests
url = "https://apis.viggle.ai/v1/avatars"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apis.viggle.ai/v1/avatars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apis.viggle.ai/v1/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apis.viggle.ai/v1/avatars"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apis.viggle.ai/v1/avatars")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.viggle.ai/v1/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPOST /v1/avatars starts a 3D Avatar conversion. This is a conversion operation, not a reusable Character asset.
Request parameters
Sendmultipart/form-data.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | file | Yes | — | Image used to generate the 3D Avatar. |
Response parameters
Returns200 OK with a conversion object.
| Field | Type | Always present | Description |
|---|---|---|---|
id | string | Yes | Public Avatar ID beginning with avatar_. |
status | string | Yes | queued, processing, ready, or failed. |
model_url | string or null | Yes | Downloadable 3D result when ready. |
created_at | string or null | Yes | ISO 8601 creation timestamp when available. |
updated_at | string or null | Yes | ISO 8601 most-recent update timestamp when available. |
error | object or null | Yes | Structured failure details when status is failed. |
{"id":"avatar_123abc","status":"queued","model_url":null,"created_at":null,"updated_at":null,"error":null}
Examples
file, err := os.Open("character.png")
if err != nil { panic(err) }
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("image", "character.png")
io.Copy(part, file)
writer.Close()
req, _ := http.NewRequest("POST", "https://apis.viggle.ai/v1/avatars", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("VIGGLE_API_KEY"))
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
const form = new FormData();
form.append("image", imageFile);
const response = await fetch("https://apis.viggle.ai/v1/avatars", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.VIGGLE_API_KEY}` },
body: form,
});
const avatar = await response.json();
import os
import requests
with open("character.png", "rb") as image:
response = requests.post(
"https://apis.viggle.ai/v1/avatars",
headers={"Authorization": f"Bearer {os.environ['VIGGLE_API_KEY']}"},
files={"image": image},
)
response.raise_for_status()
avatar = response.json()
curl -X POST "https://apis.viggle.ai/v1/avatars" \
-H "Authorization: Bearer $VIGGLE_API_KEY" \
-F "[email protected]"
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
200
Avatar
⌘I

