Skip to main content

Character Overlay V2

Purpose

Overlays character images onto a sprite sheet to generate a new sprite. Used when compositing characters onto a background sprite sheet.

Method and Path

POST /public/v1/sprite/character-overlay/v2

Authentication

See the Authentication page. Bearer token is required.

Required Headers:

Authorization: Bearer {your_api_key}

Request Fields

Field NameTypeRequiredDescription
sprite_sheetfileYesSprite sheet image file to serve as the reference
character_imagesfile[]YesCharacter image files to overlay. 1 to 4 files can be uploaded
rowsstringYesJSON string containing row information. Each row must include row, title, and description
qualitystringYesQuality. Possible values: standard, pro
stylestringNoStyle specification (optional). Possible values: pixel, cartoon, sd, quater_view

Response

Success Response (200 OK):

{
"job_id": "uuid-string"
}
FieldTypeDescription
job_idstringUnique identifier for the created job. Use Get Job Status to retrieve results

Error / Validation Rules

ConditionHTTP StatusError Message
Invalid image file400"Invalid image file"
character_images is less than 1 or more than 4400"character_images must contain between 1 and 4 files"
character_images field is missing422Field required
rows is not valid JSON400"rows must be a valid JSON list"
rows is not a list400"rows must be a JSON list"
Row missing required keys400"each row must be an object with row, title, description"
row is not an integer400"row must be an integer"
title or description is not a string400"title and description must be strings"
quality value is invalid422Values other than standard, pro will result in validation error
Authentication failed401Invalid API key

rows JSON Format:

[
{
"row": 1,
"title": "Idle",
"description": "Character standing still"
},
{
"row": 2,
"title": "Walk",
"description": "Character walking animation"
}
]

Async Job Behavior

This endpoint creates an asynchronous job. It immediately returns a job_id, and actual overlay processing occurs in the background.

Polling Method:

  1. Save the job_id received in the response
  2. Poll GET /public/v1/job/{job_id} to check status
  3. When status becomes Succeed, check results in image_urls

Status Flow: PendingSucceed or Failed

Example Request

cURL (Single Character):

curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/character-overlay/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "sprite_sheet=@/path/to/background_sprite.png" \
-F "character_images=@/path/to/character.png" \
-F 'rows=[{"row":1,"title":"Idle","description":"Standing"},{"row":2,"title":"Walk","description":"Walking"}]' \
-F "quality=standard"

cURL (Multiple Characters):

curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/character-overlay/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "sprite_sheet=@/path/to/background_sprite.png" \
-F "character_images=@/path/to/char1.png" \
-F "character_images=@/path/to/char2.png" \
-F "character_images=@/path/to/char3.png" \
-F 'rows=[{"row":1,"title":"Scene1","description":"First scene"},{"row":2,"title":"Scene2","description":"Second scene"}]' \
-F "quality=pro" \
-F "style=pixel"