---
url: https://docs.sunlicense.com/how-to.md
description: >-
  How to add license keys to a Paper, Fabric, Velocity or Hytale plugin, a
  discord.js, JDA or discord.py bot, an Electron app, a Python CLI, a .NET or
  Unity tool, a WordPress plugin, a Laravel app, a Garry's Mod addon or a FiveM
  script - one answer-first guide per stack.
---

# How to add license keys to your software

One guide per stack. Each starts with the short answer and the code, then the template to start from, then the
details: where the key comes from, how a rejection stops the product, what happens offline and how to sell it.

Every guide works the same way underneath: your product sends its key and a machine id to
`POST https://api.sunlicense.com/api/v2/license/validate` with an API key that can only validate. **200** means
valid; **400** means rejected, and the body's `code` says why (`EXPIRED`, `REVOKED`, `SUSPENDED`, `NOT_FOUND`,
`TOO_MANY_MACHINES`, `TOO_MANY_IPS`, `BLACKLISTED`). No answer at all (network error, 5xx, 429) is not a "no":
keep running and try again later, or use a signed [offline license](/guide/offline-licenses).

## Minecraft and Hytale

* [How to add license keys to a Paper plugin](/how-to/paper-plugin)
* [How to add license keys to a Fabric mod](/how-to/fabric-mod)
* [How to add license keys to a Velocity plugin](/how-to/velocity-plugin)
* [How to add license keys to a Hytale plugin](/how-to/hytale-plugin)

## Discord bots

* [How to add license keys to a discord.js bot](/how-to/discord-js-bot)
* [How to add license keys to a JDA bot](/how-to/jda-bot)
* [How to add license keys to a discord.py bot](/how-to/discord-py-bot)

## Apps, tools and web

* [How to add license keys to an Electron app](/how-to/electron-app)
* [How to add license keys to a Python CLI tool](/how-to/python-cli)
* [How to add license keys to a .NET or Unity tool](/how-to/dotnet-unity-tool)
* [How to add license keys to a WordPress plugin](/how-to/wordpress-plugin)
* [How to add license keys to a Laravel app](/how-to/laravel-app)

## Game servers

* [How to add license keys to a Garry's Mod addon](/how-to/gmod-addon)
* [How to add license keys to a FiveM script](/how-to/fivem-script)

## The quickest way, whatever the stack

Paste the [agent setup prompt](https://sunlicense.com/prompt) into Claude Code, Cursor, Codex, Copilot or another
coding agent. It installs the `sunlicense` CLI, creates (or signs in to) your account, adds the check to your
project, proves it works with a test license and tells you what it changed. [More on AI assistants](/guide/ai-assistants).

The Free plan covers a product from first line to first sales: 3 products, 100 licenses, every SDK and store
integration, no credit card. [Create a free account](https://sunlicense.com/start?ref=docs-howto).
