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
sk_live_…secret key
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-keyrequiredstring
x-secret-keyrequiredstring
x-timestamprequiredRFC 3339
x-noncerequiredstring
x-signaturerequiredhex
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
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.