The legal example
A brand shaped like api.lawyer. Six Services a licensed practice sells, one Pool of attorneys and patent practitioners, one rules table, and api.lawyer's own suite passing against what they generate.
legal's wordsmatter is a jobasset is a subjectreview is a tasksigner is a membernetwork is a pooloutcome is a end
The legal example is a brand shaped like api.lawyer, built from one folder: its words, a rules table, a Pool of attorneys and patent practitioners, and six Services. AI does the work on every matter. Each licensed act is a step a credentialed person attests in their own session, so the brand meets licensing by design.
It proves people and the gate, measured against api.lawyer, the hand-built brand it's shaped like.
Four counts, each read from the run that produced it. api.lawyer's suite is its front-door probes; its behavior lives in its flow tests and its routes, so those are counted too:
| Measure | Of | Result | Read it |
|---|---|---|---|
api.lawyer's behavior tests: its four playbook suites and its gate, settle and eligibility suites, at a6b27b1 | 77 tests | 60 covered by the generated brand · 17 not ported, because a Service names its own steps | Its behavior tests |
| api.lawyer's routes | 69 routes | 25 served as its clients call them · 17 adapted · 27 decided | Route by route |
| api.lawyer's own suite: its front-door probes, unchanged | 17 probes | 17 passed · 0 failed | The suite |
| The brand's own suite, generated from its contract | 268 cases from 84 rows | 267 passed · 1 failed · 99 skipped | Its suite |
When no attorney claims a review, the fill ladder climbs. On a test clock moved two hours, then two more, it raises the fee and then widens to the tier below, where a member claims it:
→ POST /test_clocks/tc_7Hq3/advance {"to":"2h"}# the record: task.posted → task.raised → task.widened → task.claimed → attested
14:02 · task.posted · tsk_7Hq2 · $50.00 · dispatch cascade
16:02 · task.raised · tsk_7Hq2 · $55.00 · raise 10% 2h · funded by the brand
18:02 · task.widened · tsk_7Hq2 · opened reviewer · widen 4h
18:02 · task.claimed · tsk_7Hq2 · mbr_7Hq4 · simulated
ladder raise 10% 2h: raised to $55.00 · widen 4h: opened reviewer · posted $50.00, now $55.00| Service | Price | Charged on | The person, and their pay | Who sells that fee |
|---|---|---|---|---|
| Provisional patent application | $199, or $79 when the applicant signs and files | the office's receipt | a patent practitioner signs, $150 | the brand |
| Contract review | $99 | acceptance | an attorney admitted where the client is advises, $50 | the attorney |
| Demand letter | $149 | the delivery receipt | an attorney admitted where the client is signs, $75 | the attorney |
| Company formation | $299 | the state's receipt | an attorney advises on the entity, and on the 83(b) when founders vest, $60 each | the attorney |
| Trademark response | $349 | the office's receipt | an attorney signs the response, $175 | the attorney |
| Docket watch | $12 a month | the start of each month | a watcher acknowledges a date in its last week, $4 an act | the brand |
The brand's own suite, generated from its contract, runs every row by its credentials and the branches its files write, over HTTP and MCP. A skipped case never counts as a pass: on a test run, the live and delegated keys' cases wait for --live, and Every branch names the rest.
npx services.dev verify --surface alllegal · 235 HTTP cases and 33 MCP cases from 84 rows: each row by its live credentials and magic values, with its auth, audience, replay and next cases · http://localhost:8787/verify/suite.json
✗ subject.withdraw · member session · none answered 404 EMPTY not_found, expected 200 OK
267 passed · 1 failed · 99 skipped
live mode only, run with --live: credential sk_live_ · 35 rows
live mode only, run with --live: credential dlg_ · 31 rows
live mode only, run with --live: credential tk_ · 17 rowscheck reads the folder back: each file with its line count, and each Service with what one matter leaves you. Build it adds them one at a time.
npx services.dev checkbrand.ts · 10 lines · legal · api.lawyer · words job → matter, subject → asset, task → review, member → signer, pool → network, end → outcome
rules.ts · 36 lines · rules 2026-10 · 6 Services · 16 rows · 1 shared
pools/attorneys.ts · 20 lines · attorneys · 4 roles: attorney, practitioner, watcher, student · joins in 3 steps · cascade · hold 24h
services/contract-review.ts · 16 lines · $99 per job, within 48 hours, charged on acceptance.
ledger +$99.00 · attorney's fee $50.00, sold by the attorney (rail member) · brand $49.00 · AI $1.26 (example) · coverage $4.00 · you $43.74
services/demand-letter.ts · 26 lines · $149 per job, within 48 hours, charged on send's receipt.
ledger +$149.00 · attorney's fee $75.00, sold by the attorney (rail member) · brand $74.00 · AI $2.10 (example) · coverage $4.00 · you $67.90
services/docket-watch.ts · 10 lines · $12 per month, charged at the start of each month.
ledger +$12.00 · AI $0.84 (example) · watcher $4.00 · coverage $4.00 · you $3.16
services/formation.ts · 30 lines · $299 per job, within 48 hours, charged on form_entity's receipt.
ledger +$299.00 · attorney's fee $60.00 at advise_entity, sold by the attorney (rail member) · attorney's fee $60.00 at advise_83b, sold by the attorney (rail member) · brand $179.00 · AI $0.84 (example) · coverage $8.00 · you $170.16
services/provisional-patent.ts · 24 lines · $199 per job, within 5 days, charged on file's receipt.
ledger +$199.00 · AI $2.10 (example) · practitioner $150.00 (rail brand) · coverage $4.00 · you $42.90
services/trademark-response.ts · 21 lines · $349 per job, within 48 hours, charged on file's receipt.
ledger +$349.00 · attorney's fee $175.00, sold by the attorney (rail member) · brand $174.00 · AI $2.10 (example) · coverage $4.00 · you $167.90
✓ ready to sell · 6 Services · each keeps at least 3% of every jobdev serves the folder on localhost: every surface, the three apps, and a test key. Here it also seeds twelve simulated attorneys in a market that's hard to fill, which is how the ladder above climbed:
npx services.dev dev --members 12 --market tight --no-trylegal
contract-review An attorney signs at advise, stamped. The client consents first.
demand-letter An attorney signs at sign, stamped. The client consents first and decides at settle.
docket-watch A watcher does the ack step.
formation An attorney does advise_entity and advise_83b. A founder consents first. Every founder signs at adopt.
provisional-patent A practitioner signs at sign, stamped. The applicant consents first and answers at questions.
trademark-response An attorney signs at respond, stamped. The client consents first and uploads at evidence.
domain https://api.lawyer · agents.json, openapi.json and every doc_url name it; localhost serves them
site http://localhost:8787/
api POST http://localhost:8787/matters {"service":"<service>"}
key sk_test_7Hq2 · a call with no key uses it, on localhost only
mcp http://localhost:8787/mcp · stdio: npx services.dev mcp
cli npx services.dev <service> k=v …
sdk connect({ origin: 'http://localhost:8787' }).<service>.order(input)
docs http://localhost:8787/llms.txt
buyers http://localhost:8787/portal
attorneys http://localhost:8787/attorneys · join at /attorneys/join, or npx services.dev signers add attorneys <email>
verifier vt_test_7Hq2 · the only writer of verified facts, at POST /<network>/signers/:id/verify
market tight · 12 simulated signers in attorneys, each act labeled simulated · the fill ladder climbs before a review is claimed
you http://localhost:8787/console
| Page | What it shows |
|---|---|
| Build it | Each file, with check after it |
| One job, every side | One patent matter, as the buyer, the applicant, the practitioner and the owner see it |
| Every branch | Each human and outside branch, and the magic value that produces it |
| The customer portal | The applicant's screens, from order to acceptance |
| The delivery portal | A practitioner's screens, from the offer to their pay |
| The owner console | Three matters at once: one filed, one holding advice, one waiting on the client's direction |
| The money | Every ledger before you sell and after delivery, on both rails, and what an early end costs |
| What the brand gets | API, CLI, MCP, SDK, Site, Docs and App, in matter words |
| The rules table | Every row, illustrative, with its position |
| The attorneys' Pool | Join, verify, offers, conflicts and the fill ladder |
| Provisional patent application | A stamped signature, a receipt that releases the charge, of record, two prices |
| Contract review | Consent first, held advice, three ratified states, two sellers |
| Demand letter | An outbound submission, a floor only the client sets, a decision |
| Company formation | An open act, advice an attorney gives, a name the state turns down, three clocks that outlive the matter |
| Trademark response | Typed rejections routed to the client's evidence or a fee, and an abandoned end |
| Docket watch | A subscription on a patent family that routes an office action to its Service |
| When the attorney declines | A paid decline on the merits, the client's direction, a second attorney |
| Porting api.lawyer | Route by route, test by test, and what was decided |
| Take your first real matter | Every outside system a real matter depends on, and the contract it meets |