Proxy Peer Sharing
Your proxy pool has 5-hour and 7-day windows that often go unused. Someone else's pool runs out. Peer sharing lets the first lend to the second — on the lender's terms, revocable at any moment.
Each person runs their own neurolink proxy. There is no central server: a
lender exposes their proxy and issues a grant; a borrower adds it as a
peer and reaches for it only once their own accounts are spent.
Before you share. Lending subscription capacity to other people is very likely outside your provider's consumer terms, and the account carrying the traffic is the one exposed. This is a deliberate choice, not a default.
Quick start
Lender:
# 1. Start the proxy as usual. Your own client keeps using this port.
neurolink proxy start --port 3000
# 2. Issue a grant. This brings up the gate-only share listener on 3001,
# which refuses every request that carries no token.
neurolink proxy share create --peer bob --preset spare
# 3. Publish that listener — not the main port — and re-mint the link
# against the URL it prints.
neurolink proxy expose
neurolink proxy share url https://your-tunnel.trycloudflare.com
neurolink proxy share rotate --peer bob
Borrower:
neurolink proxy peer add --name alice --link "neurolink://share/...#nls_..."
neurolink proxy peer test --name alice
That is the whole loop. The borrower's own accounts keep serving as before; the peer is consulted only when none of them can.
Gates
Sharing is not a menu of modes. A grant carries one set of gates, all of which must pass. The effective allowance is the tightest of them, so a grant can lend spare headroom and cap the total and restrict the model, all at once.
| Gate | Flag | Means |
|---|---|---|
| Reserve floor | --reserve 30 | Admit only while your own utilization leaves 30% headroom |
| Window slice | --max-slice 5h=20,7d=15 | At most a fifth of the pool, however it is spread |
| Per-account slice | --max-slice-per-account 20 | The same ceiling applied to each account independently |
| Spillover | --spillover 12h\<60@25 | Lend in the last 12h before a reset if under 60% used, capped 25% |
| Model allowlist | --models sonnet haiku | Never Opus |
| Account subset | --accounts [email protected] | Only this account of yours is lendable |
| Rate | --rate 20/min --concurrency 2 | Request and in-flight ceilings |
| Schedule | --schedule 21-9 | Night shift only (wraps midnight) |
| Expiry | --expires 7d | Hard stop |
The reserve floor is the one that protects you: as you get busy, the borrower is squeezed out automatically without you doing anything.
How the percentages are counted on a multi-account pool
The two ceilings are deliberately scoped differently:
- Reserve floor is per-account. Each account must independently keep the headroom you asked for. Pooling it would let a borrower drain one account to nothing while the others sat untouched.
- Slice is pool-wide. Consumption is summed across accounts and divided by
the account count, so
--max-slice 20means a fifth of your total capacity — the same number whether the borrower takes it from one account or spreads it over ten.
poolFraction = ( Σ borrowed fraction per account ) / number of accounts
Three accounts at 10% each is 10% of the pool, not 30%. Once the pool ceiling is reached the borrower is refused on every account, including idle ones — that is what a ceiling on the whole means.
A complete share draws on exactly one account, so the pool figure and the per-account figure are the same number there.
Use --max-slice-per-account when you genuinely mean "this much of every
credential, independently".
Presets
| Preset | What it sets |
|---|---|
spare | 30% reserve floor and a 20% window slice, unlimited ledger |
spillover | Last 12h before a reset, under 60% used, capped at 25% |
metered | Coin ledger with a 25% 5h slice |
open | 10% reserve floor and 60 requests/minute, unlimited ledger |
Any explicit flag overrides the preset, so --preset spare --reserve 50 is the
preset with a tighter floor.
NeuroCoins
A grant is either unlimited (bounded only by the gates) or metered in coins.
1 coin = 1,000 normalized tokens. Usage is weighted before conversion, so a coin means roughly the same amount of value regardless of request shape:
| Component | Weight |
|---|---|
| Input tokens | ×1 |
| Output tokens | ×4 |
| Cache creation | ×1.25 |
| Cache read | ×0.1 |
then multiplied by the model tier — Haiku ×0.25, Sonnet ×1, Opus and Fable ×5. An unrecognised model weighs ×1.
neurolink proxy share create --peer bob --ledger coins --coins 500 --refill 100/week
neurolink proxy share topup --peer bob --coins 200
neurolink proxy share set --peer bob --coins 0 # cut off without revoking
Coins are pre-authorized at admission and settled from real usage when the response completes. Without that, several concurrent streams would each pass the same balance check and overspend.
A request is admitted while the balance is above zero, not while it covers the whole estimate — so a grant can overshoot by at most one in-flight request. That is deliberate: the estimate is conservative, and refusing someone's last small request because a worst-case guess exceeded their balance is worse than a bounded overshoot.
Coins and gates are independent: a coin balance is an entitlement ceiling, the reserve floor is an availability gate. Both apply. Granting 500 coins does not promise capacity that your own week has already consumed.
Controlling a live share
neurolink proxy share list
neurolink proxy share status --peer bob
neurolink proxy share pause --peer bob # stops at the next request
neurolink proxy share resume --peer bob
neurolink proxy share revoke --peer bob # permanent for that token
neurolink proxy share rotate --peer bob # new token, same controls
Every one of these takes effect on the borrower's next request — no restart.
What the borrower sees
The lender answers a refusal with headers that say precisely what happened, so a borrower can tell "you are out of credit" from "the upstream throttled me":
| Header | Meaning |
|---|---|
x-neurolink-grant-status | active, paused, exhausted, revoked, expired, out-of-window |
x-neurolink-grant-reason | The precise refusal, e.g. slice_exhausted |
x-neurolink-grant-remaining-coins | Balance left on a metered grant |
retry-after | When coming back is worth anything |
The borrower parks a peer for a duration matched to the reason — minutes for a transient problem, until the next window for an exhausted grant, a day for a revoked one.
Asking before spending
These routes let a borrower ask questions that cost nothing. All authenticate with the share token, none touches an account, and none is subject to the grant's rate or coin ceilings — they exist to ask whether spending is possible.
| Route | Answers |
|---|---|
GET /peer/handshake | Protocol version, node capabilities, and this grant's lifecycle state |
GET /peer/limits | Remaining coins, slice left per window, whether anything can serve you now |
POST /peer/heartbeat | Complete shares only: report spend, collect a refreshed lease or a stop |
GET /peer/receipts | Signed statements of what you were charged, ?since=<sequence> |
POST /peer/net | Settle one round of reciprocal netting |
POST /peer/note | Check a coin note, or redeem it into your balance |
/peer/limits is scoped to the caller's own grant. It carries no account
labels and no per-account figures, so it cannot be used to describe — or count —
the lender's pool.
Privacy
Borrowed traffic is somebody else's conversation, so on the lender's node:
- Request and response bodies are never captured for a borrowed request.
x-neurolink-accountand the pool counters are stripped from borrowed responses — that header carries the lender's account label, which for an OAuth account is their email address.GET /limitsis refused for borrowed traffic. The operator view names every account and its quota; a borrower gets/peer/limitsinstead./statusreleases account identity only to the update-control token once the gate is on, since a gated proxy is by definition one that may be exposed.
The borrower still receives the quota and grant headers their routing needs.
Ordering
A borrower's request falls through in this order:
- Its own accounts, in the usual quota-aware order.
- Peers, by priority — same models, same wire format, one extra hop.
- The configured provider fallback chain (Gemini, OpenAI, …), which answers as a different model.
A node with no accounts at all still borrows: peers are tried before the "no credentials" error is returned.
A borrowed request is never forwarded on to another peer. Chaining a lend onto a lend would spend a third party's capacity under a grant that says nothing about them.
Two levels of sharing
Everything above describes live sharing: the borrower forwards each request through your proxy, so your gate is in the request path and your credentials never leave your device. It is the default and the right choice for most people.
Complete sharing trades that for availability. The borrower holds its own credential on your account and calls the provider directly, so it keeps working when your laptop is shut.
| Live | Complete | |
|---|---|---|
| Your credentials leave your device | No | Yes — a separate, independent grant |
| Works while you are offline | No | Yes, until the lease's grace runs out |
| Revocation | Instant, next request | Next heartbeat; grace period at worst |
| Enforcement | Cryptographic | Cooperative, plus after-the-fact audit |
| Extra latency | One hop | None |
| You can see their prompts | Yes (never captured to disk) | No |