Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ All notable changes to blockrun-llm will be documented in this file.

## Unreleased

## 1.24.2 — 2026-11-28

### Removed
- **The BlockRun testnet is gone.** `testnet.blockrun.ai` (Base Sepolia,
chain 84532) was retired on 2026-10-02 and no longer resolves, so the SDK
stops offering it. Nothing is removed from the import surface:
- `testnet_client()` and `async_testnet_client()` stay importable and in
`__all__`, but calling them raises `RetiredEndpointError` naming the
retirement date and the replacement, `LLMClient()` / `AsyncLLMClient()`
on Base mainnet. `async_testnet_client()` is now a plain function, so it
raises at the call whether or not the result is awaited.
- `validate_api_url()` refuses the `testnet.blockrun.ai` host with the same
error, so `LLMClient(api_url="https://testnet.blockrun.ai/api")`,
`BLOCKRUN_API_URL` set to it, and every other client fail at construction
instead of with a DNS error on the first request.
- `LLMClient.TESTNET_API_URL` / `AsyncLLMClient.TESTNET_API_URL` are kept as
deprecated attributes; `is_testnet()` is kept and always returns `False`.
`get_balance()` always reads Base mainnet, and a 402 without a `network`
defaults to `eip155:8453`.
- Base Sepolia stays in the x402 chain table (`EVM_NETWORKS`), so the signer
can still pay a 402 from any other server that names it.
- For development without spending USDC, use the free models
(`routing_profile="free"`): they settle $0, so an unfunded wallet works.

### Docs
- README: the "Testnet Usage" section, the testnet model table and the Base
Testnet row of the chains table are replaced by a short "Testnet (retired)"
note with the one-line migration. The API-key section no longer mentions a
`get_balance_testnet()` helper the SDK never had.
- llama-index-llms-blockrun: the `api_url` example is now Circle Arc
(`https://arc.blockrun.ai/api`) instead of the retired testnet.

## 1.24.1 — 2026-11-27

### Changed
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ blockrun_llm/

- Base Mainnet (primary) — USDC
- Arc (Circle, chain 5042) — USDC, via `api_url="https://arc.blockrun.ai/api"`; same `LLMClient` and key
- Base Sepolia (testnet) — Testnet USDC
- Solana Mainnet — USDC SPL

The Base Sepolia testnet (testnet.blockrun.ai) was retired on 2026-10-02. `testnet_client()` / `async_testnet_client()` stay importable but raise `RetiredEndpointError`, and `validate_api_url` refuses that host.

The EVM domain signed follows the 402's `network` through `EVM_NETWORKS` in `blockrun_llm/x402.py`; a 402's `extra` is never trusted for it, an unknown network and a non-USDC `asset` are refused.

