CORTEX

Platform

The console Dashboard's aggregate: runs per day, tenant and user counts, subscriptions and MRR, invoices, wallets, AI spend and the busiest organizations, in one read-only response.

Common responses

These responses apply across endpoints in this section unless an endpoint documents an additional response.

StatusMeaningBody
200Request succeeded.Endpoint response object.
201Resource created.Created resource object.
400Invalid request.Error envelope.
401Missing or invalid bearer token.Error envelope.
404Resource not found or not visible to the current organization.Error envelope.

Platform

Get platform overview

The console Dashboard's single aggregate: everything a platform operator reads first thing, in one response, fetched when the page opens. `runs_week` compares the last 7 days with the 7 before; `runs_total` counts every run the platform has ever finished by outcome, for the all-time success rate (completed over completed + failed); `latency24h` gives time to first token over the last 24 hours as median and 95th percentile in milliseconds (null until a run has produced one). Activity covers every live organization, Cognit's own system organization included, so the figures reconcile with the runs series and the organization ranking; `organizations`, `users` and `subscriptions` count customers only ( `users.active7d` / `active30d` are people who started a run in the window, counted across every organization so they line up with the runs series; `demo_*` covers organizations carrying an expiry, and `demo_expiring_soon` means within 3 days). `subscriptions` counts live subscriptions by status and estimates `mrr_usd_minor` as committed seats × plan price for active and trialing USD subscriptions, with yearly plans spread over twelve months. `revenue` is money actually kept — succeeded payments plus refunds (stored as negative amounts), converted to USD with each invoice's `fx_rate` and dated by `paid_at` — all time, this UTC calendar month and the month before. `invoices` reports open (`open`, `partially_paid`) and overdue (open and past `due_date`) invoices with the amount still due in USD minor units. `wallets.low_balance` counts wallets at or below their configured threshold. `usage` gives platform-wide AI spend for the current and previous UTC calendar month (from monthly rollups), and spend and tokens over the last 7 days (all four token counters — input, output and both cache columns — which are disjoint) (spend by provider and the run, token and revenue series each have their own endpoint). `providers.configured` counts providers the platform can call (active, with an API key) and `providers.missing_api_key` the active ones still waiting for a key; `models.configured` counts the model families that belong to configured providers. Numeric suffixes stay attached to key names (`new7d`, `cost7d_usd_minor`), matching the health snapshot's `completed24h`. Requires the console `platform` section.

GET/v1/admin/platform/overview
Example requestbash
curl "https://api.cortex.cognit-dx.com/v1/admin/platform/overview" \
  -H "Authorization: Bearer $CORTEX_TOKEN"

Response codes

StatusMeaningBody
401Missing or invalid credential.`{ error, code, request_id }`
403Admin access required — the caller's console role lacks the `platform` section.`{ error, code, request_id }`
200 OKjson
{
  "generated_at": "2026-09-03T08:12:04.000Z",
  "runs_week": {
    "current": {
      "total": 1480,
      "failed": 31
    },
    "previous": {
      "total": 1322,
      "failed": 40
    }
  },
  "runs_total": {
    "completed": 48210,
    "failed": 1043,
    "cancelled": 366
  },
  "latency24h": {
    "ttft_p50_ms": 840,
    "ttft_p95_ms": 2310
  },
  "organizations": {
    "active": 41,
    "suspended": 2,
    "deleted": 5,
    "new7d": 3,
    "new30d": 9,
    "demo_active": 6,
    "demo_expiring_soon": 1
  },
  "users": {
    "total": 612,
    "new7d": 18,
    "active7d": 143,
    "active30d": 322
  },
  "automation": {
    "agents": 133,
    "workflows": 57,
    "triggers_enabled": 24
  },
  "subscriptions": {
    "active": 38,
    "trialing": 4,
    "past_due": 1,
    "canceled": 7,
    "mrr_usd_minor": 1284000
  },
  "revenue": {
    "all_time_usd_minor": 18425000,
    "month_usd_minor": 1284000,
    "previous_month_usd_minor": 1142000
  },
  "invoices": {
    "open_count": 9,
    "open_usd_minor": 2413500,
    "overdue_count": 2,
    "overdue_usd_minor": 486000
  },
  "wallets": {
    "total": 29,
    "low_balance": 3,
    "enforcement_enabled": 21
  },
  "usage": {
    "month_cost_usd_minor": 418230,
    "previous_month_cost_usd_minor": 396110,
    "cost7d_usd_minor": 97420,
    "tokens7d": 48210334
  },
  "providers": {
    "configured": 7,
    "missing_api_key": 2
  },
  "models": {
    "configured": 41
  }
}

List top organizations

The Dashboard's "Most active organizations" ranking: organizations ordered by the number of runs they created inside a caller-chosen window, with how many of those failed, their AI spend for the current UTC calendar month (`spent_month_minor`, USD minor units, from the monthly rollup) and the name of their live plan. `window_hours` echoes the window used. Requires the console `platform` section.

GET/v1/admin/platform/top-organizations

Query parameters

NameTypeRequiredDescription
hoursintegerOptionalWindow length in hours, 1 to 720 (30 days). Defaults to 168 (7 days).
limitintegerOptionalMaximum rows, 1 to 20. Defaults to 8.
Example requestbash
curl "https://api.cortex.cognit-dx.com/v1/admin/platform/top-organizations?hours=24&limit=5" \
  -H "Authorization: Bearer $CORTEX_TOKEN"

Response codes

