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
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Items per page (1–50) |
cursor | string | — | Pagination cursor from previous response |
folderId | string | — | 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"
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Asset name (max 100 chars) |
image | File | Yes | Image file (PNG, JPEG, WebP) |
assetDescription | string | No | Description (max 200 chars) |
folderId | string | No | Save 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"
}'
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Asset name (max 100 chars) |
prompt | string | Yes | Description for AI generation (max 300 chars) |
usePromptTemplate | boolean | No | Apply AutoSprite's "single object on white background" framing (default: true) |
assetDescription | string | No | Description (max 200 chars) |
folderId | string | No | Save into a specific asset folder |
quality | string | No | "turbo" (default) or "ultra". See Quality Tiers below. |
pixelArt | boolean | No | 16-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
quality | Best for | Latency | Cost |
|---|---|---|---|
turbo (default) | Fast drafts | ~3–6s | 1 credit |
ultra | Sharper detail and structure | ~30–60s | 1 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
| Status | Code | When |
|---|---|---|
| 400 | MISSING_NAME | name is required |
| 400 | INVALID_NAME | name exceeds 100 characters |
| 400 | MISSING_PROMPT | Provide prompt (JSON) or image (multipart) |
| 400 | INVALID_PROMPT | prompt is empty or exceeds 300 characters |
| 400 | INVALID_DESCRIPTION | assetDescription exceeds 200 characters |
| 400 | INVALID_QUALITY | quality must be "turbo" or "ultra" |
| 400 | MISSING_IMAGE | Multipart upload missing the image field |
| 402 | INSUFFICIENT_CREDITS | Not enough credits (prompt mode only) |
| 403 | PLAN_REQUIRED | Paid subscription required |
| 404 | FOLDER_NOT_FOUND | folderId not found or not owned by you |
| 409 | DUPLICATE_ASSET | An asset with this name already exists |
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.
