Skip to article

Tilesets

Create a four-corner terrain tileset for a game grid.

What you can create

Generate a fixed four-corner terrain atlas for tile-based environments. Use grass, dirt, stone, sand or snow terrain with transparent, water or lava background. The current layout is corner16-v2; this is not an arbitrary free-form sprite sheet request.

Prepare terrain and style

Set layoutId to corner16-v2 and tileSize to 32. Pick terrain, background and a style preset. Custom style needs a nonempty description; reference style needs exactly one ready image. Optional region descriptions control the filled terrain, background and visible cliff face.

Generate an atlas in the workspace

  1. Open AI tileset generator.
  2. Choose terrain, background, edge roughness and connection settings.
  3. Configure height and region descriptions where available.
  4. Choose style and output resolution, review the price and generate.
  5. Inspect tile seams and atlas layout before using the download in Unity or Godot.

Choices, limits and cost

1K costs 2 credits and outputs a 1024-pixel atlas with 256-pixel tiles. 2K costs 4 credits and outputs a 2048-pixel atlas with 512-pixel tiles. The request's fixed tileSize: 32 is a template input; it is not the final exported tile size. Roughness defaults to 25, connection to 50; height is 0–25 percent. Describe a visible material cliff when height is greater than zero.

Parameters

These fields are generated from the same input Schema used by REST and MCP. Nested required fields apply when their parent object or selected variant is present. Business conditions described above are validated before submission.

FieldTypeRequiredDefault and limits
characterIdstringNominLength: 1; maxLength: 255
characterTargetobject / objectNoSee the workflow requirements above.
projectIdstringNominLength: 1; maxLength: 255
folderIdstring / nullNoSee the workflow requirements above.
layoutIdstringYesMust be "corner16-v2"
roughnessintegerNoDefault: 25; minimum: 0; maximum: 100
connectionintegerNoDefault: 50; minimum: 0; maximum: 100
heightPercentintegerNominimum: 0; maximum: 25
outputResolutionstringNo"1K", "2K"
styleobjectNoDefault: {"source":"preset","preset":"pixel-art","customDirection":"","referenceAssetIds":[]}
style.sourcestringYes"preset", "custom", "reference"
style.presetstringNo"pixel-art", "pixel-8bit", "pixel-32bit", "gba-rpg", "handheld-monochrome", "cozy-pastel", "dark-fantasy", "anime-jrpg", "hand-painted-pixel", "neon-cyberpunk", "comic-pixel", "minimal-flat"; Default: "pixel-art"
style.customDirectionstringNoDefault: ""; maxLength: 320
style.referenceAssetIdsarrayNoDefault: []; maxItems: 1
materialstringYes"grass", "dirt", "stone", "sand", "snow"
backgroundstringYes"transparent", "water", "lava"
tileSizenumberYesMust be 32
detailstringNoDefault: ""; maxLength: 500
regionsobjectNoSee the workflow requirements above.
regions.terrainobjectYesSee the workflow requirements above.
regions.terrain.modestringYes"transparent", "material"
regions.terrain.descriptionstringYesmaxLength: 500
regions.backgroundobjectYesSee the workflow requirements above.
regions.background.modestringYes"transparent", "material"
regions.background.descriptionstringYesmaxLength: 500
regions.cliffobjectNoSee the workflow requirements above.
regions.cliff.modestringYesMust be "material"
regions.cliff.descriptionstringYesmaxLength: 500

API example

This example costs 2 credits. A quote does not reserve balance or bypass subscription requirements. Set SPRITEFLOW_API_KEY in your shell. Replace the placeholder asset ID 00000000-0000-4000-8000-000000000001 with a ready asset you own when present. Use a new idempotency key for each intentional generation; keep it unchanged when retrying.

bash

# Use the same BASE_URL for credentials, uploads and generation.
BASE_URL="https://spriteflow.io"
IDEMPOTENCY_KEY="example-workflow-001"

cat > request.json <<'JSON'
{
  "operation": "generate_tileset",
  "input": {
    "layoutId": "corner16-v2",
    "material": "grass",
    "background": "transparent",
    "tileSize": 32,
    "outputResolution": "1K"
  }
}
JSON

curl --fail-with-body "$BASE_URL/api/v1/estimates" \
  -H "Authorization: Bearer $SPRITEFLOW_API_KEY" \
  -H "Content-Type: application/json" --data-binary @request.json

curl --fail-with-body "$BASE_URL/api/v1/tasks" \
  -H "Authorization: Bearer $SPRITEFLOW_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" --data-binary @request.json

An accepted request returns HTTP 202, Location and Retry-After headers. Example response (IDs are illustrative):

json
{"taskId":"00000000-0000-4000-8000-000000000002","status":"accepted","statusUrl":"/api/v1/tasks/00000000-0000-4000-8000-000000000002","pollAfterSeconds":10,"replayed":false}

MCP example

Call estimate_cost with the same operation and input, then call generate_tileset. The following is a tools/call params object:

json
{
  "name": "generate_tileset",
  "arguments": {
    "input": {
      "layoutId": "corner16-v2",
      "material": "grass",
      "background": "transparent",
      "tileSize": 32,
      "outputResolution": "1K"
    },
    "idempotencyKey": "example-workflow-001"
  }
}

The tool returns the same task receipt in structuredContent and a JSON text result. Pass taskId to get_task. Tool annotations describe behavior; permissions are still checked on the server.

Completion, download and reuse

Poll the returned statusUrl after pollAfterSeconds. Continue while terminal is false. Read items for per-task results, progress for batch counts and assets for ready files. A batch can be partially_completed: use its successful assets and review each failed item before deciding whether to create a separate retry.

For each returned asset ID, call get_download_url or GET /api/v1/assets/{assetId}/download. Download the temporary URL before it expires. Image assets can be passed into a compatible operation as inputAssetId or a style reference. Do not pass provider task IDs, download URLs or local filesystem paths as asset IDs.

Failures and recovery

  • INVALID_PARAMETERS: fix the field errors before submitting. Check the business conditions and defaults above.
  • INPUT_ASSET_UNAVAILABLE: confirm the upload, check ownership and ensure the asset is ready and not trashed.
  • INSUFFICIENT_CREDITS: add credits before a new request; a cost estimate does not reserve them.
  • A timeout or lost response: resend the identical request with the original idempotency key. Never invent a new key just because the response was lost.
  • A terminal generation failure: inspect the item error and refund information. Refund handling uses the existing generation workflow. Do not assume an in-progress or unknown submission is safe to repeat.

Uploads · Tasks · Credits · Idempotency · Save destinations · Download and export