bridgenode-llm
BridgeNode Python SDK — AI inference without API keys. Payment: Solana USDC via x402 (automatic handshake, fee sponsorship — no SOL needed for the agent).
Installation
pip install bridgenode-llm
Usage
from bridgenode_llm import LLMClient
client = LLMClient() # key from .env (BRIDGENODE_WALLET_KEY)
resp = client.chat("deepseek-v4-flash", [
{"role": "user", "content": "Hello!"}])
print(resp["choices"][0]["message"]["content"])
Everything is handled automatically: 402 → partial TX → PAYMENT-SIGNATURE → 200 (§4.1). No API key required.
.env
# Required — your Solana wallet private key (base58)
BRIDGENODE_WALLET_KEY=...
# Optional:
# BRIDGENODE_BASE_URL=https://bridgenode.cc/v1
# BRIDGENODE_MAX_PER_CALL=0.05 # spending policy: max USD per call (fail-closed)
# BRIDGENODE_DAILY_CAP=1.0 # spending policy: max USD per day
Security
- Receipt verification (Free-Riding protection): after 200,
PAYMENT-RESPONSEis verified — success, network, payer, fee payer signature over our TX message, amount. Invalid receipt →BridgenodeError. - Spending policy (fail-closed):
BRIDGENODE_MAX_PER_CALL+BRIDGENODE_DAILY_CAP— checked BEFORE signing; exceeded → blocked, no payment. - SIWX: automatic known-agent identification (§5.7) — falls back to payment if auth fails.
Commands
client.chat(model, messages, max_tokens=..., mode="auto") # mode: auto/eco/premium
Requirements
- Python ≥ 3.11
- Solana wallet with USDC ATA (rent — agent's responsibility, §3.3)
Links
- Website: https://bridgenode.cc
- Protocol: x402 V2 (docs.x402.org)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bridgenode_llm-0.2.7.tar.gz
(15.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bridgenode_llm-0.2.7.tar.gz.
File metadata
- Download URL: bridgenode_llm-0.2.7.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec238d0b9fd0a5568d1b2f628bff0bc660ce2e4861166df6edc017173411c7dd
|
|
| MD5 |
6faa63f35ddeff2ea55b215665ce5275
|
|
| BLAKE2b-256 |
a1f5de621817de85a47916001b0b0b8014a13663534d713f1b2402e077a8c9be
|
File details
Details for the file bridgenode_llm-0.2.7-py3-none-any.whl.
File metadata
- Download URL: bridgenode_llm-0.2.7-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760363a6bb1649c8298dac46b0f6d13353cb751f956e950b65ca2cea4ab3bb5e
|
|
| MD5 |
7943f8f4e27e4d4d1758ec6036786828
|
|
| BLAKE2b-256 |
65080901a8003e075e4420f2dcafa608093160579812926ffeba5ed6e2bf603f
|