SpawnKit API

The same RAM calculator, startup flags and server.properties logic as the site, as a free JSON API. Build it into your hosting panel, Discord bot or setup wizard.

Overview

Base URL
https://spawnkit.dev/api/v1
Auth
None. The API is public; no key or sign-up.
Rate limit
60 requests per minute per IP. Calling from your visitors' browsers gives each visitor their own limit.
CORS
Open to every origin, so it works straight from front-end code.
Format
JSON responses, UTF-8. Parameters go in the query string.
Validation
Missing or invalid values fall back to defaults instead of erroring. Every response echoes what was used, so check input or values.
Versioning
Breaking changes would ship as /api/v2. Fields may be added to v1 responses.

RAM estimate

GET/api/v1/ram

Estimates how much RAM a server needs, rounded up to a common plan size, with the reasons and any warnings.

Query parameters

NameTypeDefaultAcceptedDescription
typestringpapervanilla, paper, fabric, forgeServer software. paper covers Purpur; forge covers NeoForge.
playersinteger101–100Players online at the same time.
modsstringnonenone, light, medium, heavyMod list size: under ~50, ~50–150, 150+. Only used for fabric and forge.
pluginsinteger100–300Plugin count. Only used for paper.
vdinteger103–32view-distance.
sdinteger103–32simulation-distance.
pregen0 | 110, 11 if the world is pre-generated. 0 adds 10% headroom.

Example request

curl
curl "https://spawnkit.dev/api/v1/ram?type=forge&mods=medium&players=12&vd=8&sd=6&pregen=0"
JavaScript
const res = await fetch("https://spawnkit.dev/api/v1/ram?type=forge&mods=medium&players=12&vd=8&sd=6&pregen=0");
if (!res.ok) throw new Error((await res.json()).error);
const data = await res.json();

Example response

200 OK · application/json
{
  "input": {
    "type": "forge",
    "players": 12,
    "mods": "medium",
    "plugins": 10,
    "viewDistance": 8,
    "simulationDistance": 6,
    "pregenerated": false
  },
  "result": {
    "low": 8,
    "goWith": 10,
    "raw": 8.728163265306124,
    "reasons": [
      "3 GB baseline for the server software itself.",
      "4 GB for a medium mod list.",
      "0.9 GB for 12 players at view distance 8 and simulation distance 6.",
      "+10% headroom because new chunks will be generated while people play."
    ],
    "warnings": [
      "Pre-generate your world (for example with the Chunky plugin or mod) to avoid lag spikes as players explore."
    ]
  },
  "estimate": true
}

Response fields

input
The values actually used, after defaults and validation.
result.low / result.goWith
The recommended range in GB. goWith is the single number to buy.
result.raw
The unrounded estimate in GB.
result.reasons
What contributed to the number, as plain-English lines.
result.warnings
Advice, such as lowering view distance or pre-generating the world.
estimate
Always true. These figures are estimates; say so when you show them.

Startup flags

GET/api/v1/flags

Aikar's flags sized to the RAM, the Java version needed, and ready-to-save start scripts for the chosen platform.

Query parameters

NameTypeDefaultAcceptedDescription
raminteger61–128Memory in GB. Above 12 switches to Aikar's large-heap flags.
swstringpaperpaper, purpur, vanilla, fabric, forge, neoforgeServer software. Modern Forge and NeoForge return user_jvm_args.txt instead of a script.
verstring1.20.5-1.2126.1+, 1.20.5-1.21, 1.18-1.20.4, 1.17, 1.12-1.16Minecraft version range. Decides the Java version.
osstringlinuxlinux, windows, panellinux gives start.sh, windows gives start.bat, panel gives a Pterodactyl or Pelican startup line.
jarstringper softwareletters, digits, . _ -Jar file name. Other characters are stripped.

Example request

curl
curl "https://spawnkit.dev/api/v1/flags?ram=8&sw=paper&ver=1.20.5-1.21&os=linux"
JavaScript
const res = await fetch("https://spawnkit.dev/api/v1/flags?ram=8&sw=paper&ver=1.20.5-1.21&os=linux");
if (!res.ok) throw new Error((await res.json()).error);
const data = await res.json();

Example response

