Avatar handle with a hyphen is rejected: the valid pattern
Sume avatar handles allow letters, digits, periods and underscores, 2 to 30 characters. A hyphen fails the pattern. Check yours in Python first.
An avatar handle such as product-host does not match the pattern in the Sume OpenAPI: only letters, digits, periods and underscores are allowed, 2 to 30 characters, and a period or underscore cannot be first, last or doubled. Use product_host instead. A leading @ is optional: Sume lowercases the handle and stores it without the @.
What the pattern accepts
The Avatar 1.0 create route (POST /v1/avatar-1.0/generate) takes a top-level avatar_handle. The OpenAPI pattern for face swap and TTS is the same grammar: ^@?(?![._])(?!.*[._]$)(?!.*[._]{2})[A-Za-z0-9._]{2,30}$. The table runs ten candidates through that regex.
| Candidate | Result | Reason or stored form |
|---|---|---|
| product_host | accepted | stored as product_host |
| product-host | rejected | hyphen is not in the allowed set |
| @Product.Host | accepted | stored as product.host |
| brand..host | rejected | consecutive periods |
| .host | rejected | starts with a period or underscore |
| host_ | rejected | ends with a period or underscore |
| a | rejected | shorter than 2 characters |
| sume_clawra | accepted | stored as sume_clawra |
| host.v2 | accepted | stored as host.v2 |
| xxxxxx... (31 x's) | rejected | longer than 30 characters |
Check handles before you submit
Add a local check in your import script so a bad handle fails in your code and not in a batch of 200 creates. The pattern is the one from the docs; keep it in sync if the OpenAPI changes.
import re
HANDLE = re.compile(r"^@?(?![._])(?!.*[._]$)(?!.*[._]{2})[A-Za-z0-9._]{2,30}$")
def to_handle(name: str) -> str:
"""Turn a brand name into a legal handle, or raise."""
cand = re.sub(r"[^A-Za-z0-9._]+", "_", name.strip()).strip("._")
cand = re.sub(r"[._]{2,}", "_", cand)
if not HANDLE.match(cand):
raise ValueError(f"no legal handle for {name!r}")
return cand.lower()
print(to_handle("Product Host")) # product_host
print(to_handle("brand-host.v2")) # brand_host.v2Limits and gotchas
- The handle is the name you reuse later in
avatar_handleon talking videos, so pick one you will not want to change. - Handles must be normalized by you if you compare them:
@Product.Hostandproduct.hostare the same avatar. - The same grammar applies when you pass
avatar_handleto TTS or face swap, so one validator covers all three. - Creating the avatar is a fixed per-avatar price, listed in
GET /v1/catalog.
Sources
Related posts
More in Sume Avatar 1.0
- A 37-second AI avatar video: six Sume prices from $6.81 to $21.46
What a 37-second talking avatar video costs on Sume at standard, plus and max, with and without a product image, worked per second.
- A 47-second Avatar 1.0 video: $8.65 standard, $11.52 plus, $25.85 max
A 47-second Sume Avatar 1.0 talking video costs about $8.65 at standard, $11.52 at plus and $25.85 at max ($0.184, $0.245, $0.55 per second).
- A 22-second avatar video with a product image: $4.27, $5.68 or $12.76
A 22-second Sume Avatar 1.0 video with a product_image costs 22 x $0.194 = $4.27 at standard, 22 x $0.258 = $5.68 at plus and 22 x $0.58 = $12.76 at max.
- Can Sume Avatar 1.0 speak Spanish? English only, and what to do
Sume Avatar 1.0 speaks English only. Here are its documented limits, plus where to look when your viewers need Spanish or another language for the same ad.
Written by Sume