## Conventions
Expand Down
58 changes: 12 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
| **Solana** | Solana Mainnet | USDC (SPL), gasless — the facilitator pays the fee | ✅ Recommended for x402 |
| **Base** | Base Mainnet (Chain ID: 8453) | USDC | ✅ |
| **Arc** | Circle Arc (Chain ID: 5042) — `arc.blockrun.ai` | USDC (Arc's native token), settled by Circle — no gas per call | ✅ |
| **Base Testnet** | Base Sepolia (Chain ID: 84532) | Testnet USDC | ✅ Development |

**Protocol:** x402 v2 on the wallet rails; plain bearer auth on the API-key rail.

Expand Down Expand Up @@ -381,7 +380,7 @@ overrides the account-rail host; it is deliberately not `BLOCKRUN_API_URL`,
which names an x402 gateway — an API-key client following that would send your
key to a host configured for a different rail.

**What changes.** `get_balance()`, `get_balance_testnet()` and `onramp()` raise
**What changes.** `get_balance()` and `onramp()` raise
a `ValueError` pointing at the dashboard rather than answering: returning `0`
is indistinguishable from an empty wallet, and an agent gating on it would stop
calling a well-funded account. `get_wallet_address()` returns `""`. Running out
Expand Down Expand Up @@ -456,7 +455,7 @@ fixed quote. With `"auto"`, the gateway lists `exact` first; upto is taken only
when all of these hold:

- the 402 offers an EVM `upto` requirement with `extra.facilitatorAddress`, for
USDC on a network the SDK signs on (Base, Base Sepolia);
USDC on Base;
- your wallet holds at least the ceiling in USDC;
- Permit2 can already pull the ceiling from your wallet, **or** the gateway
declares the `eip2612GasSponsoring` extension. In that case the SDK also signs
Expand Down Expand Up @@ -713,16 +712,6 @@ The <!-- br:models.free -->8<!-- /br:models.free --> free models are listed unde
[Try It Free](#try-it-free-no-balance-required). Pin them by full model id, or
use `routing_profile="free"`.

### Testnet Models (Base Sepolia)
Live per-model prices: [blockrun.ai/pricing](https://blockrun.ai/pricing) (agents: `GET https://blockrun.ai/api/v1/models`). Prices are not copied here, so this page never goes stale on a reprice.

| Model |
| ------- |
| `openai/gpt-oss-20b` |
| `openai/gpt-oss-120b` |

*Testnet models use flat pricing (no token counting) for simplicity.*

### Verifying Models End-to-End

The SDK ships two runnable sweep scripts under `examples/`:
Expand Down Expand Up @@ -1612,46 +1601,23 @@ for model in models:
print(f"{model['id']}: ${model['inputPrice']}/M input, ${model['outputPrice']}/M output")
```

## Testnet Usage

For development and testing without real USDC, use the testnet:

```python
from blockrun_llm import testnet_client

# Create testnet client (uses Base Sepolia)
client = testnet_client() # Uses BLOCKRUN_WALLET_KEY

# Chat with testnet model
response = client.chat("openai/gpt-oss-20b", "Hello!")
print(response)

# Check testnet USDC balance
balance = client.get_balance()
print(f"Testnet USDC: ${balance:.4f}")
```

### Testnet Setup
## Testnet (retired)

1. Get testnet ETH from [Alchemy Base Sepolia Faucet](https://www.alchemy.com/faucets/base-sepolia)
2. Get testnet USDC from [Circle USDC Faucet](https://faucet.circle.com/)
3. Set your wallet key: `export BLOCKRUN_WALLET_KEY=0x...`

### Available Testnet Models

- `openai/gpt-oss-20b` (flat price per request)
- `openai/gpt-oss-120b` (flat price per request)

### Manual Testnet Configuration
BlockRun's testnet (`testnet.blockrun.ai`, Base Sepolia) was retired on
2026-10-02. `testnet_client()` and `async_testnet_client()` are still
importable but raise `RetiredEndpointError`, as does any client pointed at
`https://testnet.blockrun.ai/api`. Use the mainnet client instead:

```python
from blockrun_llm import LLMClient

# Or configure manually
client = LLMClient(api_url="https://testnet.blockrun.ai/api")
response = client.chat("openai/gpt-oss-20b", "Hello!")
client = LLMClient() # was: testnet_client()
```

To develop without spending USDC, use the free models under
[Try It Free](#try-it-free-no-balance-required): they settle $0, so an
unfunded wallet works.

## Billing & Cost Tracking

Every paid call appends one line to `~/.blockrun/cost_log.jsonl` capturing
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.1
1.24.2
4 changes: 2 additions & 2 deletions blockrun_llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
create_wallet as generate_wallet, # User-friendly alias
)

__version__ = "1.24.1"
__version__ = "1.24.2"
__all__ = [
"DECISIONS_DEFAULT_MODEL",
"DEFAULT_API_KEY_URL",
Expand Down Expand Up @@ -336,6 +336,6 @@
# Entry point for agents (auto-creates wallet)
"setup_agent_wallet",
"status",
# Testnet convenience functions
# Retired testnet helpers: importable, raise RetiredEndpointError when called
"testnet_client",
]
5 changes: 4 additions & 1 deletion blockrun_llm/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def _add_filter_args(p: argparse.ArgumentParser) -> None:
"--network",
type=str,
default=None,
help="filter to one network (base-mainnet / base-sepolia / solana-mainnet)",
help=(
"filter to one network (base-mainnet / solana-mainnet; base-sepolia on "
"records from the testnet, retired 2026-10-02)"
),
)


Expand Down
Loading
Loading