> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meridian.surf/llms.txt
> Use this file to discover all available pages before exploring further.

# "Power" Usage

Power fuels your bot. At Meridian, we don't like limiting users when unnecessary. For example, we don't limit the amount of commands or events you can create. Instead, we only bill you for the amount of traffic your bot generates.

<Note>
  Discord limits apply to the amount of commands your bot can have. For more info, see [this article](https://docs.discord.com/developers/interactions/application-commands#registering-a-command).
</Note>

Each plan includes a monthly Power allowance. You can view your remaining Power on your [bot's dashboard](https://meridian.surf/my/usage) at all times. On this page, we'll go over all ways we bill your bot.

# Event runs

All event runs only drain 1 Power. Included types:

* Your bot receives an event from the Discord gateway. (for example: Member Join)
* Your bot receives a webhook request.
* Your bot runs a timed event.

<Note>
  **RCON events** <Badge color="orange">SOON</Badge> cost only **0.5 Power**. Please reach out if you're expecting high traffic and would like to discuss custom pricing.
</Note>

# Command runs

All command runs drain 2 Power. Included types:

* A user runs a command on your bot.
* Your bot executes a command from a flow using the **Run Command** <Badge color="orange">SOON</Badge> action.

# API requests

Only API requests sent to third-party services are billed. This means requests to Discord or partnered services, such as Auralink, are free to use. Included billed types:

* Your bot sends an API request to any third-party service.

<Tip>
  Requests sent using the Request Editor (within the [API Block](/builder/api/api)) for the purpose of testing if your requests are set up correctly are **completely free** and you will never be billed of them.
</Tip>

export const PowerUsageCalculator = () => {
  const EVENT_POWER = 1;
  const COMMAND_POWER = 2;
  const RCON_POWER = 0.5;
  const API_REQUEST_POWER = 1;
  const PLANS = [{
    id: "free",
    name: "Free",
    allowance: 10000
  }, {
    id: "hobby",
    name: "Hobby",
    allowance: 50000
  }, {
    id: "pro",
    name: "Pro",
    allowance: 250000
  }, {
    id: "business",
    name: "Business",
    allowance: 1000000
  }];
  const [events, setEvents] = useState(5000);
  const [commands, setCommands] = useState(2000);
  const [apiRequests, setApiRequests] = useState(500);
  const [rconEvents, setRconEvents] = useState(0);
  const [selectedPlan, setSelectedPlan] = useState("free");
  const eventPower = events * EVENT_POWER;
  const commandPower = commands * COMMAND_POWER;
  const apiPower = apiRequests * API_REQUEST_POWER;
  const rconPower = rconEvents * RCON_POWER;
  const totalPower = eventPower + commandPower + apiPower + rconPower;
  const plan = PLANS.find(p => p.id === selectedPlan) ?? PLANS[0];
  const remaining = plan.allowance - totalPower;
  const usagePercent = Math.min(totalPower / plan.allowance * 100, 100);
  const overAllowance = totalPower > plan.allowance;
  const format = n => n.toLocaleString();
  const getSliderStyle = (value, max) => {
    const percent = max === 0 ? 0 : value / max * 100;
    return {
      width: "100%",
      height: "8px",
      marginTop: "8px",
      borderRadius: "8px",
      appearance: "none",
      WebkitAppearance: "none",
      cursor: "pointer",
      display: "block",
      background: `linear-gradient(to right, #8f82ec ${percent}%, rgba(255, 255, 255, 0.18) ${percent}%)`
    };
  };
  const sectionStyle = {
    marginBottom: "20px"
  };
  const hintStyle = {
    fontSize: "12px",
    opacity: 0.6,
    margin: "4px 0 0 0"
  };
  const cardStyle = {
    marginTop: "24px",
    marginBottom: "24px",
    padding: "20px",
    borderRadius: "16px",
    border: "1px solid rgba(128, 128, 128, 0.35)",
    backgroundColor: "rgba(128, 128, 128, 0.12)"
  };
  const summaryStyle = {
    padding: "16px",
    borderRadius: "12px",
    border: "1px solid rgba(128, 128, 128, 0.25)",
    backgroundColor: "rgba(128, 128, 128, 0.08)"
  };
  return <div className="not-prose power-calculator" style={cardStyle}>
      <style>{`
        .power-calculator input[type="range"] {
          -webkit-appearance: none;
          appearance: none;
        }
        .power-calculator input[type="range"]::-webkit-slider-thumb {
          -webkit-appearance: none;
          appearance: none;
          width: 16px;
          height: 16px;
          margin-top: -4px;
          border-radius: 9999px;
          background: #ffffff;
          border: 2px solid #8f82ec;
          box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
          cursor: pointer;
        }
        .power-calculator input[type="range"]::-moz-range-thumb {
          width: 16px;
          height: 16px;
          border-radius: 9999px;
          background: #ffffff;
          border: 2px solid #8f82ec;
          box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
          cursor: pointer;
        }
        .power-calculator input[type="range"]::-moz-range-track {
          background: transparent;
          border: none;
        }
        .power-plan-grid {
          display: grid !important;
          grid-template-columns: 1fr 1fr !important;
          gap: 8px !important;
        }
        .power-plan-btn {
          width: 100% !important;
          display: block !important;
          box-sizing: border-box !important;
          margin: 0 !important;
          padding: 10px 12px !important;
          border-radius: 10px !important;
          border: 1px solid rgba(255, 255, 255, 0.18) !important;
          background-color: rgba(255, 255, 255, 0.04) !important;
          cursor: pointer !important;
          text-align: left !important;
          font: inherit !important;
          color: inherit !important;
          appearance: none !important;
          -webkit-appearance: none !important;
        }
        .power-plan-btn:hover {
          border-color: rgba(255, 255, 255, 0.3) !important;
          background-color: rgba(255, 255, 255, 0.07) !important;
        }
        .power-plan-btn-selected {
          border-color: #8f82ec !important;
          background-color: rgba(143, 130, 236, 0.16) !important;
        }
        .power-plan-btn-selected:hover {
          border-color: #8f82ec !important;
          background-color: rgba(143, 130, 236, 0.16) !important;
        }
        .power-plan-btn-name {
          display: block !important;
          font-weight: 600 !important;
          font-size: 14px !important;
          line-height: 1.3 !important;
        }
        .power-plan-btn-detail {
          display: block !important;
          font-size: 12px !important;
          line-height: 1.3 !important;
          opacity: 0.65 !important;
          margin-top: 2px !important;
        }
      `}</style>
      <h3 className="text-base font-semibold text-zinc-950 dark:text-white" style={{
    margin: "0 0 4px 0"
  }}>
        Power usage calculator
      </h3>
      <p className="text-sm text-zinc-950/70 dark:text-white/70" style={{
    margin: "0 0 24px 0"
  }}>
        Estimate your monthly Power based on expected bot traffic.
      </p>

      <div style={sectionStyle}>
        <label className="block text-sm text-zinc-950/70 dark:text-white/70">
          Event runs: {format(events)} / month
          <input type="range" min="0" max="100000" step="100" value={events} onChange={e => setEvents(Number.parseInt(e.target.value))} style={getSliderStyle(events, 100000)} />
        </label>
        <p className="text-zinc-950/50 dark:text-white/50" style={hintStyle}>
          Discord events, webhooks, timed events · {EVENT_POWER} Power each
        </p>
      </div>

      <div style={sectionStyle}>
        <label className="block text-sm text-zinc-950/70 dark:text-white/70">
          Command runs: {format(commands)} / month
          <input type="range" min="0" max="50000" step="100" value={commands} onChange={e => setCommands(Number.parseInt(e.target.value))} style={getSliderStyle(commands, 50000)} />
        </label>
        <p className="text-zinc-950/50 dark:text-white/50" style={hintStyle}>
          Slash/prefix commands · {COMMAND_POWER} Power each
        </p>
      </div>

      <div style={sectionStyle}>
        <label className="block text-sm text-zinc-950/70 dark:text-white/70">
          Third-party API requests: {format(apiRequests)} / month
          <input type="range" min="0" max="20000" step="50" value={apiRequests} onChange={e => setApiRequests(Number.parseInt(e.target.value))} style={getSliderStyle(apiRequests, 20000)} />
        </label>
        <p className="text-zinc-950/50 dark:text-white/50" style={hintStyle}>
          Discord & partner APIs are free · {API_REQUEST_POWER} Power each
        </p>
      </div>

      <div style={sectionStyle}>
        <label className="block text-sm text-zinc-950/70 dark:text-white/70">
          RCON events: {format(rconEvents)} / month
          <input type="range" min="0" max="50000" step="100" value={rconEvents} onChange={e => setRconEvents(Number.parseInt(e.target.value))} style={getSliderStyle(rconEvents, 50000)} />
        </label>
        <p className="text-zinc-950/50 dark:text-white/50" style={hintStyle}>
          Coming soon · {RCON_POWER} Power each
        </p>
      </div>

      <div style={{
    ...sectionStyle,
    marginBottom: "28px"
  }}>
        <p className="text-sm text-zinc-950/70 dark:text-white/70" style={{
    margin: "0 0 10px 0"
  }}>
          Compare to plan
        </p>
        <div className="power-plan-grid">
          {PLANS.map(p => {
    const isSelected = p.id === selectedPlan;
    return <button key={p.id} type="button" className={`power-plan-btn${isSelected ? " power-plan-btn-selected" : ""}`} onClick={() => setSelectedPlan(p.id)}>
                <span className="power-plan-btn-name">{p.name}</span>
                <span className="power-plan-btn-detail">
                  {format(p.allowance)} Power / month included
                </span>
              </button>;
  })}
        </div>
      </div>

      <div style={summaryStyle}>
        <p className="text-2xl font-semibold text-zinc-950 dark:text-white" style={{
    margin: "0 0 16px 0"
  }}>
          {format(totalPower)} Power
        </p>

        <div className="text-sm font-mono text-zinc-950/70 dark:text-white/70" style={{
    borderTop: "1px solid rgba(128,128,128,0.2)",
    paddingTop: "16px",
    marginBottom: "16px"
  }}>
          <p style={{
    margin: "0 0 8px 0"
  }}>Events: {format(events)} × {EVENT_POWER} = {format(eventPower)}</p>
          <p style={{
    margin: "0 0 8px 0"
  }}>Commands: {format(commands)} × {COMMAND_POWER} = {format(commandPower)}</p>
          <p style={{
    margin: "0 0 8px 0"
  }}>API requests: {format(apiRequests)} × {API_REQUEST_POWER} = {format(apiPower)}</p>
          {rconEvents > 0 && <p style={{
    margin: "0 0 8px 0"
  }}>RCON events: {format(rconEvents)} × {RCON_POWER} = {format(rconPower)}</p>}
        </div>

        <div style={{
    borderTop: "1px solid rgba(128,128,128,0.2)",
    paddingTop: "16px"
  }}>
          <div style={{
    display: "flex",
    justifyContent: "space-between",
    fontSize: "14px",
    marginBottom: "8px"
  }}>
            <span className="text-zinc-950/70 dark:text-white/70">{plan.name} allowance</span>
            <span className="font-mono text-zinc-950/70 dark:text-white/70">{format(plan.allowance)} Power</span>
          </div>

          <div style={{
    height: "8px",
    width: "100%",
    borderRadius: "9999px",
    background: "rgba(128,128,128,0.2)",
    overflow: "hidden",
    marginBottom: "8px"
  }}>
            <div style={{
    height: "100%",
    width: `${usagePercent}%`,
    borderRadius: "9999px",
    backgroundColor: overAllowance ? "#ef4444" : "#8f82ec"
  }} />
          </div>

          <p className="text-sm font-medium" style={{
    margin: 0,
    color: overAllowance ? "#f87171" : "#34d399"
  }}>
            {overAllowance ? `${format(Math.abs(remaining))} Power over your plan allowance` : `${format(remaining)} Power remaining on your plan`}
          </p>
        </div>
      </div>
    </div>;
};

# Calculator

Use the Power usage calculator to get an approximate idea of how much Power you'll use.

<PowerUsageCalculator />
