AutoSprite

Assets API

Create and list game assets (props, weapons, items, effects) via the AutoSprite REST API.

Assets are static game items — weapons, props, effects, items — that can be saved to your library, animated, or turned into 3D models. Use the Assets API to programmatically generate them from prompts or upload your own.

List Assets

GET /api/v1/assets

Returns a paginated list of your assets.

Query Parameters

ParameterTypeDefaultDescription
limitnumber20Items per page (1–50)
cursorstring—Pagination cursor from previous response
folderIdstring—Filter to a specific folder

Response

{
  "assets": [
    {
      "id": "asset_abc123",
      "name": "Flaming Sword",
      "assetDescription": "A blade of pure fire",
      "folderId": "folder_xyz",
      "baseImageUrl": "https://...",
      "thumbnailUrl": "https://...",
      "createdAt": "2025-01-15T10:30:00Z"
    }
  ],
  "nextCursor": "asset_xyz789",
  "hasMore": true
}

Example

curl "https://www.autosprite.io/api/v1/assets?limit=10" \
  -H "x-api-key: vspk_your_key_here"

Create an Asset

POST /api/v1/assets

Create an asset by uploading an image or generating one from a text prompt.

Option 1: Upload Image File

Upload your own asset image. No credits required (paid plan still required).

curl -X POST https://www.autosprite.io/api/v1/assets \
  -H "x-api-key: vspk_your_key_here" \
  -F "name=Iron Shield" \
  -F "image=@./shield.png"
FieldTypeRequiredDescription
namestringYesAsset name (max 100 chars)
imageFileYesImage file (PNG, JPEG, WebP)
assetDescriptionstringNoDescription (max 200 chars)
folderIdstringNoSave into a specific asset folder
ℹ️

Use multipart/form-data content type when uploading files.

Option 2: Generate from Prompt

Generate an asset image using AI. Cost depends on the quality tier (see below).

curl -X POST https://www.autosprite.io/api/v1/assets \
  -H "x-api-key: vspk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Flaming Sword",
    "prompt": "a pixel art flaming sword with a ruby hilt"
  }'
FieldTypeRequiredDescription
namestringYesAsset name (max 100 chars)
promptstringYesDescription for AI generation (max 300 chars)
usePromptTemplatebooleanNoApply AutoSprite's "single object on white background" framing (default: true)
assetDescriptionstringNoDescription (max 200 chars)
folderIdstringNoSave into a specific asset folder
qualitystringNo"turbo" (default) or "ultra". See Quality Tiers below.
pixelArtbooleanNo16-bit pixel-art item sprite snapped to a crisp pixel grid and 32-colour palette (default: false). Always ultra (1 credit); quality and usePromptTemplate are ignored.

Quality Tiers

qualityBest forLatencyCost
turbo (default)Fast drafts~3–6s1 credit
ultraSharper detail and structure~30–60s1 credit

Use ultra when you need sharper detail, more accurate structure, or when turbo gave you a mushy result. Both modes are synchronous — the response returns once the asset is created and saved.

# Generate with ultra quality (1 credit, slower, sharper)
curl -X POST https://www.autosprite.io/api/v1/assets \
  -H "x-api-key: vspk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Flaming Sword",
    "prompt": "a detailed flaming sword with ornate gold filigree and a glowing ruby hilt",
    "quality": "ultra"
  }'

Pixel Art

Set pixelArt: true for the same result as the Pixel art toggle in the web app: a 16-bit item sprite on a white background, snapped to a crisp pixel grid and a 32-colour palette. Always rendered at ultra (1 credit).

# Generate a pixel-art asset (1 credit)
curl -X POST https://www.autosprite.io/api/v1/assets \
  -H "x-api-key: vspk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Flaming Sword",
    "prompt": "a flaming sword with a ruby hilt",
    "pixelArt": true
  }'

Response (Both Modes)

Status: 201 Created

{
  "id": "asset_abc123",
  "name": "Flaming Sword",
  "assetDescription": null,
  "folderId": "folder_default",
  "baseImageUrl": "https://...",
  "thumbnailUrl": "https://...",
  "createdAt": "2025-01-15T10:30:00Z",
  "quality": "ultra"
}

The quality field is null for uploaded assets and "turbo" or "ultra" for generated ones.

Errors

StatusCodeWhen
400MISSING_NAMEname is required
400INVALID_NAMEname exceeds 100 characters
400MISSING_PROMPTProvide prompt (JSON) or image (multipart)
400INVALID_PROMPTprompt is empty or exceeds 300 characters
400INVALID_DESCRIPTIONassetDescription exceeds 200 characters
400INVALID_QUALITYquality must be "turbo" or "ultra"
400MISSING_IMAGEMultipart upload missing the image field
402INSUFFICIENT_CREDITSNot enough credits (prompt mode only)
403PLAN_REQUIREDPaid subscription required
404FOLDER_NOT_FOUNDfolderId not found or not owned by you
409DUPLICATE_ASSETAn asset with this name already exists
✨
Pro Tip:

Need 4 turbo drafts to choose from instead of 1 saved asset? Use the MCP generate_asset_preview tool — it returns 4 temporary URLs (turbo) or 1 polished URL (ultra) without saving.