StatusMeaningBody
400`hours` or `limit` is out of range.`{ error, code: "validation_error", request_id }`
401Missing or invalid credential.`{ error, code, request_id }`
403Admin access required — the caller's console role lacks the `platform` section.`{ error, code, request_id }`
200 OKjson
{
  "generated_at": "2026-09-04T08:12:04.000Z",
  "window_hours": 24,
  "data": [
    {
      "organization_id": "f1ba15e0-ebe8-4187-afe6-03ccb25b8815",
      "name": "Acme Corp",
      "runs": 96,
      "failed": 2,
      "spent_month_minor": 98210,
      "plan_name": "Team"
    },
    {
      "organization_id": "2c0f4d7e-5b1a-4e8c-9f3d-6a7b8c9d0e1f",
      "name": "Globex",
      "runs": 41,
      "failed": 0,
      "spent_month_minor": 40350,
      "plan_name": "Starter"
    }
  ]
}

List spend by provider

The Dashboard's "Spend by provider" card: every configured AI provider (active, with an API key — the same rule as `providers.configured`), with the platform-wide spend routed through it inside a caller-chosen window (USD minor units, all four cost columns of `usage_events`), largest first and then by name. Providers the platform could call but did not use in the window are listed at zero; inactive providers and providers without a key are left out. `window_hours` echoes the window used. Requires the console `platform` section.

GET/v1/admin/platform/provider-spend

Query parameters

NameTypeRequiredDescription
hoursintegerOptionalWindow length in hours, 1 to 720 (30 days). Defaults to 168 (7 days).
Example requestbash
curl "https://api.cortex.cognit-dx.com/v1/admin/platform/provider-spend?hours=168" \
  -H "Authorization: Bearer $CORTEX_TOKEN"

Response codes

StatusMeaningBody
400`hours` is out of range.`{ error, code: "validation_error", request_id }`
401Missing or invalid credential.`{ error, code, request_id }`
403Admin access required — the caller's console role lacks the `platform` section.`{ error, code, request_id }`
200 OKjson
{
  "generated_at": "2026-09-04T08:12:04.000Z",
  "window_hours": 168,
  "data": [
    {
      "provider_id": "0d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "provider_name": "Anthropic",
      "cost_usd_minor": 412030
    },
    {
      "provider_id": "5f6e7d8c-9b0a-4c1d-a2e3-f4a5b6c7d8e9",
      "provider_name": "OpenAI",
      "cost_usd_minor": 128840
    },
    {
      "provider_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "provider_name": "Cerebras",
      "cost_usd_minor": 0
    }
  ]
}

Get the runs series

The Dashboard's runs chart: platform-wide run outcomes (`completed`, `failed`, `cancelled`) per UTC calendar bucket. `granularity=day` returns the last 30 days ending today, `month` the last 12 months ending this month, `year` every year from the first recorded run to this year. Buckets with no runs are present with zeros, oldest first; `period` is `YYYY-MM-DD`, `YYYY-MM` or `YYYY`, the same shape the metric series uses. Requires the console `platform` section.

GET/v1/admin/platform/runs-series

Query parameters

NameTypeRequiredDescription
granularitystringRequired`day`, `month` or `year`.
Example requestbash
curl "https://api.cortex.cognit-dx.com/v1/admin/platform/runs-series?granularity=day" \
  -H "Authorization: Bearer $CORTEX_TOKEN"

Response codes

StatusMeaningBody
400`granularity` is missing or not one of the allowed values.`{ error, code: "validation_error", request_id }`
401Missing or invalid credential.`{ error, code, request_id }`
403Admin access required — the caller's console role lacks the `platform` section.`{ error, code, request_id }`
200 OKjson
{
  "generated_at": "2026-09-04T08:12:04.000Z",
  "granularity": "day",
  "data": [
    {
      "period": "2026-09-02",
      "completed": 212,
      "failed": 6,
      "cancelled": 3
    },
    {
      "period": "2026-09-03",
      "completed": 198,
      "failed": 4,
      "cancelled": 1
    },
    {
      "period": "2026-09-04",
      "completed": 87,
      "failed": 2,
      "cancelled": 0
    }
  ]
}

Get a metric series

One platform-wide metric bucketed for a Dashboard line chart. `metric=tokens` sums input + output tokens from `usage_events`; `metric=revenue` sums money kept — succeeded payments plus refunds (negative amounts) converted to USD with each invoice's `fx_rate`, dated by `paid_at` — in USD minor units. `granularity=day` returns the last 30 UTC days ending today, `month` the last 12 months ending this month, `year` every year from the first recorded one to this year. Buckets with nothing recorded are present with `value: 0`, oldest first; `period` is `YYYY-MM-DD`, `YYYY-MM` or `YYYY`. Requires the console `platform` section.

GET/v1/admin/platform/series

Query parameters

NameTypeRequiredDescription
metricstringRequired`tokens` or `revenue`.
granularitystringRequired`day`, `month` or `year`.
Example requestbash
curl "https://api.cortex.cognit-dx.com/v1/admin/platform/series?metric=revenue&granularity=month" \
  -H "Authorization: Bearer $CORTEX_TOKEN"

Response codes

StatusMeaningBody
400`metric` or `granularity` is missing or not one of the allowed values.`{ error, code: "validation_error", request_id }`
401Missing or invalid credential.`{ error, code, request_id }`
403Admin access required — the caller's console role lacks the `platform` section.`{ error, code, request_id }`
200 OKjson
{
  "generated_at": "2026-09-04T08:12:04.000Z",
  "metric": "revenue",
  "granularity": "month",
  "data": [
    {
      "period": "2025-10",
      "value": 982000
    },
    {
      "period": "2025-11",
      "value": 1046500
    },
    {
      "period": "2026-08",
      "value": 1142000
    },
    {
      "period": "2026-09",
      "value": 1284000
    }
  ]
}