Create an Avatar
curl --request POST \
--url https://console.spatius.ai/v1/open/avatars \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-App-ID: <api-key>' \
--data '
{
"name": "Support Agent",
"imageUrl": "https://example.com/portraits/agent.png"
}
'import requests
url = "https://console.spatius.ai/v1/open/avatars"
payload = {
"name": "Support Agent",
"imageUrl": "https://example.com/portraits/agent.png"
}
headers = {
"X-App-ID": "<api-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-App-ID': '<api-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'Support Agent', imageUrl: 'https://example.com/portraits/agent.png'})
};
fetch('https://console.spatius.ai/v1/open/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://console.spatius.ai/v1/open/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Support Agent',
'imageUrl' => 'https://example.com/portraits/agent.png'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-App-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.spatius.ai/v1/open/avatars"
payload := strings.NewReader("{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-App-ID", "<api-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.spatius.ai/v1/open/avatars")
.header("X-App-ID", "<api-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.spatius.ai/v1/open/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-App-ID"] = '<api-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}"
response = http.request(request)
puts response.read_body{
"jobId": "6f1e2b3c-9a1d-4e5f-8b0a-2c4d6e8f0a1b",
"status": "queued",
"createdAt": "2026-07-25T09:30:00Z"
}{
"error": {
"code": "invalid_request",
"message": "imageUrl is required",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "insufficient_avatar_units",
"message": "There are not enough Avatar Units to create this Avatar.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "forbidden",
"message": "API Avatar creation is disabled",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Open API rate limit exceeded",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "internal_error",
"message": "An internal error occurred.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "service_unavailable",
"message": "Avatar Unit reservation failed; retry later",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}Avatars
Create an Avatar
Accepts a source image URL and queues an asynchronous Avatar creation job. Spatius downloads and validates the image, preprocesses it, and generates the Avatar through the Studio pipeline. Poll GET /avatar-jobs/{jobId} until the job reaches succeeded or failed.
The request is admitted only when your account is within its creation rate limits, rolling 24-hour quota, and concurrency limit, and holds enough Avatar Creations. A creation is reserved when the job is accepted and captured when preprocessing completes; it is released if the job fails before capture.
Source image requirements:
- Public HTTP(S) URL, reachable within 3 seconds
- JPEG or PNG, at most 5 MiB
- Shorter side at least 340 pixels
- PNG images must be fully opaque
- Exactly one clearly visible face
POST
/
avatars
Create an Avatar
curl --request POST \
--url https://console.spatius.ai/v1/open/avatars \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-App-ID: <api-key>' \
--data '
{
"name": "Support Agent",
"imageUrl": "https://example.com/portraits/agent.png"
}
'import requests
url = "https://console.spatius.ai/v1/open/avatars"
payload = {
"name": "Support Agent",
"imageUrl": "https://example.com/portraits/agent.png"
}
headers = {
"X-App-ID": "<api-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-App-ID': '<api-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'Support Agent', imageUrl: 'https://example.com/portraits/agent.png'})
};
fetch('https://console.spatius.ai/v1/open/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://console.spatius.ai/v1/open/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Support Agent',
'imageUrl' => 'https://example.com/portraits/agent.png'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-App-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.spatius.ai/v1/open/avatars"
payload := strings.NewReader("{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-App-ID", "<api-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.spatius.ai/v1/open/avatars")
.header("X-App-ID", "<api-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.spatius.ai/v1/open/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-App-ID"] = '<api-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Support Agent\",\n \"imageUrl\": \"https://example.com/portraits/agent.png\"\n}"
response = http.request(request)
puts response.read_body{
"jobId": "6f1e2b3c-9a1d-4e5f-8b0a-2c4d6e8f0a1b",
"status": "queued",
"createdAt": "2026-07-25T09:30:00Z"
}{
"error": {
"code": "invalid_request",
"message": "imageUrl is required",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "insufficient_avatar_units",
"message": "There are not enough Avatar Units to create this Avatar.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "forbidden",
"message": "API Avatar creation is disabled",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Open API rate limit exceeded",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "internal_error",
"message": "An internal error occurred.",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "service_unavailable",
"message": "Avatar Unit reservation failed; retry later",
"requestId": "b3f0c2d1-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
}Authorizations
Your Spatius App ID.
The API key bound to the App ID.
Body
application/json

