Inspiration
A photographer licenses a photo for one use. The client later wants more: the same picture on printed menus, on a website, in a paid ad. Most of the time nobody reprices it. A wedding photographer on r/WeddingPhotography described the usual gap: "The agreement allowed social media use with credit, but specifically prohibited website use and any printed marketing materials."
Licensing tools mostly stop after the first sale. We wanted software that handles what comes after: read the client's request, work out what is new, price only that, invoice it, and give the file over when the money arrives.
Scale, from published sources: the US had about 145,000 photographer jobs in 2025, and 67% of photographers are self-employed (US Bureau of Labor Statistics). Pixsy, a copyright-recovery service, reports an average recovered licence fee of $1,500 on its one-year US commercial photo cases (its own caseload, not a sample of all brands).
What it does
UseRight is an agent for a photographer or illustrator. In the demo it works for "Imani", a fictional photographer with a public portfolio and a rate card.
- It reads the request. A client writes "we'd also like to use it on our printed menus and in-store posters." Google Gemini reads the message (or a DM screenshot) and extracts each requested use, with the exact words it relied on. It sets no price.
- It prices the gap. Code, not the model, prices the request from Imani's rate card. A client who already holds a social licence pays only the difference: $720 for social plus print, minus the $300 already paid, is $420 due (sandbox).
- It invoices through PayPal. The agent creates and sends a PayPal Invoicing invoice. The creator sets its limits: allowed clients, uses it may sell, a cap per deal ($500 in the demo), a daily maximum. Inside the limits, a request pasted in by the creator is invoiced with no click. Anything outside waits: a $900 billboard request is over the cap, so nothing is sent until the creator types the exact total. A request for paid ads gets no price, because the rate card has no line for it. Requests a visitor sends from the public portfolio page are always reviewed by the creator before any invoice goes out.
- PayPal unlocks the file. The client's pay page shows what they hold, what they are adding and the amount due. The file stays locked until PayPal confirms the payment. A PayPal webhook is only a trigger: the server then fetches the invoice from PayPal and checks that it is paid, in USD, with the right invoice number and amount. An invoice marked paid by hand in PayPal does not unlock anything. A refund revokes the licence.
- It renews. A week before a licence ends, if the client opted in and the same rules pass, the agent sends the renewal invoice itself. Otherwise the renewal waits for the creator.
- It leaves a record. The receipt lists payment and scope: what was licensed, the amount, the PayPal transaction, and the file's SHA-256 fingerprint. It is a record, not legal advice.
A brand's own agent can also read the same facts: GET /api/agent/quote prices a first licence for a public photo from the rate card, and GET /api/agent/receipt confirms a licence for a caller that holds the file's SHA-256. Both are read-only. They cannot create or send an invoice.
How we built it
- Web app: Next.js (App Router) and TypeScript in strict mode, Tailwind and shadcn/ui, zod for validation, Postgres on Supabase (PGlite in tests), vitest. Hosted on Render's free tier, with private file storage in Supabase Storage.
- AI (Google Gemini,
gemini-flash-latest): one adapter reads the client's text or screenshot and returns JSON, which is checked against a schema. The model proposes the requested uses and quotes the client's words. It does not set the price, does not send the invoice, and does not decide whether something was paid. If it suggests a price, the deal room shows it struck out and the invoice uses the rate card. - PayPal: Invoicing v2 to create, send and read invoices, through the PayPal Agent Toolkit
create_invoicerunning server-side, with a direct REST fallback. Webhooks are verified by signature and de-duplicated, then treated as a hint:grantIfPaidre-reads the invoice from PayPal before any file is released. The toolkit is never handed to the model as a tool. The model can read a request; only our code can reach money. - Rules before every send: R1 the client is on the creator's allowed list. R2 the total is under the per-deal cap. R3 the send is inside the daily maximum and the rolling 30-day cap. R4 every use is one the agent may sell. R5 every check on the request is clear. All five pass and the invoice goes out. Any one fails and the creator types the exact total to approve. These run under a per-creator database lock so two sends cannot both squeeze under the cap.
- Money: integer cents everywhere. Each licence version freezes its rate card, so an upgrade charges only the gap:
$$\text{due} = \text{price}(\text{held} + \text{added}) - \text{paid} = 720 - 300 = 420 \text{ USD}$$
- Built during the hackathon: work started on Oct 28, 2026, inside the submission period.
Challenges we ran into
- The webhook body cannot be trusted. It can arrive late, out of order, or for an invoice that was refunded since. Unlocking from it would release a file without a confirmed payment. The unlock path ignores the body and asks PayPal.
- "Marked paid" is not paid. A creator or client can mark an invoice paid inside PayPal's own screens. We treat that as no payment and leave the file locked.
- Keeping the model away from money. The model reads language well and prices badly. So it only extracts uses and quotes, and a deterministic price function does the rest.
- Stale quotes. A quote priced against a licence that has since been replaced or refunded is refused before any new invoice goes out, and the deal says why.
- Double sends. PayPal does not honour a request-id on invoice create, so we store the row first, dedupe on our own invoice number, and never retry a create blindly.
- Free hosting. The demo runs on Render's free tier, which sleeps when idle. A scheduled GitHub Action pings it every 10 minutes through judging; if it was asleep anyway, the first load can take up to a minute.
Accomplishments that we're proud of
- The payment gate holds against the obvious shortcuts: a forged or early webhook, an invoice marked paid by hand, a refund after the fact.
- The agent acts within limits the creator set, and stops, with the reason shown, when a limit is hit.
- The AI has a narrow job. It reads and quotes; code prices and PayPal confirms.
- The full loop runs on the live site with PayPal sandbox: request, price, invoice, payment, unlock, receipt, renewal.
- The public repository is MIT-licensed and the app builds and tests without any keys.
What we learned
- Letting an agent act on money works when the model's output is a proposal and every consequence (price, send, unlock) is decided by code that can be tested.
- PayPal's own record is the right source of truth. Webhooks are useful as a prompt to look, not as proof.
- Showing the client what they already hold and what they are adding removes most of the "why this price?" questions.
What's next for UseRight
- Accounts, so any creator can run the agent on their own rate card (today the demo has one creator).
- Client requests by forwarded email, with confirmation emails sent automatically.
- Paying a collaborator's share through PayPal and showing it on the receipt.
- Working with creators on how paid-ads uses should be priced. Today the agent stops and flags them.
Built With
- gemini
- node.js
- paypal
- postgresql
- react
- render
- shadcn-ui
- supabase
- tailwindcss
- typescript
- vitest
- zod