Create Character
curl --request POST \
--url https://apis.viggle.ai/api/characters/preprocess \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'name=My Character' \
--form image='@example-file' \
--form image_url=https://example.com/character.png \
--form model=V3_Previewimport requests
url = "https://apis.viggle.ai/api/characters/preprocess"
files = { "image": ("example-file", open("example-file", "rb")) }
payload = {
"name": "My Character",
"image_url": "https://example.com/character.png",
"model": "V3_Preview"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', 'My Character');
form.append('image', '<string>');
form.append('image_url', 'https://example.com/character.png');
form.append('model', 'V3_Preview');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://apis.viggle.ai/api/characters/preprocess', 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/api/characters/preprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://apis.viggle.ai/api/characters/preprocess"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/api/characters/preprocess")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.viggle.ai/api/characters/preprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"job_id": "char_550e8400e29b",
"status": "pending",
"credits_reserved": 1,
"message": "Character preprocessing initiated. Check status for updates."
}{
"detail": {
"error_code": "CS-UORC01-002",
"message": "Invalid image. Upload a PNG, JPG, or WebP file."
}
}{
"detail": "Invalid or missing API key. Pass it as Authorization: Bearer sk-..."
}{
"detail": {
"error_code": "CS-UORC01-008",
"message": "Insufficient credits. Top up your balance to continue."
}
}Characters
Create Character
Upload a reference image to create a reusable character
POST
/
api
/
characters
/
preprocess
Create Character
curl --request POST \
--url https://apis.viggle.ai/api/characters/preprocess \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'name=My Character' \
--form image='@example-file' \
--form image_url=https://example.com/character.png \
--form model=V3_Previewimport requests
url = "https://apis.viggle.ai/api/characters/preprocess"
files = { "image": ("example-file", open("example-file", "rb")) }
payload = {
"name": "My Character",
"image_url": "https://example.com/character.png",
"model": "V3_Preview"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', 'My Character');
form.append('image', '<string>');
form.append('image_url', 'https://example.com/character.png');
form.append('model', 'V3_Preview');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://apis.viggle.ai/api/characters/preprocess', 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/api/characters/preprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://apis.viggle.ai/api/characters/preprocess"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/api/characters/preprocess")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.viggle.ai/api/characters/preprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nMy Character\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/character.png\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nV3_Preview\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"job_id": "char_550e8400e29b",
"status": "pending",
"credits_reserved": 1,
"message": "Character preprocessing initiated. Check status for updates."
}{
"detail": {
"error_code": "CS-UORC01-002",
"message": "Invalid image. Upload a PNG, JPG, or WebP file."
}
}{
"detail": "Invalid or missing API key. Pass it as Authorization: Bearer sk-..."
}{
"detail": {
"error_code": "CS-UORC01-008",
"message": "Insufficient credits. Top up your balance to continue."
}
}Upload a reference image and we’ll turn it into a reusable character. Processing happens in the background, and it costs 1 credit.
Use
model to pick which model to preprocess for (V3_Preview or V4_Preview, default V3_Preview). One thing to know: a character only works with the model it was built for — so if you want to use the same image with both, just create two separate characters.
Model binding: A character preprocessed with
V4_Preview can only be used in V4_Preview renders, and vice versa. Check has_v4_encoding / has_v3_encoding in the status response to confirm which model is ready.You’ll get the best results from clear, well-lit, front-facing photos at a decent resolution.
Parameters
Send asmultipart/form-data. Provide the image either as a file (image) or a URL (image_url).
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Display name for the character. |
image | file | Reference image file (PNG, JPG, WebP). Use this or image_url. | |
image_url | string | URL to a character image; the server fetches it. Use instead of image. | |
model | string | V3_Preview (default) or V4_Preview. The character can only be rendered with the same model. |
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"job_id": "char_550e8400e29b",
"status": "pending",
"credits_reserved": 1.0,
"message": "Character preprocessing initiated. Check status for updates."
}
| Field | Description |
|---|---|
id | Character UUID. Poll Get Character with it, then use it as character_id when rendering. |
status | Starts at pending. Preprocessing runs in the background. |
credits_reserved | Credits held for this character (1). Settled on success, refunded on failure. |
Example
import requests
url = "https://apis.viggle.ai/api/characters/preprocess"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
files = {
"image": ("character.png", open("character.png", "rb"), "image/png"),
}
data = {
"name": "My Character",
"model": "V3_Preview", # or "V4_Preview"
}
response = requests.post(url, headers=headers, files=files, data=data)
response.raise_for_status()
result = response.json()
print(f"Character ID: {result['id']}")
print(f"Status: {result['status']}")
const form = new FormData();
form.append("image", new Blob([await fetch("character.png").then(r => r.blob())]), "character.png");
form.append("name", "My Character");
form.append("model", "V3_Preview"); // or "V4_Preview"
const response = await fetch("https://apis.viggle.ai/api/characters/preprocess", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
},
body: form,
});
const result = await response.json();
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(`Character ID: ${result.id}`);
console.log(`Status: ${result.status}`);
curl -X POST https://apis.viggle.ai/api/characters/preprocess \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "name=My Character" \
-F "model=V3_Preview"
Next Steps
After creating a character, poll Get Character every 5 seconds untilstatus is ready and has_v4_encoding (or has_v3_encoding) is true. Then you can use it in render jobs.Authorizations
API key passed as Bearer token
Body
multipart/form-data
Display name for the character
Example:
"My Character"
Reference image file (PNG, JPG, WebP). Use this or image_url.
URL to a character image. Server fetches it. Use instead of image file upload.
Example:
"https://example.com/character.png"
Model to preprocess the character for. The character can only be used in renders with the same model. Defaults to V3_Preview.
Available options:
V4_Preview, V3_Preview ⌘I

