Pipeline de API: recargar tu saldo con Telegram Stars, TON, USDT en TON o BTC

Objetivo: añadir dinero a tu saldo de Cabi.Chat con Telegram Stars (en el bot de Cabi.Chat) o en cripto (TON, USDT en TON o BTC) y ver tus transacciones. El saldo se lleva en USDT; con él se pagan Pro y los planes, y el uso de IA se muestra en el gasto de IA: Pipeline de API: ver tu gasto en IA

Telegram Stars: en el bot, no por la API

La forma más sencilla si usas Telegram. No hay llamada de API para recargar con Stars: el pago se hace en Telegram y el saldo se acredita sin ninguna llamada tuya.

  1. Antes necesitas una cuenta de Cabi.Chat y haber iniciado sesión con Telegram: Pipeline de API: iniciar sesión en Cabi.Chat con Telegram
  2. En Telegram, abre https://t.me/CabiChatBot y envía /deposit.
  3. Elige un paquete; la factura muestra cuánto suma a tu saldo. Págala con Stars.
  4. El bot confirma el importe acreditado y tu nuevo saldo. Por la API lo ves en el saldo (paso 5) y como depósito en tus transacciones (paso 6).

Cripto: TON, USDT en TON o BTC

1. Tus direcciones de depósito.

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,…"}}

Tu dirección TON recibe tanto TON como USDT en TON. La primera vez: abre https://t.me/CabiChatBot y envía /start; después aparecen tus direcciones.

2. Cotizaciones (opcional). GET /v0/my/funds/crypto-prices → {"ton": 3.1, "btc": 61000.0, "usdt": 1.0} (USD).

3. Envía TON o USDT a tu dirección TON, o BTC a tu dirección BTC, desde cualquier billetera. Envía USDT solo por la red TON.

4. Acredítalo. TON y USDT en TON se comprueban con la misma llamada ton:

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"}

Saldo y transacciones (cualquier método)

5. Saldo. GET /v0/my/funds/check-balance → {"balance": "56.00", "currency": "USDT"}.

6. Transacciones. GET /v0/my/funds/transactions?limit=20&offset=0 → {"transactions": [{"nonce", "created_at", "transaction_type", "amount", "currency", "status", "description"}], "total"}; type= filtra por transaction_type.

Detrás

Reglas

Superficie de la API

Endpoint Para qué FE IA / oráculo
GET /v0/my/funds/wallets Direcciones de depósito + QR sí sí
GET /v0/my/funds/crypto-prices Cotizaciones no sí
POST /v0/my/funds/sync-deposit/{network} Acreditar depósitos nuevos sí sí
GET /v0/my/funds/check-balance Saldo sí sí
GET /v0/my/funds/transactions Movimientos sí sí

Índice: Pipelines de API — índice

Mentioned