Skip to content

Anatomy of an API

An API is a published promise of Verbs on Nouns, compiled from one declaration into seven parts and served to Customers under the Startup's own name.

An API on StartupBuilder is a published promise: these Verbs on these Nouns, for these callers, on these terms. Every part compiles from one declaration, and StartupBuilder keeps the same promise to its own callers.

Exploded view

Leaseline declares a Lease Noun and sells it from one Product file, products/pro.mdx:

Anatomy of Leaseline's API: 12 parts compiled from products/pro.mdxOne declaration, products/pro.mdx, compiles Routes, one per Verb, SDK, CLI and MCP server, Webhooks, Tenants and keys, Developer tools in the Portal, Limits, Meter and Price, Reference docs, Errors that name the fix, Status page, Versions, Test environment, Changelog.One declarationproducts/pro.mdx---$type: [App, API]nouns: [Lease]verbs: [Lease.renew, Lease.notify]---No renewal slips past its date.Routes, one per Verbapi.leaseline.app/leasesfrom Nouns and VerbsSDK, CLI and MCP servernpm install leaseline, pip install leaseline;leaseline.app/mcpfrom VerbsWebhooksLease.renewed, signed with Leaseline-Signaturefrom the Events of each VerbTenants and keysOne Tenant per Customer, each with test and live keysfrom CustomersDeveloper tools in the Portalleaseline.app/portalfrom a keyed OfferLimits, Meter and Priceportfolio, $99 a month, API accessfrom the OfferReference docsleaseline.app/docs, with llms.txtfrom Nouns, Verbs and errorsErrors that name the fixleaseline.app/errors/…from the error catalogStatus pageleaseline.app/statusfrom a Monitor on each InterfaceVersions/v1, /v2; each Tenant pinnedfrom breaking ChangesTest environmentTest records, no money movedfrom the latest merged ChangeChangelogBy email, feed or webhookfrom every merged ChangeAnatomy of Leaseline's API: 12 parts compiled from products/pro.mdxOne declaration, products/pro.mdx, compiles Routes, one per Verb, SDK, CLI and MCP server, Webhooks, Tenants and keys, Developer tools in the Portal, Limits, Meter and Price, Reference docs, Errors that name the fix, Status page, Versions, Test environment, Changelog.One declarationproducts/pro.mdx---$type: [App, API]nouns: [Lease]verbs: [Lease.renew, Lease.notify]---No renewal slips past its date.Routes, one per Verbapi.leaseline.app/leasesfrom Nouns and VerbsSDK, CLI and MCP servernpm install leaseline, pip install leaseline;leaseline.app/mcpfrom VerbsWebhooksLease.renewed, signed withLeaseline-Signaturefrom the Events of each VerbTenants and keysOne Tenant per Customer, each with test andlive keysfrom CustomersDeveloper tools in the Portalleaseline.app/portalfrom a keyed OfferLimits, Meter and Priceportfolio, $99 a month, API accessfrom the OfferReference docsleaseline.app/docs, with llms.txtfrom Nouns, Verbs and errorsErrors that name the fixleaseline.app/errors/…from the error catalogStatus pageleaseline.app/statusfrom a Monitor on each InterfaceVersions/v1, /v2; each Tenant pinnedfrom breaking ChangesTest environmentTest records, no money movedfrom the latest merged ChangeChangelogBy email, feed or webhookfrom every merged Change
Everything on the right compiles from products/pro.mdx and the records it names. Change the declaration, and every part follows on the next merge.
Read as text

Seven parts, one declaration

PartThe question it answersWhere it comes from
ContractWhat can be called, with what input and outputNouns and Verbs
AddressWhere each Interface answersA Domain and a path per Interface
CallerWho calls, and for whomKeys from Identity, each reaching one Tenant
TermsWhat a call costs and how far it goesOffers, Meters and Limits
ExecutionWhat runs a callThe Function behind each Verb
ChangeHow the contract grows without breaking callersChanges and Versions
HistoryWhat happenedActions and Events

A Startup authors the Nouns, Verbs and Offers. Routes, OpenAPI, packages, errors, docs, the Portal tools and the changelog derive, and every record behind them lives in the Database.

Two planes

Every Startup's API serves two kinds of caller through the same Verbs and records. They differ in address, scope and name.

The builder planeThe customer plane
Who callsThe Startup's Workers, tests and previewsIts Customers and their Agents
Addresshttps://api.sb/leaseline.apphttps://api.leaseline.app, also https://leaseline.app/api
Packagesstartup-builderleaseline
Key variableSTARTUP_BUILDER_API_KEYLEASELINE_API_KEY
ScopeEvery Verb its Role grants, across the StartupOne Tenant, within its Offer
Terminal
curl "https://api.leaseline.app/leases?limit=20" \
  -H "Authorization: Bearer $LEASELINE_API_KEY"

The Publication holds every name the customer plane shows, and the registry refuses one whose fields name the platform.

StartupBuilder is built the same way

StartupBuilder is the Product of startups.studio, which runs as a Startup like any other. Its API at api.sb, its SDK, CLI and MCP server compile through the same projection as every Startup's.

StartupBuilder gives foundersEach Startup gives its Customers
Keys with a test twin and rotationThe same keys, in the Startup's Portal
Usage against their LimitsUsage against each Limit of their Offer
A request log with the checks each call passedTheir own requests, with the same checks
A version pin and a changelogA pin on the Startup's versions, and its changelog
The startup-builder packagesPackages named for the Startup

No route is written by hand, and a tool the platform keeps for itself is a defect.

What stays a choice

  • Who does the work. The Function can be code, a model, an Agent or a credentialed Human, and callers see no difference.
  • When it ships. A Verb can be published before any Function exists. It answers with a price, and each call counts toward building it.
  • Which shape it speaks. An Interface can also speak a Standard, such as SCIM. Customize an API covers each choice.