Metadata-Version: 2.4
Name: bridgenode-llm
Version: 0.2.6
Summary: BridgeNode LLM client — AI inference su x402 mokėjimu (Solana USDC). Jokių API key, jokio auth.
Author-email: BridgeNode <eli.BNx@proton.me>
License-Expression: MIT
Project-URL: Homepage, https://bridgenode.cc
Project-URL: Repository, https://github.com/applefanaimail-blip/bridgenode-llm
Project-URL: Documentation, https://bridgenode.cc/llms.txt
Keywords: x402,solana,usdc,ai,llm,mcp,agents,payment,bridgenode
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: x402[svm]>=2.18.0
Requires-Dist: x402[extensions]>=2.18.0
Requires-Dist: solana<0.40,>=0.36.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: python-dotenv>=1.2.2
Provides-Extra: dev
Requires-Dist: pytest>=9.1.1; extra == "dev"

# bridgenode-llm

BridgeNode Python SDK — AI inference be API key. Mokėjimas: **Solana USDC per x402** (automatinis handshake, fee sponsorship — agentui SOL nereikia).

## Diegimas

```bash
pip install bridgenode-llm
```

## Naudojimas

```python
from bridgenode_llm import LLMClient

client = LLMClient()  # raktas iš .env (BRIDGENODE_WALLET_KEY)
resp = client.chat("deepseek-v4-flash", [
    {"role": "user", "content": "Labas!"}])
print(resp["choices"][0]["message"]["content"])
```

Viskas paslėpta: `402 → dalinis TX → PAYMENT-SIGNATURE → 200` (§4.1). Jokio API key.

## .env

```bash
# Privalomas — jūsų Solana wallet private key (base58)
BRIDGENODE_WALLET_KEY=...
# Neprivalomi:
# 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
```

## Apsaugos

- **Kvito verifikacija (Free-Riding apsauga):** po 200 tikrinamas `PAYMENT-RESPONSE` — success, network, payer, fee payer'io parašas per mūsų TX žinutę, amount. Netikras kvitas → `BridgenodeError`.
- **Spending policy (fail-closed):** `BRIDGENODE_MAX_PER_CALL` + `BRIDGENODE_DAILY_CAP` — tikrinama PRIEŠ pasirašant; viršijus → blokuota, jokio mokėjimo.
- **SIWX:** automatinis žinomo agento identifikavimas (§5.7) — fallback į payment jei auth failina.

## Komandos

```python
client.chat(model, messages, max_tokens=..., mode="auto")  # mode: auto/eco/premium
```

## Reikalavimai

- Python ≥ 3.11
- Solana wallet su USDC ATA (rent — agento atsakomybė, §3.3)

## Nuorodos

- Tinklalapis: https://bridgenode.cc
- Protokolas: x402 V2 (docs.x402.org)
