Step 01
Open the bot
Choose API Key from the menu and generate your private reseller key.
Put our live AI tool catalog inside your own bot or app. You make the sale; we handle stock, charging, and instant digital delivery.
01 — Setup map
Step 01
Choose API Key from the menu and generate your private reseller key.
Step 02
Save it as AITOOLSUBS_API_KEY in your server's secret or environment settings.
Step 03
Deposit in the bot. Every successful API order is charged from this prepaid balance.
Step 04
Fetch /products to show current plans, reseller prices, delivery type, and stock.
Step 05
Send the selected product, quantity, and one unique external_order_id.
Step 06
Send every returned code, link, or file to your buyer. Poll processing orders later.
02 — Working code
const API = "https://aitoolsubs.com/api/public/reseller";
const KEY = process.env.AITOOLSUBS_API_KEY;
async function reseller(path: string, init: RequestInit = {}) {
const response = await fetch(API + path, {
...init,
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
...init.headers,
},
});
const data = await response.json();
if (!response.ok) throw new Error(data.error ?? `HTTP ${response.status}`);
return data;
}
const { products } = await reseller("/products");
const { balance } = await reseller("/balance");
const stock = await reseller("/stock?product_id=" + products[0].id);
const order = await reseller("/order", {
method: "POST",
body: JSON.stringify({
product_id: products[0].id,
quantity: 1,
external_order_id: `tg_${chatId}_${paymentId}`,
}),
});
for (const item of order.items) await deliverToCustomer(item);03 — API reference
Reuse the same external_order_id and the original delivery returns without another charge.
Prices include your reseller discount and every order uses your prepaid bot wallet.
The limit applies per API key. Back off after a 429 before trying again.
04 — AI-assisted setup
Open your project, choose your assistant, and paste the prepared prompt. It includes the security and retry rules that matter.
Ask Claude to inspect your existing bot before changing it.
Give Gemini this prompt with your server-side project open.
Use from the repository root so Codex can test the full flow.
Best for adding the reseller flow to a full-stack web app.
Save the key in Secrets before asking the Agent to connect it.
This prompt works with any coding assistant that can edit your server.
05 — Go live
Troubleshooting
Generate your key in Telegram, fund the wallet, and use the examples above to connect your store.