Integrate GenSprite into your pipeline
The GenSprite API lets you generate sprites, textures, concept art, rotations, and animations programmatically. All endpoints use JSON requests/responses and require API key authentication.
https://gensprite.aiAPI key via Bearer token
All API requests require an API key passed in the Authorization header.
Generate a key from your Dashboard.
Authorization: Bearer gsk_your_api_keygsk_. Keys are shown once on creation — store them securely.
You can revoke and regenerate keys from the Dashboard at any time.The API returns standard HTTP status codes. Error responses include a JSON body with a message field.
| Status | Meaning |
|---|---|
400 | Bad request — invalid or missing parameters |
401 | Unauthorized — missing or invalid API key |
402 | Insufficient tokens |
404 | Resource not found |
429 | Rate limited |
500 | Internal server error |
Tokens are deducted before generation, refunded on failure
/api/agent/configFetch platform configuration for the GenSprite agent. Returns the Anthropic API key (platform-owned, not user-facing), model settings, and the user's current credit balance. Rate limited to 1 request per minute per key.
{
"anthropic_api_key": "sk-ant-...",
"model": "claude-opus-4-5",
"max_tokens": 8096,
"user_id": "abc123",
"credits": 142
}/api/billingGet your current token balance and pricing information.
{
"tokens": 47,
"bonusTokens": 95,
"totalTokens": 142,
"tokenCosts": {
"sprite": 3,
"texture": 4,
"rotation": 25,
"rotationNew": 12,
"conceptArt": 4,
"conceptArtRestyle": 6,
"spin": 25,
"rotationSingleView": 7
}
}/api/assets/generateGenerate a game sprite with transparent background. Costs 3 tokens.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the sprite (max 2000 chars) |
style | string | No | hand-painted, anime, cartoon, realistic, vector, outline |
width | number | No | Image width in px (default: 512) |
height | number | No | Image height in px (default: 512) |
seed | number | No | Seed for reproducibility |
curl -X POST https://gensprite.ai/api/assets/generate \
-H "Authorization: Bearer gsk_your_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "medieval knight with sword", "style": "hand-painted"}'{
"asset": {
"id": "abc123",
"visibleId": "xK9mQ2",
"status": "pending",
"prompt": "medieval knight with sword",
"width": 512,
"height": 512,
"tokenCost": 3,
"createdAt": "2026-03-09T12:00:00.000Z"
},
"isGuest": false,
"tokensUsed": 3,
"tokensRemaining": 44,
"bonusTokensRemaining": 95,
"totalTokensRemaining": 139
}/api/assets/{id}/statusPoll the status of a sprite generation. When status is "completed", the image URLs are in resultUrls.
Poll every 2–5 seconds.
{
"id": "abc123",
"status": "completed",
"progress": 100,
"resultUrls": {
"raw": "https://...",
"processed": "https://..."
},
"seed": 4281937,
"completedAt": "2026-03-09T12:00:30.000Z"
}status values: pending → processing → completed | failed/api/assets/{id}/cancelCancel an in-progress sprite generation. Tokens are automatically refunded if the generation hasn't completed.
{
"success": true,
"tokensRefunded": 3
}/api/assetsList your generated sprites with cursor-based pagination.
| Field | Type | Default | Description |
|---|---|---|---|
cursor | string | — | Asset ID to paginate from |
limit | number | 20 | Results per page (max 50) |
{
"assets": [ ... ],
"nextCursor": "xyz789"
}/api/textures/generateGenerate a PBR texture set (basecolor, normal, roughness, metallic maps). Costs 4 tokens.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the texture (max 2000 chars) |
Use GET /api/textures/{id}/status and POST /api/textures/{id}/cancel.
Completed textures include basecolorUrl, normalUrl, roughnessUrl, metallicUrl.
/api/concept-art/generateGenerate full-scene concept art. Costs 4 tokens (standard) or 6 tokens (restyle).
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Scene description (max 2000 chars) |
imageSize | string | No | landscape_16_9, landscape_4_3, square_hd, portrait_4_3, portrait_16_9 |
style | string | No | painterly, anime, realistic, pixel-art, watercolor, sci-fi, fantasy, ink-drawing |
seed | number | No | Seed for reproducibility |
For restyle mode, use multipart/form-data with a compositionImage file, mode=restyle, controlMethod (canny | depth), and controlStrength (0–100).
Use GET /api/concept-art/{id}/status and POST /api/concept-art/{id}/cancel.
Completed result includes imageUrl.
/api/rotate/generateGenerate 8-directional rotations from an input image. Costs 25 tokens.
Accepts multipart/form-data (file upload) or JSON (image URL).
| Field | Type | Required | Description |
|---|---|---|---|
image | File | * | Image file (PNG/JPEG/WebP, max 10MB) |
imageUrl | string | * | URL of existing image (* provide image or imageUrl) |
elevation | number | No | Camera elevation angle, -90 to 90 (default: 0) |
prompt | string | No | Optional description |
Use GET /api/rotate/{id}/status and POST /api/rotate/{id}/cancel.
Completed result includes rotationN, rotationNE, rotationE, etc. (8 direction URLs).
/api/rotate-new/generateGenerate 4-directional rotations (front, right, back, left). Costs 12 tokens. Same request format as 8-dir rotation.
Use GET /api/rotate-new/{id}/status and POST /api/rotate-new/{id}/cancel.
Completed result includes rotationFront, rotationRight, rotationBack, rotationLeft.
/api/animate/generateGenerate frame-by-frame sprite animation with multi-direction support. Token cost varies by animation type and direction count.
Uses multipart/form-data.
| Field | Type | Required | Description |
|---|---|---|---|
animationType | string | No | walk, run, idle, attack (default: run) |
elevation | string | No | side, low, iso, iso45, topdown (default: iso) |
directionCount | number | No | 4 or 8 (default: 4) |
image_{dir} | File | * | Image per direction (e.g. image_S, image_NE) |
imageUrl_{dir} | string | * | URL per direction (* provide at least one direction) |
S, W, N, E.
8-dir directions: S, SW, W, NW, N, NE, E, SE.Use GET /api/animate/{id}/status and POST /api/animate/{id}/cancel.
Completed result includes spritesheetUrl, frameCount, tileWidth, tileHeight.
Generate → Poll → Download
id with status "pending".status to reach "completed" or "failed".# 1. Generate a sprite
RESPONSE=$(curl -s -X POST https://gensprite.ai/api/assets/generate \
-H "Authorization: Bearer gsk_your_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "fire elemental monster", "style": "anime"}')
ASSET_ID=$(echo $RESPONSE | jq -r '.asset.id')
# 2. Poll until complete
while true; do
STATUS=$(curl -s \
-H "Authorization: Bearer gsk_your_key" \
https://gensprite.ai/api/assets/$ASSET_ID/status)
STATE=$(echo $STATUS | jq -r '.status')
echo "Status: $STATE"
if [ "$STATE" = "completed" ]; then
IMAGE_URL=$(echo $STATUS | jq -r '.resultUrls.processed')
echo "Done! $IMAGE_URL"
break
elif [ "$STATE" = "failed" ]; then
echo "Failed: $(echo $STATUS | jq -r '.errorMessage')"
break
fi
sleep 3
done
# 3. Download the image
curl -o sprite.png "$IMAGE_URL"