Quickstart
Your first sprite in three steps.
1. Create a key
Open the API keys tab and generate one. It starts with sai_sk_ and is shown once, so copy it now.
2. Send a request
POST a prompt and an asset type with your key as a Bearer token.
curl https://sprite-ai.art/api/sprites \
-H "Authorization: Bearer sai_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "prompt": "a knight with a blue cape", "asset_type": "character" }'const res = await fetch("https://sprite-ai.art/api/sprites", {
method: "POST",
headers: {
Authorization: "Bearer sai_sk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "a knight with a blue cape",
asset_type: "character",
}),
});
const data = await res.json();import base64, requests
res = requests.post(
"https://sprite-ai.art/api/sprites",
headers={"Authorization": "Bearer sai_sk_your_key_here"},
json={"prompt": "a knight with a blue cape", "asset_type": "character"},
)
data = res.json()3. Save the image
The PNG is in image.pngBase64. Decode it and write it to a file.
echo "iVBORw0KGgoAAAANS..." | base64 -d > knight.pngimport { writeFile } from "fs/promises";
await writeFile("knight.png", Buffer.from(data.image.pngBase64, "base64"));with open("knight.png", "wb") as f:
f.write(base64.b64decode(data["image"]["pngBase64"]))That's it. Next: the full API reference.