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.0

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.0
File Size Uploaded
bridgenode_llm-0.3.0.tar.gz 25.2 kB Details

Built distribution (wheel)

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

Total release size: 39.8 kB

Release files / bridgenode_llm-0.3.0.tar.gz

Download URL bridgenode_llm-0.3.0.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ee751496cfd4eb44abb736de44bd1bd6985e8ce2ec9da61ee41f86e2cff30957
BLAKE2b-256 checksum
How to use checksums
ef9fb07da1f6bbf1612fa2965b9efbcb39920f542f974791dc22f2dd48903987
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.0-py3-none-any.whl

Download URL bridgenode_llm-0.3.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f32c93af5df95e57501218864ed4236e833e8faff32b8cfcaa7bc798996d7da
BLAKE2b-256 checksum
How to use checksums
1d69c15ce91eff1f29e2d0b90334b5f152c813c472d3c1254228cc85b9d11e01
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

0.3.1

2 release files

This release

0.3.0 This release

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