200 OK · application/json
{
  "input": {
    "ramGb": 8,
    "software": "paper",
    "version": "1.20.5-1.21",
    "os": "linux",
    "jar": ""
  },
  "result": {
    "java": 21,
    "largeHeap": false,
    "flags": [
      "-Xms8G",
      "-Xmx8G",
      "-XX:+UseG1GC",
      "-XX:+ParallelRefProcEnabled",
      "-XX:MaxGCPauseMillis=200",
      "-XX:+UnlockExperimentalVMOptions",
      "-XX:+DisableExplicitGC",
      "-XX:+AlwaysPreTouch",
      "-XX:G1NewSizePercent=30",
      "-XX:G1MaxNewSizePercent=40",
      "-XX:G1HeapRegionSize=8M",
      "-XX:G1ReservePercent=20",
      "-XX:G1HeapWastePercent=5",
      "-XX:G1MixedGCCountTarget=4",
      "-XX:InitiatingHeapOccupancyPercent=15",
      "-XX:G1MixedGCLiveThresholdPercent=90",
      "-XX:G1RSetUpdatingPauseIntervalMillis=100",
      "-XX:SurvivorRatio=32",
      "-XX:+PerfDisableSharedMem",
      "-XX:MaxTenuringThreshold=1",
      "-Dusing.aikars.flags=https://mcflags.emc.gs",
      "-Daikars.new.flags=true"
    ],
    "files": [
      {
        "name": "start.sh",
        "content": "#!/bin/sh\njava -Xms8G -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseIntervalMillis=100 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar nogui\n"
      }
    ],
    "notes": [
      "Make it executable with chmod +x start.sh, then run ./start.sh.",
      "Leave 1–2 GB of the machine's memory free for the operating system."
    ]
  }
}

Response fields

input
The values actually used.
result.java
Java version required by the Minecraft version.
result.largeHeap
True when the large-heap (over 12 GB) flag set was used.
result.flags
Every JVM flag, in order, as an array.
result.files
Files to save or lines to paste, each with name and content.
result.notes
Short setup instructions to show next to the files.

Generate server.properties

GET/api/v1/properties

Builds a complete server.properties file from a preset, individual settings, or both. Settings given in the query override the preset.

Query parameters

NameTypeDefaultAcceptedDescription
presetstringnonefriends, public, creative, lowramStarting point. Unknown presets return 400.
<setting>variesvanilla defaultany key from /optionsAny setting as key=value, e.g. max-players=8 or online-mode=false. Invalid values fall back to the default.
formatstringjsonjson, texttext returns just the file as text/plain.

Example request

curl
curl "https://spawnkit.dev/api/v1/properties?preset=friends&max-players=8&motd=Our%20SMP"
JavaScript
const res = await fetch("https://spawnkit.dev/api/v1/properties?preset=friends&max-players=8&motd=Our%20SMP");
if (!res.ok) throw new Error((await res.json()).error);
const data = await res.json();

Example response

