# Get an account’s usage

**GET** `/api/embed/v1/accounts/{accountId}/usage`

Returns one account’s usage over a range of days.

Needs a partner key: `Authorization: Bearer gre_…`, from [Platform › Partner keys](https://docs.gorunner.io/embed/platform-screens#partner-keys). Call it from your server only.

Embed · Self-hosted with an Embed license

## Parameters

### Path

- `accountId` · Required · string: Your ID for the customer’s account: 1 to 255 bytes of UTF-8, case-sensitive. URL-encode it: it may contain `/`.

### Query

- `from` · Required · string: The first UTC day counted, `YYYY-MM-DD`.
- `to` · Required · string: The last UTC day counted, included. Not after today, and at most 366 days with `from`.

## What is counted

`runs`: production runs by the UTC day they started, a sub-flow’s counted with the run that called it. `testRuns`: the customer’s test runs. `assistantTokens`: the Keel tokens it used that the installation pays for.

Counts never shrink when runs are deleted. They are added up every few minutes: `asOf` says when.

## Responses

- 200 OK

  The account’s usage.

- 400 `VALIDATION_ERROR`

  `from` or `to` is missing or out of range.

- 404 `NOT_FOUND`

  You have no account with this ID.

- 500 `INTERNAL_ERROR`

  Something failed on the installation’s side. Try again.

Any call can also answer: [`401 UNAUTHORIZED`](https://docs.gorunner.io/errors#UNAUTHORIZED) · [`403 EMBED_NOT_LICENSED`](https://docs.gorunner.io/errors#EMBED_NOT_LICENSED) · [`403 IP_NOT_ALLOWED`](https://docs.gorunner.io/errors#IP_NOT_ALLOWED) · [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY). See [Errors](https://docs.gorunner.io/embed/api#errors).

Request

**curl**

```bash
GORUNNER="https://automations.example.com"
GORUNNER_EMBED_KEY="YOUR_PARTNER_KEY"  # gre_…
ACCOUNT_ID="acct-bakery"

URL="$GORUNNER/api/embed/v1/accounts/$ACCOUNT_ID/"
URL="${URL}usage?from=2026-10-01&to=2026-10-25"
curl "$URL" \
  -H "Authorization: Bearer $GORUNNER_EMBED_KEY"
```

**JavaScript**

```js
const GORUNNER = "https://automations.example.com";
const KEY = process.env.GORUNNER_EMBED_KEY; // gre_…
const ACCOUNT_ID = encodeURIComponent("acct-bakery");

const res = await fetch(
  `${GORUNNER}/api/embed/v1/accounts/` +
    `${ACCOUNT_ID}/` +
    `usage?from=2026-10-01&to=2026-10-25`,
  {
    headers: { Authorization: `Bearer ${KEY}` },
  },
);
const { data } = await res.json();
```

**Python**

```python
import os, requests
from urllib.parse import quote

GORUNNER = "https://automations.example.com"
KEY = os.environ["GORUNNER_EMBED_KEY"]  # gre_…
ACCOUNT_ID = quote("acct-bakery", safe="")

res = requests.get(
    f"{GORUNNER}/api/embed/v1/accounts/"
    f"{ACCOUNT_ID}/usage",
    params={
      "from": "2026-10-01",
      "to": "2026-10-25",
    },
    headers={"Authorization": f"Bearer {KEY}"},
)
data = res.json()["data"]
```

Response · 200 OK

```json
{
  "data": {
    "account": {
      "id": "acct-bakery",
      "name": "Bakery Ltd"
    },
    "from": "2026-10-01",
    "to": "2026-10-25",
    "runs": {
      "worked": 480,
      "failed": 30,
      "held": 1,
      "cancelled": 2,
      "inProgress": 1,
      "total": 514
    },
    "testRuns": 41,
    "assistantTokens": 182300,
    "asOf": "2026-10-25T08:55:00Z"
  }
}
```

**Every field**

It takes no body.

### Response · 200 OK

- `data` · object
  - `account` · object
    - `id` · string
    - `name` · string
  - `from` · string
  - `to` · string
  - `runs` · object: Production runs by the UTC day they started. `total` is the sum of the other five.
    - `worked` · integer
    - `failed` · integer
    - `held` · integer
    - `cancelled` · integer
    - `inProgress` · integer
    - `total` · integer
  - `testRuns` · integer: Runs started from the editor to test, counted apart.
  - `assistantTokens` · integer: Assistant tokens the installation paid for.
  - `asOf` · time or null: When the counts were last rolled up (every 5 minutes); null until the first count after the embed license arrives has finished.

Related: [List every account’s usage](https://docs.gorunner.io/embed/api/usage/list-usage) · [Usage, suspension and deletion](https://docs.gorunner.io/embed/usage-suspension-deletion)

Source: https://docs.gorunner.io/embed/api/usage/get-account-usage
