API keys & auth

Keys, limits and signed requests

Every API key is a pair: a public key that is safe in the browser, and a secret key that must only ever live on your server.

Your keys

pk_live_…

public key

Identifies your business. Use it in the checkout SDK and for verifying payments. Safe to ship in frontend code.
sk_live_…

secret key

Signs server requests. Shown once, with the key created at sign-up, then stored only as a hash. Keys you add later in the dashboard are for the SDK only. Never put a secret key in a browser or an app.

You can have up to two active keys, and at least one must stay active. Revoking a key stops it working immediately; payment links move to your remaining key on their own.

Signing server requests

Server endpoints such as creating a session from your backend need five headers. The signature is a hex HMAC-SHA256 of METHOD|path|body|timestamp|nonce using your secret key.

x-public-keyrequired

string

Your public key.
x-secret-keyrequired

string

The matching secret key.
x-timestamprequired

RFC 3339

Current time. Requests more than 5 minutes off are rejected.
x-noncerequired

string

Unique per request. A repeated nonce is rejected as a replay.
x-signaturerequired

hex

The HMAC described above, over the exact body you send.
slimepay.js (Node 18+)
import crypto from "node:crypto";

const publicKey = process.env.SLIMEPAY_PUBLIC_KEY;
const secretKey = process.env.SLIMEPAY_SECRET_KEY;

export async function slimepay(method, path, body) {
  const raw = body ? JSON.stringify(body) : "";
  const timestamp = new Date().toISOString();
  const nonce = crypto.randomUUID();
  const signature = crypto
    .createHmac("sha256", secretKey)
    .update([method.toUpperCase(), path, raw, timestamp, nonce].join("|"))
    .digest("hex");

  const res = await fetch("https://slimepay-server.up.railway.app" + path, {
    method,
    headers: {
      "Content-Type": "application/json",
      "x-public-key": publicKey,
      "x-secret-key": secretKey,
      "x-timestamp": timestamp,
      "x-nonce": nonce,
      "x-signature": signature,
    },
    body: raw || undefined,
  });
  if (!res.ok) throw new Error((await res.json()).message);
  return res.json();
}

// Create a checkout session from your server
await slimepay("POST", "/api/merchant/checkout/sessions", {
  amountNgn: 35000,
  supportedNativeCurrencies: ["BTC", "USDT"],
  customer: { email: "buyer@example.com", reference: "order-123" },
});

Sign the bytes you send

Serialise the body once and send that same string. Re-serialising after signing can reorder keys and break the signature.

Limits and account security

Each account can make up to 100,000 API requests a day across all keys; the dashboard shows today's usage. Requests above the limit get a 429. Turn on two-factor sign-in in your dashboard security settings to protect the dashboard where keys and payout details live.