200 OK · application/json
{
  "values": {
    "gamemode": "survival",
    "force-gamemode": false,
    "difficulty": "normal",
    "hardcore": false,
    "pvp": true,
    "allow-flight": false,
    "spawn-protection": 0,
    "level-name": "world",
    "level-seed": "",
    "level-type": "minecraft:normal",
    "generate-structures": true,
    "allow-nether": true,
    "max-world-size": 29999984,
    "motd": "Our SMP",
    "max-players": 8,
    "white-list": true,
    "enforce-whitelist": true,
    "op-permission-level": 4,
    "player-idle-timeout": 0,
    "hide-online-players": false,
    "view-distance": 10,
    "simulation-distance": 10,
    "entity-broadcast-range-percentage": 100,
    "network-compression-threshold": 256,
    "max-tick-time": 60000,
    "sync-chunk-writes": true,
    "server-port": 25565,
    "server-ip": "",
    "enable-status": true,
    "enable-query": false,
    "query.port": 25565,
    "accepts-transfers": false,
    "enable-rcon": false,
    "rcon.port": 25575,
    "rcon.password": "",
    "resource-pack": "",
    "resource-pack-sha1": "",
    "require-resource-pack": false,
    "resource-pack-prompt": "",
    "online-mode": true,
    "enforce-secure-profile": true,
    "prevent-proxy-connections": false,
    "enable-command-block": false,
    "log-ips": true,
    "rate-limit": 0
  },
  "invalid": [],
  "warnings": [],
  "file": "#Minecraft server properties\n#Generated by spawnkit.dev\ngamemode=survival\nforce-gamemode=false\ndifficulty=normal\nhardcore=false\npvp=true\nallow-flight=false\nspawn-protection=0\nlevel-name=world\nlevel-seed=\nlevel-type=minecraft\\:normal\ngenerate-structures=true\nallow-nether=true\nmax-world-size=29999984\nmotd=Our SMP\nmax-players=8\nwhite-list=true\nenforce-whitelist=true\nop-permission-level=4\nplayer-idle-timeout=0\nhide-online-players=false\nview-distance=10\nsimulation-distance=10\nentity-broadcast-range-percentage=100\nnetwork-compression-threshold=256\nmax-tick-time=60000\nsync-chunk-writes=true\nserver-port=25565\nserver-ip=\nenable-status=true\nenable-query=false\nquery.port=25565\naccepts-transfers=false\nenable-rcon=false\nrcon.port=25575\nrcon.password=\nresource-pack=\nresource-pack-sha1=\nrequire-resource-pack=false\nresource-pack-prompt=\nonline-mode=true\nenforce-secure-profile=true\nprevent-proxy-connections=false\nenable-command-block=false\nlog-ips=true\nrate-limit=0\n"
}

Response fields

values
Every setting and its value, typed (booleans and numbers are not strings).
invalid
Always empty for GET; see POST.
warnings
Risky choices, such as online-mode=false or a short RCON password.
file
The finished file, escaped correctly, ready to save as server.properties.

Check an existing server.properties

POST/api/v1/properties

Send a server.properties file as the request body. It's parsed, type-checked and returned with warnings and a cleaned-up copy. Unknown keys are kept, not dropped.

Request body

The file's text, up to 64 KB. Any content type.

Example request

curl
curl -X POST --data-binary @server.properties \
  "https://spawnkit.dev/api/v1/properties"
JavaScript
const file = await fs.promises.readFile("server.properties", "utf8");
const res = await fetch("https://spawnkit.dev/api/v1/properties", { method: "POST", body: file });
const { invalid, warnings, file: cleaned } = await res.json();
Example body (server.properties)
motd=My server
online-mode=false
view-distance=abc
max-players=12
my-plugin-setting=true

Example response

200 OK · application/json
{
  "values": {
    "gamemode": "survival",
    "force-gamemode": false,
    "difficulty": "easy",
    "hardcore": false,
    "pvp": true,
    "allow-flight": false,
    "spawn-protection": 16,
    "level-name": "world",
    "level-seed": "",
    "level-type": "minecraft:normal",
    "generate-structures": true,
    "allow-nether": true,
    "max-world-size": 29999984,
    "motd": "My server",
    "max-players": 12,
    "white-list": false,
    "enforce-whitelist": false,
    "op-permission-level": 4,
    "player-idle-timeout": 0,
    "hide-online-players": false,
    "view-distance": 10,
    "simulation-distance": 10,
    "entity-broadcast-range-percentage": 100,
    "network-compression-threshold": 256,
    "max-tick-time": 60000,
    "sync-chunk-writes": true,
    "server-port": 25565,
    "server-ip": "",
    "enable-status": true,
    "enable-query": false,
    "query.port": 25565,
    "accepts-transfers": false,
    "enable-rcon": false,
    "rcon.port": 25575,
    "rcon.password": "",
    "resource-pack": "",
    "resource-pack-sha1": "",
    "require-resource-pack": false,
    "resource-pack-prompt": "",
    "online-mode": false,
    "enforce-secure-profile": true,
    "prevent-proxy-connections": false,
    "enable-command-block": false,
    "log-ips": true,
    "rate-limit": 0,
    "my-plugin-setting": "true"
  },
  "invalid": [
    "view-distance"
  ],
  "warnings": [
    "online-mode=false lets anyone join with any username, including an operator's. Only use it behind a proxy like Velocity or BungeeCord that checks accounts.",
    "With online-mode off and no whitelist, your server is open to anyone pretending to be anyone."
  ],
  "file": "#Minecraft server properties\n#Generated by spawnkit.dev\ngamemode=survival\nforce-gamemode=false\ndifficulty=easy\nhardcore=false\npvp=true\nallow-flight=false\nspawn-protection=16\nlevel-name=world\nlevel-seed=\nlevel-type=minecraft\\:normal\ngenerate-structures=true\nallow-nether=true\nmax-world-size=29999984\nmotd=My server\nmax-players=12\nwhite-list=false\nenforce-whitelist=false\nop-permission-level=4\nplayer-idle-timeout=0\nhide-online-players=false\nview-distance=10\nsimulation-distance=10\nentity-broadcast-range-percentage=100\nnetwork-compression-threshold=256\nmax-tick-time=60000\nsync-chunk-writes=true\nserver-port=25565\nserver-ip=\nenable-status=true\nenable-query=false\nquery.port=25565\naccepts-transfers=false\nenable-rcon=false\nrcon.port=25575\nrcon.password=\nresource-pack=\nresource-pack-sha1=\nrequire-resource-pack=false\nresource-pack-prompt=\nonline-mode=false\nenforce-secure-profile=true\nprevent-proxy-connections=false\nenable-command-block=false\nlog-ips=true\nrate-limit=0\n#Other settings kept from your file\nmy-plugin-setting=true\n"
}

