> This page is for version Preview (default).
> For other versions, use one of these documentation indexes:
> - Preview (default): https://docs.preview.paid.ai/preview/llms.txt
> - Current: https://docs.preview.paid.ai/current/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.preview.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.preview.paid.ai/_mcp/server.

# Segments

> Group customers into named classes, such as key accounts or EMEA, then find and report on the whole class at once.

A **segment** is a named set of customers, such as "Key accounts" or "EMEA". Sales teams manage classes of customers rather than one at a time, and finance reports by the same classes. Segments give those classes a home in billing: one named class, kept in one place, and usage reports that split by it, without metadata conventions that reports can't read.

Use a segment to:

* **Report by class**, filtering or grouping [usage summaries](/usage/usage-summaries) by segment.
* **Find a class of customers**, by [listing customers](../api-reference/customers/customers/list) in a segment.

Segments are in the `segments=v1` private beta: send `Paid-Beta: segments=v1` with each request.

## How segments work

1. **You create a segment** with a `key`, such as `key_accounts`, which is how code and reports name it.
2. **You put customers in it** with `segments` when you create a customer, and `addSegments` and `removeSegments` when you update one. A customer can be in up to 20 segments, and draft customers can be members.
3. **Reports read membership** when you query them.

Segments, parents and units answer different questions:

| Use                                        | When                                                                     | Example                       |
| ------------------------------------------ | ------------------------------------------------------------------------ | ----------------------------- |
| Segment                                    | Customers that share a reporting class, but nothing else                 | Key accounts, EMEA, startups  |
| [Parent customer](/customers/customers)    | A customer that belongs to another, which pays for its orders by default | A subsidiary under its group  |
| [Customer unit](/customers/customer-units) | A part of one customer that shares its contract                          | A team, environment or person |

## Create a segment

Trey Research tracks its 50 largest accounts as a class, and reviews the list each quarter:

#### API

[Create a segment](../api-reference/customers/segments/create) with a `key` and a `name`:

**`POST /v1/segments`**

```json title="POST /v1/segments"
{
  "key": "key_accounts",
  "name": "Key accounts",
  "description": "Top 50 accounts by ARR, reviewed each quarter",
  "metadata": { "owner": "sales-ops" }
}
```

**`Response`**

```json title="Response"
{
  "id": "seg_3Vn8Qp",
  "object": "segment",
  "livemode": false,
  "key": "key_accounts",
  "name": "Key accounts",
  "description": "Top 50 accounts by ARR, reviewed each quarter",
  "metadata": { "owner": "sales-ops" },
  "createdAt": "2027-01-04T09:00:00Z",
  "updatedAt": "2027-01-04T09:00:00Z",
  "archivedAt": null
}
```

#### Dashboard

> **Draft**
>
> These steps describe the planned v1 dashboard and will change before release.

1. Go to **Operate > Customers**, open **Segments** and click **Create segment**.
2. Enter the **Key** (`key_accounts`), which can't change later, and the **Name** (**Key accounts**).
3. Add a description so your team knows who belongs in it, and click **Create segment**.

| Field         | What it's for                                                                                                                                      |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key`         | Your stable name for the segment: 1 to 64 lowercase letters, digits and `_`. Unique on your account, archived segments included, and can't change. |
| `name`        | Shown in the dashboard. Customers never see it.                                                                                                    |
| `description` | What the segment is for, up to 500 characters.                                                                                                     |

Anywhere the API asks for a segment, pass its `key` or its `seg_` ID. Responses name segments by key.

An account can have up to 500 segments, archived ones included. Creating another returns `400` `segment_limit_reached`. Archiving a segment doesn't free a place, so reuse one where you can.

## Add customers to a segment

Membership is set on the customer. [Update the customer](../api-reference/customers/customers/update) with the segments to add and the segments to remove:

#### API

**`PATCH /v1/customers/cus_8HqL2xT`**

```json title="PATCH /v1/customers/cus_8HqL2xT"
{
  "addSegments": ["key_accounts", "emea"],
  "removeSegments": ["trial"]
}
```

Only the segments you name change, so two systems can add segments to the same customer at once without losing each other's. Adding a segment the customer is already in, or removing one it isn't in (an archived one included), is skipped, and a call that changes nothing returns the customer as it is. A segment that doesn't exist, adding an archived segment, or naming one segment in both lists rejects the whole call, and nothing changes. The response's `segments` is the customer's full list, by key.

#### Dashboard

> **Draft**
>
> These steps describe the planned v1 dashboard and will change before release.

1. Go to **Operate > Customers** and open **Northwind Traders**.
2. Under **Segments**, add **Key accounts** and **EMEA**.
3. Click **Save**.

You can also set the starting `segments` when you [create a customer](/customers/customers#create-a-customer). To see a segment's members, list customers with the `segment` filter:

**`GET /v1/customers`**

```text title="GET /v1/customers"
?segment=key_accounts
```

## Report by segment

[Usage summaries](/usage/usage-summaries) filter by `segment`, or split by it with `groupBy`:

**`GET /v1/usage-summaries`**

```text title="GET /v1/usage-summaries"
?meters[]=output_tokens
&startsAt=2027-01-01T00:00:00Z
&endsAt=2027-04-01T00:00:00Z
&granularity=month
&groupBy[]=segment
```

A customer in two segments appears in both groups, so the groups can add up to more than the overall total. Customers in no segment are grouped under `null`. `segment` can't be sent with `customer`.

Reports read membership when you query them, and there's no membership history, so moving a customer between segments also changes how its past usage appears in segment reports.

## Change or archive a segment

[Update a segment](../api-reference/customers/segments/update) to change its `name`, `description` or `metadata`. Its `key` can't change.

[Archive a segment](../api-reference/customers/segments/archive) when the class no longer exists. It's removed from every customer's `segments`, can't be given to a customer, and stays readable with its `key` reserved.

## Related

* [Customers](/customers/customers)
* [Usage summaries](/usage/usage-summaries)
* [Segments API reference](../api-reference/customers/segments/create)