Inspiration

AI coding agents now write a large share of new code, and they lean on open-source packages all day. They install them, import them and read their docs. But an agent never visits a pricing page or sponsors anyone. In January 2026, Tailwind Labs laid off 75% of its engineers after AI tools sent people around the docs that used to sell its paid product. The usage goes up while the money goes down.

Upstream asks a simple question: what if the agent's own work decided where a developer's open-source budget goes?

What it does

Upstream turns what an AI coding agent actually used into money for the people who maintain it, through PayPal.

  1. Install once. A Claude Code plugin (a session-end hook and an MCP server) links your machine to your Upstream account.
  2. Set a budget. Subscribe for $5, $15 or $50 a month with PayPal, or add money once. You can also just ask your coding agent to add money: it starts the PayPal payment, you approve it in PayPal, and the agent tells you what was added.
  3. Code as usual. When a session ends, the plugin builds a receipt on your machine from what the agent installed, imported and wrote. Only package names and counts leave the machine, never code or prompts.
  4. AI weighs the work. Gemini judges how much the session depended on each package ("your whole API layer is built on it"), inside fixed limits it can't break.
  5. You approve. You see the receipt in the agent (/upstream:receipt) or on the dashboard, and approve it, or let a rule approve it while you have money in your budget.
  6. Maintainers get paid. Your budget is split across your receipts, then across each package's maintainers (the people its FUNDING.yml names, or its recent committers), to the cent. Maintainers sign in with GitHub, link a verified PayPal account with Log in with PayPal, and are paid through PayPal Payouts.

Try it: the hosted sandbox demo at https://upstream-0s2y.onrender.com gives you your own demo account, with a recorded Claude Code session to run, approve and settle.

Watch: the 2-minute demo video, which ends with a real sandbox payout reaching a maintainer.

Install: npx upstream-pay init, from the upstream-pay package on npm.

The dashboard shows each receipt with the AI's reasons, what settling today would give each package, and where every cent went: waiting for a maintainer to join, on its way through PayPal, or paid. The landing page's "Agent usage vs funding" chart sets each package's share of agent work, from real Claude Code sessions, against its share of the money.

How we built it

  • PayPal, all in the sandbox: Subscriptions with Catalog products and billing plans, Orders v2 for one-time top-ups, the JavaScript SDK v6 buttons, Payouts to each maintainer's verified PayPal account id, Webhooks for payments, refunds and payout statuses, and Log in with PayPal for maintainers. PayPal's Agent Toolkit (orders create, get and capture only) sits behind the MCP tools that let the agent start a payment that only the developer can approve.
  • AI: Gemini (gemini-2.5-flash-lite) as the attribution judge, with guardrails: it can't add packages, can't raise a package past twice what its evidence supports, and falls back to an evidence-only score, labelled "estimated without AI", when it's unavailable. Every receipt keeps the model id, prompt version and raw answer.
  • The agent side: a Claude Code plugin with a session-end hook and an MCP server, published on npm as upstream-pay, plus upstream scan --diff for any other agent.
  • Render: the web app, Postgres and two cron jobs come from one render.yaml Blueprint. Render Workflows run the AI judge, every settlement (including the demo's "Settle now") and the daily payout check as tasks, with Render's retries and run history. A small budget guard (GitHub Actions and the Render API) suspends everything before the hackathon credit could run out.
  • The app: a TypeScript pnpm workspace with Next.js 16, Drizzle and Postgres, and Tailwind with shadcn/ui. More than 380 automated tests, including settlement maths and a fake PayPal that behaves like the real API.

Challenges we ran into

Moving other people's money had to be boringly correct:

  • Exact amounts: all amounts are whole cents, split with the largest-remainder method, so every split adds up exactly.
  • No double spending or paying: a database lock keeps two settlements from spending the same budget, each payout batch is claimed before it's sent, and PayPal's sender_batch_id makes a retry safe.
  • The right person: money follows the GitHub account id, not the username, so a renamed or reused login can't redirect it.
  • Self-dealing controls: no payout to a developer's own PayPal account, at most $100 a month from one developer to one maintainer, and a week's hold before a new maintainer's first payout (an hour on the hosted sandbox demo, as the site says, so you can watch a payout land).
  • Money never sits forever: refunds come back out of the budget, and money nobody claims in 90 days goes back to the developer.

What we learned

An agent's transcript is a surprisingly honest record of what a project depends on. And an AI judge is only trustworthy with hard limits around it and an audit trail behind it.

What's next

Transitive dependencies (the deep xz-style packages nobody sees), team budgets for companies that make Open Source Pledge style commitments, and native plugins for more agents. Running this with real money would need PayPal's approval for live Payouts and its multiparty (marketplace) setup.

Built With

Share this project:

Updates

Submission history