Response fields

values
Every setting after parsing. Known settings are typed; unknown ones are kept as text.
invalid
Known settings whose value was invalid, and so were reset to the default.
warnings
Risky choices in the file.
file
The normalised file. Unknown keys appear at the end under a comment.

Accepted values

GET/api/v1/options

Every accepted value for the parameters above, plus the full list of server.properties settings with their type, default, limits and explanation. Use it to build your own forms.

Example request

curl
curl "https://spawnkit.dev/api/v1/options"
JavaScript
const res = await fetch("https://spawnkit.dev/api/v1/options");
if (!res.ok) throw new Error((await res.json()).error);
const data = await res.json();

Example response

200 OK · application/json
{
  "ram": {
    "type": [
      "vanilla",
      "paper",
      "fabric",
      "forge"
    ],
    "mods": [
      "none",
      "light",
      "medium",
      "heavy"
    ],
    "players": "1-100",
    "plugins": "0-300",
    "vd": "3-32",
    "sd": "3-32",
    "pregen": "0 or 1"
  },
  "flags": {
    "ram": "1-128 (GB)",
    "sw": [
      "paper",
      "purpur",
      "vanilla",
      "fabric",
      "forge",
      "neoforge"
    ],
    "ver": [
      "26.1+",
      "1.20.5-1.21",
      "1.18-1.20.4",
      "1.17",
      "1.12-1.16"
    ],
    "os": [
      "linux",
      "windows",
      "panel"
    ],
    "jar": "file name"
  },
  "properties": {
    "presets": [
      "friends",
      "public",
      "creative",
      "lowram"
    ],
    "settings": [
      {
        "section": "Gameplay",
        "key": "gamemode",
        "type": "enum",
        "default": "survival",
        "options": [
          "survival",
          "creative",
          "adventure",
          "spectator"
        ],
        "tip": "The game mode new players start in."
      },
      {
        "section": "Gameplay",
        "key": "force-gamemode",
        "type": "bool",
        "default": false,
        "tip": "Put players back into the default game mode every time they join."
      },
      "… every other setting, same shape"
    ]
  }
}

Response fields

ram / flags
Accepted values and ranges for each parameter.
properties.presets
Preset names.
properties.settings
Every setting: section, key, type, default, min/max or options, and tip.

Errors and limits

Errors return JSON with an error message:

429 Too Many Requests
{
  "error": "Rate limit exceeded: 60 requests per minute. Try again shortly."
}
StatusMeaning
400Bad request, e.g. an unknown preset. The body is { "error": "…" }.
404Unknown endpoint.
405Method other than GET, POST or OPTIONS.
413POST body over 64 KB.
429Over 60 requests a minute from your IP. Wait for the number of seconds in the Retry-After header.
500Unexpected error. Retry once; if it keeps happening, tell us.

Results are deterministic for the same input, so cache them on your side if you call the same thing often.