API pipeline: Top up your balance with Telegram Stars, TON, USDT on TON or BTC
Goal: add money to your Cabi.Chat balance with Telegram Stars (in the Cabi.Chat bot) or in crypto (TON, USDT on TON or BTC) and see your transactions. The balance is kept in USDT; Pro and plans are paid from it, and AI usage is shown in AI spend: API pipeline: See your AI spend
Telegram Stars: in the bot, not through the API
The simplest way for Telegram users. There is no API call for a Stars top-up: the payment happens in Telegram, and the balance is credited without any call from you.
- Have a Cabi.Chat account and be signed in with Telegram first: API pipeline: Sign in to Cabi.Chat with Telegram
- In Telegram, open https://t.me/CabiChatBot and send /deposit.
- Pick a package; the invoice shows how much it adds to your balance. Pay it with Stars.
- The bot confirms the amount credited and your new balance. Through the API you see it in the balance (step 5) and as a deposit in your transactions (step 6).
Crypto: TON, USDT on TON or BTC
1. Your deposit addresses.
GET /v0/my/funds/wallets
→ {"ton": {"chain": "ton", "address": "UQExampleTonAddress…", "link": "<payment link>", "qr": "data:image/png;base64,…"},
"btc": {"chain": "btc", "address": "bc1qexampleaddress…", "link": "<payment link>", "qr": "data:image/png;base64,…"}}
Your TON address takes both TON and USDT on TON. First time: open https://t.me/CabiChatBot and send /start; your addresses then appear.
2. Rates (optional). GET /v0/my/funds/crypto-prices → {"ton": 3.1, "btc": 61000.0, "usdt": 1.0} (USD).
3. Send TON or USDT to your TON address, or BTC to your BTC address, from any wallet. Send USDT over the TON network only.
4. Credit it. TON and USDT on TON are both checked by the ton call:
POST /v0/my/funds/sync-deposit/ton
→ {"deposit_detected": true, "credited_count": 2, "credited_amount": "10", "credited_usd": "56.00",
"usdt_amount": "25", "usdt_ok": true, "network": "TON"}
credited_amount: TON credited;usdt_amount: USDT credited;credited_usd: both together, in USDT.deposit_detected: false= nothing new yet; call again later.usdt_ok: false= USDT could not be checked this time (TON was); call again later.- BTC:
POST /v0/my/funds/sync-deposit/btc.
Balance and transactions (any method)
5. Balance. GET /v0/my/funds/check-balance → {"balance": "56.00", "currency": "USDT"}.
6. Transactions. GET /v0/my/funds/transactions?limit=20&offset=0 → {"transactions": [{"nonce", "created_at", "transaction_type", "amount", "currency", "status", "description"}], "total"}; type= filters by transaction_type.
Behind
- Sync looks for new deposits to your address and credits each one once; repeated calls never credit twice.
- TON and BTC are converted to USDT at the current rate; USDT is credited 1:1.
- Only USDT issued by Tether is credited; other tokens sent to your TON address are not.
- A BTC deposit is credited after enough network confirmations: sync again later.
- A Stars payment is credited once, in USDT, right after Telegram confirms it.
Rules
network:tonorbtc; anything else → 400network must be ton | btc. USDT on TON useston.- A check for the same network that is still running or has just run → 429: wait a moment and retry.
- The network check is temporarily unavailable → 400: retry later.
- Telegram Stars: no endpoint; top up with /deposit in https://t.me/CabiChatBot.
API surface
| Endpoint | Purpose | FE | AI / oracle |
|---|---|---|---|
GET /v0/my/funds/wallets |
Deposit addresses + QR | yes | yes |
GET /v0/my/funds/crypto-prices |
Rates | no | yes |
POST /v0/my/funds/sync-deposit/{network} |
Credit new deposits | yes | yes |
GET /v0/my/funds/check-balance |
Balance | yes | yes |
GET /v0/my/funds/transactions |
Ledger | yes | yes |
Index: API pipelines — index