Skip to main content

bridgenode-llm

PyPI version Downloads License: MIT-0 Python versions CI BridgeNode on x402-list GitHub Stars

BridgeNode Python SDK — AI inference for AI agents, no API keys. Pay per request with Solana USDC via x402. The payment handshake is fully automatic, and fees are sponsored — the agent needs no SOL.

Features

  • Start free, no wallet — free models run without payment, and the first 2 calls to a paid model are free per client (free trials); a wallet is needed only after that
  • No API keys, no registration — pay per request with USDC
  • Automatic x402 handshake — 402 → signed transaction → 200, fully hidden
  • Fee sponsorship (gasless) — the agent needs zero SOL
  • Fail-closed spending policy — per-call and daily caps checked before signing
  • Receipt verification — every response receipt is verified (invalid → error)
  • Smart routingmode: auto / eco / premium (model selection per prompt complexity)
  • MCP support — BridgeNode is also available as an MCP server

BridgeNode vs traditional APIs

BridgeNode Traditional AI APIs
Sign-up None Account + verification
API key Not needed Required (leak risk)
Billing Pay-per-request (USDC) Subscription / prepaid credits
Setup Wallet only SDK + key + quotas
Fees Gas sponsored Network fees on you
Spending control Fail-closed caps Account-level limits
Identity Wallet signature (SIWX) API key

Installation

pip install bridgenode-llm

Or install the full toolkit (SDK + CLI):

pip install bridgenode

Usage

from bridgenode_llm import LLMClient

client = LLMClient()  # wallet key from .env (BRIDGENODE_WALLET_KEY) — optional
resp = client.chat("deepseek-flash", [
    {"role": "user", "content": "Hello!"}])
print(resp["choices"][0]["message"]["content"])

Everything is handled automatically: payment, retry, receipt verification. No API key required.

Free path — no wallet needed

Free models ("free": true in GET /v1/models) run without payment, and a client that has never called BridgeNode gets 2 free calls on PAID models (free trials) — real inference before any wallet exists. BRIDGENODE_WALLET_KEY is read lazily: it is required only when a request actually reaches the payment wall, and then the SDK raises one actionable error instead of a broken handshake. The remaining trial count is exposed after every call:

client = LLMClient()          # no wallet required for the free path
resp = client.chat("gpt-oss-120b", [{"role": "user", "content": "hi"}])
print(client.last_trials_remaining)   # None for free models, 1 → 0 for trials

Smart routing

# Let BridgeNode pick the model: auto / eco / premium
resp = client.chat(None, "Explain quantum computing", mode="auto")

Configuration (.env)

# Optional — your Solana wallet private key (base58).
# Needed only for PAID requests: free models and the 2 free trials work without it.
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: after each response, the payment receipt is verified (success, network, payer, signature over your transaction, amount). Invalid receipt → BridgenodeError.
  • Spending policy (fail-closed): BRIDGENODE_MAX_PER_CALL + BRIDGENODE_DAILY_CAP are checked BEFORE signing; exceeded → blocked, no payment.
  • SIWX: automatic known-agent identification — falls back to payment if auth fails.

Requirements

  • Python ≥ 3.11
  • A Solana wallet with a USDC token account (ATA) — only for PAID requests; the free path (free models + free trials) needs no wallet

FAQ

Do agents need SOL? No — fees are sponsored. The agent pays only the USDC request amount.

Is there an API key? No. Your wallet signature is the identity (SIWX); payment is the access.

Can an agent try it without a wallet? Yes — free models and the first 2 calls to a paid model per client are free, over HTTP, MCP and both SDKs.

What happens if the spending cap is exceeded? The request is blocked before signing — fail-closed, no payment is made.

Which models are available? See https://bridgenode.cc/v1/models (live list with prices).

How is the payment receipt verified? Every response includes a receipt; the SDK verifies its signature, network, payer and amount — invalid receipts raise BridgenodeError.

Can I use this in CI / headless agents? Yes — no browser, no keys, just a wallet private key in env.

Related packages

The BridgeNode toolkit on PyPI:

Links

Community

Star this repo — it helps AI agents discover BridgeNode.

Release files for bridgenode-llm 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bridgenode-llm 0.3.1
File Size Uploaded
bridgenode_llm-0.3.1.tar.gz 25.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bridgenode-llm 0.3.1
File Interpreter ABI Platform
bridgenode_llm-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.7 kB

Release files / bridgenode_llm-0.3.1.tar.gz

Download URL bridgenode_llm-0.3.1.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
83a1e3853d44e9243c1e8b45962eb33341deb2d4d529773429d9e98d767e26f3
BLAKE2b-256 checksum
How to use checksums
a59d9922d6b59dc2beebbcb63676ed91fb9df71dec1d902eaae612213976870b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 10, 2026.

Transparency log

Release files / bridgenode_llm-0.3.1-py3-none-any.whl

Download URL bridgenode_llm-0.3.1-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68df714dae1148a64ce11cec32a63211c5afa0dac078cb8f0b6d6f8957da5a2e
BLAKE2b-256 checksum
How to use checksums
6d994a15216e96881a68076d5d52586a928aa2627dfc31db35850fdcf0264b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page