AutoSprite

Quick Start

End-to-end walkthrough — upload a character, generate an animation, download the spritesheet, and regenerate with different settings.

End-to-end walkthrough — upload a character image, generate a custom animation, download the result, then regenerate with different settings.

Upload a Character

Upload an existing character image as multipart form data:

curl -X POST https://www.autosprite.io/api/v1/characters \
  -H "x-api-key: vspk_your_key_here" \
  -F "name=Pixel Knight" \
  -F "image=@knight.png" \
  -F "isHumanoid=true" \
  -F "characterDescription=A knight with silver armor"
{
  "id": "char_abc123",
  "name": "Pixel Knight",
  "isHumanoid": true,
  "baseImageUrl": "https://...",
  "thumbnailUrl": "https://...",
  "createdAt": "2025-01-15T10:30:00Z"
}

Save the id — you'll need it for all subsequent calls.

Generate an Animation

Create a custom attack animation. Defaults: 25 frames, 256×256, standard background removal.

curl -X POST https://www.autosprite.io/api/v1/characters/char_abc123/spritesheets \
  -H "x-api-key: vspk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "animations": [
      {
        "kind": "custom",
        "prompt": "Sword slash attack, swings weapon from overhead",
        "name": "Sword Attack"
      }
    ],
    "frameCount": 25,
    "frameSize": 256
  }'
{
  "characterId": "char_abc123",
  "workflows": [
    { "jobId": "job_001", "kind": "custom", "videoId": "vid_001" }
  ],
  "creditsUsed": 5
}

Poll for Completion

Animations take 30–90 seconds. Poll the job until status is succeeded or failed:

curl https://www.autosprite.io/api/v1/jobs/job_001 \
  -H "x-api-key: vspk_your_key_here"
{
  "jobId": "job_001",
  "status": "succeeded",
  "characterId": "char_abc123",
  "spritesheetIds": ["ss_001"],
  "completedAt": "2025-01-15T10:32:00Z"
}
ℹ️

Poll every 5 seconds. The status progresses through queued → running → succeeded / failed.

Download the Spritesheet

Fetch spritesheet details including download URLs:

curl https://www.autosprite.io/api/v1/spritesheets/ss_001 \
  -H "x-api-key: vspk_your_key_here"
{
  "id": "ss_001",
  "kind": "custom",
  "frameWidth": 256,
  "frameHeight": 256,
  "frameCount": 25,
  "columns": 5,
  "sheetUrl": "https://...",
  "atlasUrl": "https://...",
  "createdAt": "2025-01-15T10:32:00Z"
}

Download the spritesheet PNG and atlas JSON using the URLs from the response:

# Use the sheetUrl and atlasUrl from the response above
curl -o knight-attack.png "https://your-sheetUrl-here"
curl -o knight-attack.json "https://your-atlasUrl-here"

Regenerate with Different Settings

Not happy with the result? Regenerate the same animation with more frames, higher resolution, or better background removal — at no extra credit cost:

curl -X POST https://www.autosprite.io/api/v1/spritesheets/ss_001/regenerate \
  -H "x-api-key: vspk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "frameCount": 49,
    "frameSize": 256,
    "removeBg": "ultra"
  }'
{
  "jobId": "job_002"
}

Poll job_002 the same way as Step 3. The new spritesheet replaces the old one with 49 frames and ultra-quality background removal — at no credit cost.

✨
Pro Tip:

Use the atlas JSON file for easy import into Unity, Godot, Phaser, and other engines. It contains frame positions and dimensions for each animation frame.