# api.sb

URL: /code/platform/api-sb · Id: `product:api-sb`

> api.sb is the one API behind StartupBuilder, serving every Noun, Verb, and record.

api.sb is the one API behind [StartupBuilder](/code/builders/startup), serving every [Noun](/business/nouns/noun), [Verb](/business/nouns/verb) and record. Every [Builder](/business/nouns/builder), [App](/business/nouns/app) and [Agent](/business/nouns/agent) calls it; none keeps a backend of its own.

## What it does
Every [Startup](/business/nouns/startup) has a namespace on api.sb, named by its [Domain](/business/nouns/domain): `https://api.sb/acme.com`. Each Noun is a collection under it, and each Verb a route.

The namespace serves the Startup's own [Workers](/business/nouns/worker), its `test` environment and its previews. Its [Customers](/business/nouns/customer) never see it: they call the Startup's [Publication](/business/nouns/publication) at `acme.com/api`, which serves the same Verbs under the Startup's [Brand](/business/nouns/brand).

Every write runs as an [Action](/business/nouns/action), attributed to its caller, and emits an [Event](/business/nouns/event). A caller picks a [Mode](/business/nouns/mode) per call: `try`, `send` or `do`. Every response is [one envelope](/code/api/guides/envelope): the record under its Noun's name, links to read next, and the Verbs the caller may run.

Before any call runs, api.sb checks the key, [Permissions](/business/nouns/permission), [Entitlements](/business/nouns/entitlement), [Mandates](/business/nouns/mandate) and [Limits](/business/nouns/limit). The key's prefix picks the [environment](/code/cli/guides/environments): `sk_test_` or `sk_live_`.

Every [Capability](/business/nouns/capability) behind api.sb keeps one contract, so learning one teaches the rest:

| Rule | What it means |
| --- | --- |
| One Noun family | A Capability exposes Nouns and their Verbs, called as `Noun.verb` in a Mode. |
| Every call is an Action | Each Action records who acted, for whom, through which [Interface](/business/nouns/interface) and under which [Version](/business/nouns/version). |
| Checked before, metered after | Limits are checked before a call runs, and a [Meter](/business/nouns/meter) counts it after, exactly once. |
| The upstream is data | Who performs a Verb is a ranked row behind it. Swapping the upstream changes the row, never the call. |
| Records stay home | Every record lives in [db.sb](/code/platform/db-sb), in the namespace of the Startup that made it. |
| Nothing is lost | A delete is a marker, and every past state reads back. |
| Test and Live | Every Verb runs in both environments, with separate keys and records. |
| Every choice is testable | Each upstream, model and default is a row a [Flag](/business/nouns/flag) can split, so two run as variants against a [Metric](/business/nouns/metric). |

One call reads the same in every Interface:

**Ask**

```text
Show me the last 20 customers.
```

**API**

```bash
curl "https://api.sb/acme.com/customers?limit=20" \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

**SDK**

```ts
import { $ } from 'startup-builder'

const customers = await $.Customer.list({ limit: 20 })
```

**CLI**

```bash
npx startup-builder do Customer.list --json '{"limit":20}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Customer.list({ limit: 20 })"
  }
}
```

## Built from
- [Noun](/business/nouns/noun)
- [Verb](/business/nouns/verb)
- [db.sb](/code/platform/db-sb)

## Surfaces
- The HTTP API at `https://api.sb/{namespace}`, with an OpenAPI 3.1 document generated for each Startup.
- The MCP server at `https://api.sb/mcp`, with three [Tools](/business/nouns/tool): `search`, `fetch` and `do`.
- The `startup-builder` package: the typed `$` client for TypeScript, and the CLI.
- Signed webhooks, one delivery per Event, through each [Watch](/business/nouns/watch).

## Next steps
- [The API](/products/platform/api): the seven parts of every API, its two kinds of caller, and StartupBuilder built from the same parts.
- [API](/code/api), [SDK](/code/sdk), [CLI](/code/cli) and [MCP](/code/mcp): the same calls in each Interface.
- [db.sb](/code/platform/db-sb): where every record and Event lives.
- [Platform](/code/platform/capabilities): every Capability api.sb serves.