Authentication
Send both values as headers on every call.
X-API-Key: kd_your_key
X-API-Secret: sk_your_secret
Or as ordinary POST fields api_key and api_secret.
Endpoints
| action | What it does |
ping | Health check, no auth |
balance | Your wallet balance in ₹ |
account | Balance, discount tier and key counts |
products | Products you can issue keys for |
plans | Durations and your discounted price |
price | Cost preview before charging |
create_key | The main one. Charges your balance, returns a key |
create_bulk | Up to 100 keys in one call |
key_info | Status, expiry, device count |
list_keys | Your keys, filterable by buyer |
reset_key | Clear device bindings |
stop_key / resume_key | Block or unblock, expiry untouched |
extend_key | Add days, charges again |
Pricing
Every price is in rupees and already includes your discount tier.
Your tier is set by lifetime deposits: ₹1,000 unlocks 10% off,
₹2,000 unlocks 20%, ₹3,000 unlocks 30% — the maximum. Once unlocked
a tier is permanent and applies to every product.
create_key
| Field | | Meaning |
product_id | required | From products |
days | required | 1, 3, 7, 14, 30 |
devices | optional | Device slots, default 1 |
order_ref | optional | Your order id — blocks double charging |
buyer_ref | optional | Your customer id, e.g. Telegram user id |
key_name | optional | Custom name, X- added automatically |
Always send order_ref. If the same value arrives twice — network
retry, double tap, bot restart — you get the original key back with
"duplicate": true and no second charge.
Response
{
"ok": true,
"data": {
"key": "X-A7K2M9P4",
"product": "PUBG Mobile",
"days": 7,
"cost": 1.00,
"balance_left": 147.50,
"status": "offline",
"expires_at": null,
"duplicate": false
}
}
Error codes
| code | HTTP | Meaning |
AUTH_FAILED | 401 | Wrong key/secret, or revoked |
IP_BLOCKED | 403 | Caller IP not whitelisted |
RATE_LIMIT | 429 | Too many calls this minute |
NO_BALANCE | 402 | Wallet balance too low |
NO_PRODUCT | 400 | product_id missing or disabled |
BAD_PLAN | 400 | Not a valid duration |
MAINTENANCE | 503 | Product temporarily off |
NAME_TAKEN | 409 | Custom key_name exists |
NOT_FOUND | 404 | Key is not yours |
PHP
function keydock($action, $params = []) {
$ch = curl_init('');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . KEYDOCK_KEY,
'X-API-Secret: ' . KEYDOCK_SECRET,
],
CURLOPT_POSTFIELDS => http_build_query(['action' => $action] + $params),
]);
$r = curl_exec($ch);
curl_close($ch);
return json_decode($r, true);
}
$res = keydock('create_key', [
'product_id' => 1,
'days' => 7,
'order_ref' => 'ORDER-' . $orderId,
'buyer_ref' => $telegramUserId,
]);
if ($res['ok']) {
$key = $res['data']['key']; // hand this to the buyer
} else {
error_log('KeyDock: ' . $res['error']);
}
Python — Telegram bot
import requests
BASE = ""
KEY = "kd_your_key"
SECRET = "sk_your_secret"
def keydock(action, **params):
r = requests.post(
BASE,
headers={"X-API-Key": KEY, "X-API-Secret": SECRET},
data={"action": action, **params},
timeout=30,
)
return r.json()
res = keydock("create_key",
product_id=1,
days=7,
order_ref=f"TG-{order_id}",
buyer_ref=str(user_id))
if res["ok"]:
await message.reply(f"Your key: `{res['data']['key']}`")
else:
await message.reply(f"Failed: {res['error']}")
Node.js
const BASE = "";
const KEY = "kd_your_key";
const SECRET = "sk_your_secret";
async function keydock(action, params = {}) {
const res = await fetch(BASE, {
method: "POST",
headers: {
"X-API-Key": KEY,
"X-API-Secret": SECRET,
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({ action, ...params }),
});
return res.json();
}
const r = await keydock("create_key", {
product_id: 1, days: 7,
order_ref: `ORDER-${orderId}`,
buyer_ref: String(userId),
});
if (r.ok) console.log("Key:", r.data.key);
else console.error("Failed:", r.error);
cURL — quick test
curl -X POST "" \
-H "X-API-Key: kd_your_key" \
-H "X-API-Secret: sk_your_secret" \
-d "action=balance"