---
title: "Choose your pattern"
url: /patterns/choose
---

# Choose your pattern

> Which kind of API product to build: one of seven patterns, by what your buyer receives and how it pays, and two in one file when both fit.

Which kind of product to build follows from what your buyer receives and how it pays: the first question you answer yes to names it.

**Seven questions, asked in order.** What does the buyer get?

1. Facts about a thing? Yes: Dataset API, per answer.
2. No: a home for its records? Yes: Headless SaaS, plan and seat.
3. No: an answer to one call? Yes: Function API, per call.
4. No: a worker on its own jobs? Yes: Agent API, by use.
5. No: work done and accepted? Yes: Service API, on acceptance.
6. No: editions you publish? Yes: Content, read or member.
7. No: Marketplace, many suppliers.

Each exit is a pattern, priced its own way.

## Which kind of product to build, in seven questions
Ask them in order. A later pattern can do what an earlier one does, but costs you more to run.

1. Does the buyer get facts about a thing, from a source you own or license? Build a [Dataset API](/patterns/dataset-api.md), priced per answer, from [Sources](/patterns/dataset-api.md#how-a-field-is-filled) and a [Mapping](/patterns/dataset-api.md#how-a-field-is-filled).
2. A place its own team keeps records? Build a [Headless SaaS](/patterns/headless-saas.md), priced by plan and seat, from Nouns and a lifecycle.
3. One answer to one call, from code, a model, an agent or a person? Build a [Function API](/patterns/function-api.md), priced per call by kind, from a [Function](/patterns/function-api.md).
4. A worker that does a job for it, again and again? Build an [Agent API](/patterns/agent-api.md), billed by its tokens and minutes.
5. A piece of work, finished and accepted? Build a [Service API](/patterns/service-api.md), charged once on acceptance, from a [Workflow](/workflow.md) and an Outcome contract.
6. Editions you write and publish? Build [Content](/patterns/content.md), sold by the read or a membership.
7. What many other suppliers offer, under your brand? Build a [Marketplace](/patterns/marketplace.md), paid by your take of each sale.

## When two fit
A pattern is what you write, not a setting, so one file can hold two. Each Noun sells its own way.

| You sell | Write it as |
| --- | --- |
| Research a buyer pays for only when it is right | A Service API whose step is a Function |
| Records a team keeps, plus a lookup that fills them | A Headless SaaS whose fields read a Dataset API |
| An edition, plus the data behind it by the call | Content beside a Dataset API, in one file |
| Many researchers, each paid when the buyer accepts | A Marketplace of Service API orders |
| The same answer for a person and for an agent | Any pattern: every one serves both |

## One job, two ways
An answer found by an agent, sold per call, is a Function API in a few lines.

```ts title="definition.ts"
import { define, agentic } from 'apis.dev'

/** The head of sales at any company, found by an agent, priced per answer. */
export default define({
  name: 'summaries', domain: 'summaries.apis.dev',
  Company: {
    domain:   'url!#',
    research: agentic('Find the head of sales at {domain}',
      { returns: { headOfSales: 'string' } }),
  },
  offer: { 'Company.research': 0.5 },
})
```

Charged only when the buyer accepts the name, the same job is a [Service API](/patterns/service-api.md). Its price moves to an outcome, and its Verb to a lifecycle.

## What APIs.Dev refuses to be
APIs.Dev never stands between you and your buyers: your Customers, your brand and your Stripe account stay yours, and nothing they read names it.