# Billing

> When your card is charged, accounts connected for part of a month, failed payments, stopping charges, tax, and the 402 billing\_required a connect returns past the free accounts.

Canonical: <https://www.tryadeli.com/docs/billing>

What you're charged, and when. For the prices themselves, see
[Pricing](https://www.tryadeli.com/docs/pricing).

## First 3 accounts free

Your first three connected accounts are free, and you don't need a card for
them. Connecting a fourth asks for a card first, through Stripe Checkout. In the
dashboard you'll see a short dialog. In the API, you get a
[`402 billing_required`](https://www.tryadeli.com/docs/billing#in-the-api).

## Accounts connected for part of a month

You pay for each account only for the days it's connected. A full month counts
as one account, half a month as half. At the end of the month we add up
how long each account was connected and price the total with the
[ladder](https://www.tryadeli.com/docs/pricing#the-price-ladder).

**Example.** In a 30-day month you have 10 accounts all month, and an 11th for
one week (7 days):

|                         | Counts as          |
| ----------------------- | ------------------ |
| 10 accounts, all month  | 10 accounts        |
| 1 account, 7 of 30 days | 0.23 of an account |
| **Total**               | **10.23 accounts** |

Priced with the ladder: 3 free, 7 × $5 = $35, and 0.23 × $3 = $0.70. The month
costs **$35.70**.

An account's charge starts the day you connect it and stops the day after you
disconnect it. Reconnecting the same account on the same day isn't charged
twice.

## When your card is charged

We charge your card in small amounts as you go, rather than in one large bill
at the end of the month:

1. The first charge happens when this month's unpaid usage reaches $10.
2. After each successful charge, the next one waits for twice as much: $20, then
   $40, $80 and $160, up to $200 at a time.
3. Whatever is left at the end of the month is charged on the 1st.

**Example.** A new workspace connects 10 accounts on the 1st and keeps them all
month. That month costs $35, charged as:

| When            | Charge | Why                              |
| --------------- | ------ | -------------------------------- |
| Around the 15th | $10    | Usage reached $10                |
| Around the 28th | $20    | Usage reached the next step, $20 |
| The 1st         | $5     | What was left                    |

The charge step carries over from month to month, so an established workspace
gets fewer, larger charges. Every charge has an invoice on the dashboard's Billing page.

## X API usage

X charges per API call, and we pass that on at X's prices: see
[X API pricing](https://www.tryadeli.com/docs/pricing/x). It appears on the same invoices as an
"X API usage" line, and counts toward the same charges above, so X usage and
connected accounts together reach $10, then $20, and so on. X needs a card on
file even within your free accounts.

## Failed payments

If a charge fails, Stripe retries your card for about two weeks, and everything
keeps working in the meantime. The dashboard's Billing page
shows a warning so you can add a working card.

If every retry fails, you can't connect accounts beyond your three free ones
until the balance is paid. The accounts you already have keep working. The
next charge step starts again at $10.

## Stopping charges

You pay only for connected accounts and X usage, so disconnect accounts until
you have three or fewer, and stop using X, and your bill drops to $0 from the
next day. Your card stays on file, so connecting more later is instant.

Removing your only card from the Billing page cancels billing altogether. We
charge any usage not yet billed, X stops working, and connecting more than
three accounts asks for a card again. Adding a card starts billing again.

## Tax

Prices exclude tax. Where we have to collect sales tax, VAT, or GST, we add it to
each charge based on your billing address. A business can add its VAT or GST
number in its billing details, and where reverse charge applies, we don't add
VAT.

## Managing billing

The dashboard's Billing page shows:

- your upcoming invoice, the next charge threshold, and what you've paid this month
- your billing email, business name, name, address, and tax ID, which you can edit. Changes apply to future invoices.
- your cards. You can keep up to five and choose the default.
- your invoices, each with a link to view it or download the PDF

You enter card details on Stripe's pages, so Adeli never sees or stores them.

## In the API

Billing affects the API in one place. A workspace past its three free accounts
needs a card before it can connect another. Nothing else is limited, there's no
cap on the number of accounts, and existing accounts keep working even if a
payment fails.

### `402 billing_required`

Starting a connection with
[`POST /api/v1/profiles/{profileId}/connect`](https://www.tryadeli.com/docs/api/connect/start-connection) returns `402`
when the new account would take the workspace past its free accounts and no
card is on file. Accounts are counted for your API key's organization, across
all of its profiles. The `402` comes back before any `authUrl` exists, so your
customer never goes through a provider's consent screen for nothing.

```json
{
  "error": {
    "code": "billing_required",
    "message": "The first 3 connected accounts are free. Add a card to connect more.",
    "details": {
      "billingUrl": "https://app.tryadeli.com/settings/billing?reason=account_limit&provider=instagram"
    }
  }
}
```

`details.billingUrl` links to the dashboard's Billing page. The workspace owner
adds a card there, and that's you, not your end customer. Once a card is on
file, the same request succeeds.

Reconnecting or replacing an account that a profile already has connected
never returns `402`, because it does not add an account.

### Handling it

Check `error.code`, not only the status:

**JavaScript**

```javascript
const response = await fetch(`${ADELI_URL}/api/v1/profiles/${profileId}/connect`, {
  method: "POST",
  headers: { Authorization: `Bearer ${ADELI_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ platform: "instagram", redirectUrl }),
});

if (response.status === 402) {
  const { error } = await response.json();
  if (error.code === "billing_required") {
    // Tell your team (the Adeli workspace owner) to add a card.
    notifyBillingOwner(error.details.billingUrl);
    return showMessage("Connecting more accounts is temporarily unavailable.");
  }
}
```

**cURL**

```bash
curl -i -X POST "$ADELI_URL/api/v1/profiles/$PROFILE_ID/connect" \
  -H "Authorization: Bearer $ADELI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"instagram"}'
# HTTP/1.1 402 Payment Required
# {"error":{"code":"billing_required", ... "details":{"billingUrl":"..."}}}
```

### Other 402s

`402 x_billing_required` is a separate rule for X, which charges per API call: X needs a card on file even within your free accounts. See [X API pricing](https://www.tryadeli.com/docs/pricing/x).

### MCP

The MCP `start_connect` tool wraps the same endpoint, so it returns the same
`billing_required` error with the same `billingUrl`. See
[MCP tools](https://www.tryadeli.com/docs/mcp/tools).
