{"openapi":"3.1.0","info":{"title":"Sprite AI API","version":"1.0.0","summary":"Generate game-ready pixel art sprites, animations and 8-direction rotations from text.","description":"REST API for Sprite AI. Generate pixel art sprites from a text prompt, animate them into sprite sheets, rotate them to 8 directions, restyle, combine, touch up, make normal maps and remove backgrounds. Every call takes a bearer key from your account page. Images come back inline as base64 PNG.","contact":{"name":"Sprite AI","url":"https://www.sprite-ai.art/contact"},"termsOfService":"https://www.sprite-ai.art/terms","x-logo":{"url":"https://www.sprite-ai.art/apple-touch-icon.png"}},"externalDocs":{"description":"API reference","url":"https://www.sprite-ai.art/docs/api-reference"},"servers":[{"url":"https://www.sprite-ai.art"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Account","description":"Your account, balance and limits."},{"name":"Sprites","description":"Generate, import and list sprites."},{"name":"Palettes","description":"Propose and save color palettes."},{"name":"Animations","description":"Animate a sprite into a sprite sheet."},{"name":"Restyles","description":"Change a sprite and keep the character."},{"name":"Combines","description":"Put an item from one sprite into another."},{"name":"Edits","description":"Touch-ups, rotations, normal maps and background removal."}],"paths":{"/api/me":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Get your account","description":"Your plan, token balance and rate limit.","parameters":[],"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/balance":{"get":{"operationId":"getBalance","tags":["Account"],"summary":"Get your token balance","description":"Token balance only, a subset of /api/me.","parameters":[],"responses":{"200":{"description":"The balance.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/asset-types":{"get":{"operationId":"listAssetTypes","tags":["Account"],"summary":"List asset types","description":"The asset types the generator supports, with the token cost and recommended size range for each.","parameters":[],"responses":{"200":{"description":"The asset types.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/limits":{"get":{"operationId":"getLimits","tags":["Account"],"summary":"Get request limits","description":"Request bounds and token costs for your key.","parameters":[],"responses":{"200":{"description":"The limits.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/sprites":{"post":{"operationId":"generateSprite","tags":["Sprites"],"summary":"Generate a sprite","description":"Generate a still pixel art sprite from a text prompt. Synchronous: the PNG comes back inline as base64 in image.pngBase64. Costs 1 token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":1500},"width":{"default":64,"type":"integer","minimum":32,"maximum":400},"height":{"default":64,"type":"integer","minimum":32,"maximum":400},"asset_type":{"type":"string","enum":["character","creature","prop","weapon","vehicle","tile","background","ui","effect","item"]},"direction":{"type":"string","enum":["none","south","south-west","west","north-west","north","north-east","east","south-east"]},"camera_perspective":{"type":"string","enum":["none","front","side","top_down","three_quarter","isometric"]},"public":{"default":false,"type":"boolean"},"reference_asset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"palette_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["prompt"]}}}},"responses":{"201":{"description":"The generated sprite, with the PNG inline.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}},"get":{"operationId":"listSprites","tags":["Sprites"],"summary":"List your sprites","description":"Your sprites and animations, newest first.","parameters":[{"name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Page size.","in":"query","required":false},{"name":"offset","schema":{"type":"integer","minimum":0,"default":0},"description":"Items to skip, for pagination.","in":"query","required":false},{"name":"status","schema":{"type":"string"},"description":"Filter by status.","in":"query","required":false},{"name":"asset_type","schema":{"type":"string"},"description":"Filter by asset type, e.g. animation.","in":"query","required":false}],"responses":{"200":{"description":"A page of sprites.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/sprites/import":{"post":{"operationId":"importSprite","tags":["Sprites"],"summary":"Import a sprite","description":"Add a sprite you already have and get back an id you can animate or use as a style reference. Free: no tokens, no AI. A single PNG, JPEG or WebP sprite, 16 to 256 px per side, not a sprite sheet.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","minLength":1},"title":{"type":"string","maxLength":200},"asset_type":{"type":"string","enum":["character","creature","prop","weapon","vehicle","tile","background","ui","effect","item"]},"palette_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["image"]}}}},"responses":{"201":{"description":"The imported sprite id.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/sprites/{id}":{"get":{"operationId":"getSprite","tags":["Sprites"],"summary":"Get a sprite","description":"Fetch one of your sprites.","parameters":[{"name":"id","in":"path","required":true,"description":"The sprite id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The sprite.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/palettes/generate":{"post":{"operationId":"generatePalettes","tags":["Palettes"],"summary":"Propose palettes","description":"A few palette options for a description, nothing saved. Save the pick with POST /api/palettes. Free.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":200},"count":{"type":"integer","minimum":4,"maximum":64},"options":{"type":"integer","minimum":2,"maximum":4}},"required":["prompt"]}}}},"responses":{"200":{"description":"The palette options.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/palettes":{"post":{"operationId":"savePalette","tags":["Palettes"],"summary":"Save a palette","description":"Save a palette from a recipe returned by /api/palettes/generate, or from explicit colors. The returned id is the palette_id for sprite generation and import. Free.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"recipe":{"type":"object","properties":{"count":{"type":"integer","minimum":4,"maximum":64},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"primary":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"moods":{"maxItems":4,"type":"array","items":{"type":"string","maxLength":32}},"hueShift":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"focus":{"anyOf":[{"type":"string","enum":["tight"]},{"type":"null"}]},"anchors":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"hue":{"anyOf":[{"type":"number","minimum":0,"maximum":360},{"type":"array","prefixItems":[{"type":"number","minimum":0,"maximum":360},{"type":"number","minimum":0,"maximum":360}]}]},"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"neutral":{"type":"string","enum":["black","grey","white"]},"role":{"type":"string","enum":["main","support","accent"]},"value":{"type":"string","enum":["dark","light","vivid","muted","deep"]},"weight":{"type":"number","exclusiveMinimum":0,"maximum":10}}}},"anchorsOnly":{"type":"boolean"}},"required":["count","seed"]},"colors":{"minItems":2,"maxItems":256,"type":"array","items":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}}},"required":["name"]}}}},"responses":{"201":{"description":"The saved palette.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}},"get":{"operationId":"listPalettes","tags":["Palettes"],"summary":"List your palettes","description":"Your palettes, newest first.","parameters":[],"responses":{"200":{"description":"The palettes.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/palettes/{id}":{"get":{"operationId":"getPalette","tags":["Palettes"],"summary":"Get a palette","description":"Fetch one of your palettes.","parameters":[{"name":"id","in":"path","required":true,"description":"The palette id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The palette.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/animations":{"post":{"operationId":"createAnimation","tags":["Animations"],"summary":"Animate a sprite","description":"Start an animation job (walk, run, idle, attack and more) from a still sprite you own. Asynchronous: returns an id, then poll GET /api/animations/{id}. The token cost scales with frame_count.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"preset":{"type":"string","enum":["Idle","Walk","Jump","Run","Attack","Hurt","Death","Custom"]},"frame_count":{"default":8,"type":"integer","minimum":4,"maximum":16},"custom_prompt":{"type":"string","maxLength":1500},"palette_extras":{"type":"integer","minimum":0,"maximum":256},"framing_margin":{"type":"integer","minimum":0,"maximum":25},"framing_anchor":{"type":"string","enum":["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]},"public":{"default":false,"type":"boolean"}},"required":["source_generation_id","preset"]}}}},"responses":{"202":{"description":"The job was accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/animations/{id}":{"get":{"operationId":"getAnimation","tags":["Animations"],"summary":"Poll an animation","description":"Returns processing with an optional progress (0 to 1) while running. When completed, the sprite sheet is in image.spritesheetBase64. Failed jobs are refunded automatically.","parameters":[{"name":"id","in":"path","required":true,"description":"The animation id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job status, or the finished sprite sheet.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/animations/{id}/cancel":{"post":{"operationId":"cancelAnimation","tags":["Animations"],"summary":"Cancel an animation","description":"Cancel a running animation job and refund its tokens.","parameters":[{"name":"id","in":"path","required":true,"description":"The animation id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job was cancelled.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/restyles":{"post":{"operationId":"createRestyle","tags":["Restyles"],"summary":"Restyle a sprite","description":"Change a sprite you own and keep the character: a new look, a new pose, or a swapped item. Asynchronous: returns an id, then poll GET /api/restyles/{id}. 2 tokens on the normal tier, 9 on pro.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"preset":{"type":"string","enum":["fire","ice","gold","zombie","holy","cursed","poison","royal","shadow","steampunk"]},"custom_prompt":{"type":"string","minLength":1,"maxLength":500},"mode":{"default":"restyle","type":"string","enum":["restyle","pose","item","custom"]},"tier":{"default":"normal","type":"string","enum":["normal","pro"]},"palette_extras":{"type":"integer","minimum":0,"maximum":256},"framing_margin":{"type":"integer","minimum":0,"maximum":25},"framing_anchor":{"type":"string","enum":["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]},"public":{"default":false,"type":"boolean"}},"required":["source_generation_id"]}}}},"responses":{"202":{"description":"The job was accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/restyles/{id}":{"get":{"operationId":"getRestyle","tags":["Restyles"],"summary":"Poll a restyle","description":"Returns processing while running. When completed, the sprite is in image.pngBase64. Failed jobs are refunded automatically.","parameters":[{"name":"id","in":"path","required":true,"description":"The restyle id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job status, or the finished sprite.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/restyles/{id}/cancel":{"post":{"operationId":"cancelRestyle","tags":["Restyles"],"summary":"Cancel a restyle","description":"Cancel a running restyle job and refund its tokens.","parameters":[{"name":"id","in":"path","required":true,"description":"The restyle id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job was cancelled.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/combines":{"post":{"operationId":"createCombine","tags":["Combines"],"summary":"Combine two sprites","description":"Put an item from one sprite you own into another. The first sprite keeps its identity and size. Asynchronous: returns an id, then poll GET /api/combines/{id}. 3 tokens on the normal tier, 9 on pro.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"item_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prompt":{"type":"string","minLength":1,"maxLength":500},"tier":{"default":"normal","type":"string","enum":["normal","pro"]},"palette_extras":{"type":"integer","minimum":0,"maximum":256},"framing_margin":{"type":"integer","minimum":0,"maximum":25},"framing_anchor":{"type":"string","enum":["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]},"public":{"default":false,"type":"boolean"}},"required":["source_generation_id","item_generation_id","prompt"]}}}},"responses":{"202":{"description":"The job was accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/combines/{id}":{"get":{"operationId":"getCombine","tags":["Combines"],"summary":"Poll a combine","description":"Returns processing while running. When completed, the sprite is in image.pngBase64. Failed jobs are refunded automatically.","parameters":[{"name":"id","in":"path","required":true,"description":"The combine id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job status, or the finished sprite.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/combines/{id}/cancel":{"post":{"operationId":"cancelCombine","tags":["Combines"],"summary":"Cancel a combine","description":"Cancel a running combine job and refund its tokens.","parameters":[{"name":"id","in":"path","required":true,"description":"The combine id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The job was cancelled.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"}}}},"/api/touch-ups":{"post":{"operationId":"createTouchUp","tags":["Edits"],"summary":"Touch up part of a sprite","description":"Redraw one region of a sprite you own from a sentence, leaving every other pixel unchanged. Synchronous, about 15 to 30 seconds. Costs 1 token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prompt":{"type":"string","minLength":1,"maxLength":300},"region":{"type":"object","properties":{"x":{"type":"integer","minimum":0,"maximum":4096},"y":{"type":"integer","minimum":0,"maximum":4096},"width":{"type":"integer","minimum":1,"maximum":4096},"height":{"type":"integer","minimum":1,"maximum":4096}},"required":["x","y","width","height"]},"public":{"default":false,"type":"boolean"}},"required":["source_generation_id","prompt","region"]}}}},"responses":{"201":{"description":"The repaired sprite, saved as a new id.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/rotations":{"post":{"operationId":"createRotation","tags":["Edits"],"summary":"Rotate a sprite to 8 directions","description":"Turn one still sprite you own into a strip of 8 facings (S, SE, E, NE, N, NW, W, SW) with the same character and palette. Synchronous, about a minute. Costs 12 tokens.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"public":{"default":false,"type":"boolean"}},"required":["source_generation_id"]}}}},"responses":{"201":{"description":"The 8-direction strip.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/normal-maps":{"post":{"operationId":"createNormalMap","tags":["Edits"],"summary":"Make a normal map","description":"A tangent-space normal map for a sprite or animation you own, for dynamic lighting in a game engine. Synchronous. Costs 1 token per frame.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"strength":{"default":0,"type":"number","minimum":0,"maximum":5},"flip_green":{"default":false,"type":"boolean"},"columns":{"default":1,"type":"integer","minimum":1,"maximum":24},"rows":{"default":1,"type":"integer","minimum":1,"maximum":24}},"required":["source_generation_id"]}}}},"responses":{"201":{"description":"The normal map PNG.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}},"/api/background-removals":{"post":{"operationId":"removeBackground","tags":["Edits"],"summary":"Remove a background","description":"Remove a flat single-color background from a sprite or animation you own. standard is free, refined costs 1 token. Synchronous.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"default":"standard","type":"string","enum":["standard","refined"]},"matte_color":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$"},"tolerance":{"default":200,"type":"integer","minimum":0,"maximum":300},"palette_size":{"default":64,"type":"integer","minimum":16,"maximum":256},"alpha_threshold":{"default":0.7,"type":"number","minimum":0.3,"maximum":0.9}},"required":["source_generation_id"]}}}},"responses":{"201":{"description":"The transparent sprite, saved as a new id.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key that starts with sai_sk_, from the API keys tab of your account page."}},"schemas":{"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string"},"details":{"description":"Structured detail, such as validation issues."}}},"JobAccepted":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["processing"]}}}},"responses":{"Error400":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error402":{"description":"Not enough tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"The API key is revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error404":{"description":"Not found, or not yours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"Rate limited. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error500":{"description":"Generation failed. Tokens are refunded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}