Pay with Gamma

    Pay with Gamma

    Gamma is Bittensor's on-chain service credit. Desearch accepts subnet 22 gamma: 1 gamma = $1.00 of Desearch credits.

    You spend gamma from your own hotkey, and your Desearch balance updates by itself within about 10 minutes. Desearch never holds your keys and cannot pull gamma from your deposit. There is no bonus on gamma, and spent gamma is destroyed on chain, so it cannot be refunded.

    There are two ways to pay:

    One-time top-upFrom subnet emission
    ForAnyone with TAOSubnet owners
    Paid withTAO you mint into gammaUp to 10% of your subnet's emission, every epoch
    You runThree commands, when you want creditsOne setup, then a scheduled spend

    Before you start

    • Install btcli and have the wallet you will pay from. Bittensor's own Gamma guide covers how gamma works on chain.
    • Open Console → Billing → Pay with Gamma. It shows every command below filled in with your amount and keys, and lists your deposits and what has been credited.
    • Desearch's service hotkey on subnet 22 is 5CUu1QhvrfyMDBELUPJLt4c7uJFbi7TKqDHkS1Zz41oD4dyP. Before you spend, check that --service-hotkey matches the one Console shows.

    Gamma is credited to the Desearch account that verified the coldkey of the deposit it was spent from. Do this once, before your first spend. It costs nothing.

    1. In Pay with Gamma, choose Verify Wallet (on the emission tab: Verify the owner coldkey).

    2. Sign the token Console shows with your coldkey:

      BASH
      btcli wallet sign --message '<token from Console>'
    3. Paste your coldkey address and the signature, then choose Verify Wallet.

    One-time top-up

    Enter an amount in US dollars and choose Show commands. Console quotes how much TAO mints that much gamma.

    1. First time only, create a hotkey for the deposit. It needs no TAO and no registration. Do not use a staking hotkey.

      BASH
      btcli wallet new-hotkey -H desearch
    2. Mint gamma from your verified coldkey. Use the TAO amount Console quotes. Gamma left over after the spend stays in your deposit for next time.

      BASH
      btcli gamma mint --netuid 22 --hotkey desearch --amount-tao <TAO from Console> -w <your-wallet>
    3. Spend it at Desearch. The deposit's hotkey signs this, and it pays no fee.

      BASH
      btcli gamma spend --netuid 22 --service-hotkey 5CUu1QhvrfyMDBELUPJLt4c7uJFbi7TKqDHkS1Zz41oD4dyP --amount-gamma <gamma> -H desearch -w <your-wallet>

    Pay from your subnet's emission

    If you own a subnet, part of its emission can buy subnet 22 gamma every epoch. The chain credits that gamma to a deposit at your owner hotkey, and a scheduled spend moves it to Desearch. Set it up once, and your balance fills by itself.

    Subnet 22 must be on the chain's gamma emission whitelist for this to work. Until it is, the chain refuses step 2 with GammaEmissionTargetNotWhitelisted, and Console shows a notice.

    1. Open the From subnet emission tab, enter your netuid and choose Check. Then verify your owner coldkey as in Link your coldkey.

    2. Set the share of your emission that buys gamma, up to 10%. Your owner coldkey signs this. The deposit opens at the first epoch after.

      BASH
      btcli subnets emission set-value --netuid <your netuid> --slot gamma:22 --value 5%
    3. Spend on a schedule with your owner hotkey. This crontab line spends 20 gamma at Desearch every hour, when the deposit holds that much:

      BASH
      0 * * * * /full/path/to/btcli gamma spend --netuid 22 --service-hotkey 5CUu1QhvrfyMDBELUPJLt4c7uJFbi7TKqDHkS1Zz41oD4dyP --amount-gamma 20 -H <owner hotkey name> -w <your-wallet> --yes

    Only your owner hotkey can spend from the deposit, so the machine that runs the schedule needs that hotkey. Keep --yes: without it, btcli asks for confirmation, and under cron nobody answers, so nothing is spent.

    Top up only when the balance runs low

    Instead of a fixed hourly spend, spend only when your Desearch balance drops below a threshold. This script spends 20 gamma when the balance is under $10, and spends nothing when it cannot read the balance:

    BASH
    #!/bin/sh
    balance=$(curl -s https://api.desearch.ai/desearch/balance -H "Authorization: $DESEARCH_API_KEY" \
      | python3 -c 'import json, sys; print(json.load(sys.stdin)["balance_usd"])')
    if [ -n "$balance" ] && awk -v b="$balance" 'BEGIN { exit !(b < 10) }'; then
      /full/path/to/btcli gamma spend --netuid 22 --service-hotkey 5CUu1QhvrfyMDBELUPJLt4c7uJFbi7TKqDHkS1Zz41oD4dyP \
        --amount-gamma 20 -H <owner hotkey name> -w <your-wallet> --yes
    fi

    The credit takes about 10 minutes to arrive. If the script runs again before that, it sees the old balance and spends a second time, so run it every 15 minutes or less often:

    BASH
    */15 * * * * DESEARCH_API_KEY=<your API key> /full/path/to/topup.sh

    Daily spend cap

    A deposit opened by emission has no daily cap, so the owner hotkey can spend all of it at once, and so can anyone who gets that hotkey. To limit what the hotkey can spend per day, set a cap with your owner coldkey:

    BASH
    btcli gamma set-cap --netuid 22 --hotkey <owner hotkey address> --daily-spend-cap-gamma 100

    A cap of 0 pauses the deposit, and --remove-cap (in place of --daily-spend-cap-gamma) removes the limit. A deposit that emission opened before runtime 495 starts with a cap of 0, so it stays paused until you set a cap or remove it.

    Check your balance

    GET /desearch/balance returns what your account can still spend, in US dollars. It is free and does not count as usage. Gamma top-ups show up in it as soon as they are credited.

    BASH
    curl -s https://api.desearch.ai/desearch/balance -H "Authorization: $DESEARCH_API_KEY"
    JSON
    {"balance_usd": 12.5, "currency": "USD"}

    When your balance cannot cover a paid request, that request returns 402 with {"detail": "Insufficient balance"}. The Desearch MCP server has a balance tool that returns the same number.

    Troubleshooting

    • The balance did not change after 10 minutes. Check in Pay with Gamma that the coldkey that owns the deposit is verified in this account, and that --service-hotkey was Desearch's.
    • GammaEmissionTargetNotWhitelisted. Subnet 22 is not on the emission whitelist yet. Use the one-time top-up until it is.
    • The deposit shows "paused (daily cap 0)". Set a cap or remove it, as in Daily spend cap.
    • Refunds. Spent gamma is destroyed on chain, so a gamma top-up cannot be refunded.

    For card and TAO payments, request costs and balance details, see Pricing and Billing.