Skip to article

Game maps

Generate world maps and playable environment concepts.

What you can create

Generate world maps, regions, settlements, interiors, dungeons and gameplay level concepts. Use a world map for route planning or a top-down level for an environment composition. The result is an image asset, not a navigable level or collision mesh.

Prepare map-specific details

Select mapType first. Each type has its own required details fields and allowed values; query capabilities for mapTypes. The example below uses the exact world-map defaults. Do not reuse world-detail keys for an interior or dungeon.

Choose a style preset, optional custom direction and up to three ready style references. Set aspect ratio and resolution. Labels and grid overlays are visual options; their presence does not make the image editable game-engine geometry.

Create a map in the workspace

  1. Open Game map generator.
  2. Choose the map type, fill its contextual fields and set the camera view.
  3. Choose style, references, aspect ratio and resolution.
  4. Review the project destination and cost, then generate.
  5. Inspect the image, download it or reuse it in Scene asset extraction.

Choices, limits and cost

1k costs 3 credits, 2k costs 5 and 4k costs 20. 4k needs premium access and supports only 16:9, 9:16, 21:9, 9:21, 2:1 and 1:2. Camera perspective defaults to auto. Unsupported detail fields and invalid detail options are rejected.

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
versionnumberNoMust be 2; Default: 2
mapTypestringYes"world", "region", "settlement", "interior", "dungeon", "top-down-level", "side-scroller", "metroidvania", "roguelike-floor", "tactics", "tower-defense", "arena", "battle-background"
detailsobjectYesSee the workflow requirements above.
cameraPerspectivestringNo"auto", "top-down", "oblique", "isometric"; Default: "auto"
labelsbooleanNoSee the workflow requirements above.
gridOverlaybooleanNoSee the workflow requirements above.
seasonstringNo"auto", "spring", "summer", "autumn", "winter", "day", "night", "dawn", "dusk"
customPromptstringNomaxLength: 500
styleobjectYesSee the workflow requirements above.
style.presetstringYes"pixel-16bit", "pixel-32bit", "hand-drawn-2d", "anime-jrpg", "sci-fi-topdown", "parchment", "watercolor", "realistic-topdown"
style.templateIdstringNoSee the workflow requirements above.
style.customDirectionstringNomaxLength: 600
style.referenceAnalysisobjectNoSee the workflow requirements above.
style.referenceAnalysis.summarystringYesminLength: 1; maxLength: 600
style.referenceAnalysis.palettearrayYesmaxItems: 6
style.referenceAnalysis.renderingstringYesminLength: 1; maxLength: 160
style.referenceAnalysis.lineworkstringYesminLength: 1; maxLength: 160
style.referenceAnalysis.lightingstringYesminLength: 1; maxLength: 160
style.referenceAnalysis.detailDensitystringYesminLength: 1; maxLength: 160
style.referenceAnalysis.perspectivestringYesminLength: 1; maxLength: 160
style.referenceAnalysis.coherencestringYes"high", "mixed"
style.referenceAssetIdsarrayNomaxItems: 3
outputobjectYesSee the workflow requirements above.
output.aspectRatiostringYes"16:9", "9:16", "21:9", "9:21", "2:1", "1:2", "4:3", "3:4", "3:2", "2:3"
output.resolutionstringYes"1k", "2k", "4k"
examplePresetIdstringNominLength: 1; maxLength: 120
seedintegerNominimum: 0; maximum: 9007199254740991
characterIdstringNominLength: 1; maxLength: 255
characterTargetobject / objectNoSee the workflow requirements above.
projectIdstringNominLength: 1; maxLength: 255
folderIdstring / nullNoSee the workflow requirements above.

API example

This example costs 3 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_map",
  "input": {
    "mapType": "world",
    "details": {
      "worldShape": "continent",
      "biomeMix": "balanced",
      "boundaries": "natural",
      "routeNetwork": "connected",
      "waterCoverage": "medium",
      "landmarkDensity": "medium"
    },
    "style": {
      "preset": "pixel-16bit"
    },
    "output": {
      "resolution": "1k",
      "aspectRatio": "16:9"
    }
  }
}
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_map. The following is a tools/call params object:

json
{
  "name": "generate_map",
  "arguments": {
    "input": {
      "mapType": "world",
      "details": {
        "worldShape": "continent",
        "biomeMix": "balanced",
        "boundaries": "natural",
        "routeNetwork": "connected",
        "waterCoverage": "medium",
        "landmarkDensity": "medium"
      },
      "style": {
        "preset": "pixel-16bit"
      },
      "output": {
        "resolution": "1k",
        "aspectRatio": "16:9"
      }
    },
    "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