btgamma
Use any Bittensor subnet's gamma-paid service through one local URL. btgamma holds your spending hotkey, signs each request (btauth/1) and forwards it.
Status: alpha. A signing proxy with manual top-ups; btgamma never touches your coldkey.
Usage
Install (Python 3.13):
$ uv tool install btgamma
Start the proxy with an unencrypted sr25519 hotkey (or set BTGAMMA_HOTKEY_SEED instead):
$ btgamma start --hotkey ~/.bittensor/wallets/<wallet>/hotkeys/<hotkey>
btgamma http://127.0.0.1:8402 hotkey 5F… finney
Point any client at a service's route. SN28 (SayGM) is OpenAI-compatible:
$ OPENAI_BASE_URL=http://127.0.0.1:8402/sn/28/api/v1 OPENAI_API_KEY=unused my-agent
$ curl http://127.0.0.1:8402/sn/28/api/v1/models
The proxy strips the placeholder API key and signs each request with the hotkey. Open
http://127.0.0.1:8402/ for the dashboard. Other commands talk to the running daemon:
btgamma services (every route), btgamma status (deposits, credit, spends),
btgamma topup sn28 1 (spend 1 gamma at SN28's service), btgamma trust snN,
btgamma refresh, and btgamma config get|set (settings in ~/.btgamma/config.toml). Add
--json to any of them. To require a token from local clients, run
btgamma config set auth.token=required and pass btgamma token as the API key.
For retry-safe top-ups, add --idempotency-key REQUEST_ID; POST /_gamma/topup accepts the same
value as idempotency_key. A finalized spend remains credit_pending until the service balance
shows the credit or the configured timeout passes (default 120 seconds); set it with
btgamma config set limits.credit_timeout=240.
MCP
The daemon is also an MCP server at http://127.0.0.1:8402/_gamma/mcp (streamable HTTP; MCP
2026-07-28, plus the initialize-based 2025-03-26 to 2025-11-25 for older clients). Its tools:
list_services, service_details, status, spends and call_service, which sends one
request through the proxy, so it is signed and paid like any other. topup is offered only
after btgamma config set mcp.allow_topup=true. Start the daemon first (btgamma start); every
client shares its one hotkey.
Claude Code:
$ claude mcp add --transport http btgamma http://127.0.0.1:8402/_gamma/mcp
Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project):
{"mcpServers": {"btgamma": {"url": "http://127.0.0.1:8402/_gamma/mcp"}}}
Claude Desktop speaks stdio, so it runs btgamma mcp, a bridge that relays to the running
daemon and never loads the hotkey. In claude_desktop_config.json (Settings > Developer > Edit
Config), use the full path that which btgamma prints:
{"mcpServers": {"btgamma": {"command": "/Users/you/.local/bin/btgamma", "args": ["mcp"]}}}
With auth.token=required, HTTP clients send the token as a header: add
--header "Authorization: Bearer $(btgamma token)" to claude mcp add, or
"headers": {"Authorization": "Bearer <token>"} in Cursor. btgamma mcp reads it itself.
Metadata
Release files for btgamma 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| btgamma-0.1.0.tar.gz | 131.3 kB | With provenance | Details for btgamma-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| btgamma-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for btgamma-0.1.0-py3-none-any.whl |
Total release size: 281.7 kB
Release files / btgamma-0.1.0.tar.gz
| Download URL | btgamma-0.1.0.tar.gz |
|---|---|
| Size | 131.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6a121d539b72868ba6f07e945fc5228d66038605ffdbeae2522d32ac9a72440
|
|
BLAKE2b-256 checksum How to use checksums |
b3cfb02bef5ac8cecb0b959b0e3fde3d6b75d61be17328efc8eb00beddbff830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / btgamma-0.1.0-py3-none-any.whl
| Download URL | btgamma-0.1.0-py3-none-any.whl |
|---|---|
| Size | 150.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a9172f4267eca69df3588b9fd29321505985ec47f43f1a4047bdbf4463edbc8
|
|
BLAKE2b-256 checksum How to use checksums |
68efee6b7291cfd22925a8380f23bea375e957543064727a19a61b82bd5b70a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for btgamma 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for btgamma-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.