Skip to content
GuidesTutorials

Building an API business

Build a Startup that sells VAT rate lookups by the call, with a Dataset, a Meter, a free Offer, and a usage Price billed monthly.

You build ratebook.dev, a Startup that sells a Dataset of VAT rates as an API, priced by the call. Developers and their agents subscribe, get a key, and pay for what they use.

What you build

The Startup sells two Offers: 1,000 free lookups a month, and $2 per 1,000 lookups beyond that. A Meter counts every keyed call, and billing reads the Meter, never a hand count.

You define the data and the prices. The Autonomous data API Startup Template supplies the rest: the routes, the MCP server, the OpenAPI document, API keys, the Meter, and the Site.

Launch reads 11 checks for ratebook.dev, a Autonomous data API Startup.

CheckIdKindApplies toPasses when
Offers publishedlive-offersregistryEvery StartupAt least one Offer is published with a price and terms; launch refuses a Startup without one.
Work definedlive-workregistryEvery StartupEvery published Offer has a workflow that delivers it, with each step assigned to software, an Agent, or a person.
People assignedlive-peopleregistryEvery StartupEvery role the workflows need is held by an Agent or a person, with instructions and limits.
Site publishedlive-siteuiEvery StartupThe site serves home, pricing, terms, and privacy pages under the Brand, readable by people and agents.
Test run passedlive-test-runtranscriptEvery StartupA sample Customer completes every published Offer end to end in test, with no real charge or message.
Portal readylive-portaluiEvery StartupThe customer portal on the site shows each Customer their orders, deliveries, invoices, and messages.
Agent API openlive-agent-apicontractEvery StartupThe API, MCP server, OpenAPI document, llms.txt, and agents.json serve every published Offer and pass conformance.
Payouts connectedlive-payoutscontractEvery StartupStripe takes payments for the Startup and pays out to its bank account.
Address resolveslive-addresscontractEvery StartupThe canonical Domain serves the Site over HTTPS with a valid certificate and, where it embeds a payment form, Stripe lists it as a payment method domain.
Five slots at Commitmentlive-slotsgradeEvery StartupAll five Founding Hypothesis slots hold Commitment Evidence from outside people. Slots customer, problem, approach, switch, differentiation at Commitment or stronger, outside Evidence only.
Sources securedlive-sourcesregistryDataset API, DirectoryEvery dataset source is licensed, crawled within its terms, or synthetic.

You need node 20 or later and a terminal. Every command runs in the test environment, so no card is charged.

Steps

Terminal12 steps
  1. To create the Startup, run create startups with the template:

    npm create startups ratebook.dev -- --template autonomous-data-apicd ratebook
    Created Ratebook in testStartup      startup_1Template     Autonomous data APIDataset      dataset_1Claim token  ct_9Lp3wQ
  2. To define what the Dataset holds, create a Noun:

    npx startup-builder do Noun.create --json '{"name": "Rate","properties": [{ "name": "country", "type": "string", "required": true },{ "name": "standard", "type": "number", "required": true },{ "name": "reduced", "type": "number" },{ "name": "validFrom", "type": "date", "required": true }]}'

    In the test environment the definition applies at once: https://api.sb/ratebook.dev/rates now serves Rate.

  3. To pass the launch check on data rights, record the Source of the data:

    npx startup-builder do Source.create --json '{"acquired": "owned","terms": "Compiled from rates each tax authority publishes for reuse."}'

    Every Source states how it was acquired. A Dataset sells only data it has the right to sell.

  4. To load the data, create the first records:

    npx startup-builder do Rate.create --json '{"country":"DE","standard":19,"reduced":7,"validFrom":"2007-01-01"}'npx startup-builder do Rate.create --json '{"country":"FR","standard":20,"reduced":5.5,"validFrom":"2014-01-01"}'
  5. To find the Meter that counts lookups, list the Meters:

    npx startup-builder show /meters
    { "meters": [{ "$id": "https://api.sb/ratebook.dev/meters/meter_1", "unit": "calls" }] }
  6. To price the API, create the two Offers. The Meter counts the lookups each one bills:

    Terminal
    FREE=$(npx startup-builder do Offer.create --json '{
      "price": { "amount": 0, "currency": "USD" },
      "interval": "month",
      "atBound": "upgrade",
      "terms": "1,000 lookups a month, free."
    }' | jq -r '.offer["$id"] | split("/") | last')
    PAID=$(npx startup-builder do Offer.create --json '{
      "price": { "amount": 0.002, "currency": "USD" },
      "interval": "month",
      "terms": "$2 per 1,000 lookups, billed monthly in arrears."
    }' | jq -r '.offer["$id"] | split("/") | last')

    Zero is a Price, so the free Offer is sold like any other. Each Customer's free lookups count first.

  7. Publish both Offers:

    npx startup-builder do Offer.publish --json '{"offer":"'"$FREE"'"}'npx startup-builder do Offer.publish --json '{"offer":"'"$PAID"'"}'
  8. To provision the routes, keys, and Site, build the Startup:

    npx startup-builder do Startup.build --json '{"startup":"startup_1"}'
  9. To test as a developer, subscribe a sample Customer to the paid Offer:

    npx startup-builder do Offer.subscribe --json '{"offer":"'"$PAID"'"}'

    The Subscription grants an Entitlement to read Rate, and the response holds the Customer's own sk_test_ key.

  10. To make a lookup as that Customer, call the API with the Customer's key:

    curl https://api.sb/ratebook.dev/rates/DE \-H "Authorization: Bearer $CUSTOMER_KEY"
    { "rate": { "$id": "https://api.sb/ratebook.dev/rates/DE", "country": "DE", "standard": 19, "reduced": 7 } }

    The Meter now reads one call for that Customer. The same lookup works through the SDK, the CLI, and MCP, and each one counts.

  11. To connect payouts, claim the Startup, then finish payouts onboarding at the link it prints:

    npx startup-builder do Startup.claim --json '{"startup":"startup_1","claimToken":"ct_9Lp3wQ"}'
  12. Launch:

    npx startup-builder do Startup.launch --json '{"startup":"startup_1"}'

Result

The Startup is Live. A developer or an agent finds the API through its Site, OpenAPI document, MCP server, or llms.txt, subscribes, and calls with its own key.

Each call ticks the Meter. At month end the Meter's count becomes an Invoice, collected from the card on file.

Next steps