API referenceResources

Usage alerts

Alerts when usage runs above its trend or toward a contract's cap, tier or commitment.

More about this resource

Pleaxy watches the usage it reads for a buyer workspace - each connected AI provider and model, each cloud account and service - and the month's projection against your contracts. A finding is a subject running above its own trend (the last 3 complete days against the 14 before them, or the month on pace above last month), or the month's projection breaking a contract's spend cap, reaching its next spend tier or ending short of a minimum commitment. Each finding is notified once a month, again only when what it adds has grown by half, and at most 5 a run, the largest first. Amounts are never converted between currencies: each finding is in its subject's own currency.

Get usage alerts

Shows the alert setting and what the usage rules find right now.

GET/v1/workspaces/{regionId}/usage-alerts

Returns

200 OK with the object shown in the response.

More details

Returns the workspace's alert setting and what the rules find this month, and writes nothing. Each alert carries its finding with its figures, its text in English (title, body) with titleMessageId, bodyMessageId and their params to show it in the reader's language, and sentAt once this month's notification went out. Needs 'view' access to suppliers or to invoices.

Response fields

  • periodstring

    The month the findings are for, YYYY-MM.

  • presetobject

    What the sensitivity means: spikePct, how far above its trend a subject must run; pacePct, how far above last month the month must be on pace; minAmount, the least a finding must add over a month before it is scaled to a currency.

  • currencies[]object

    Each currency the workspace is billed in by a connected supplier, with the minimum a finding in it must reach; custom is true where the administrator set it.

  • alerts[].finding.type"spike" | "pace" | "contract_cap" | "contract_tier" | "contract_commitment" | "ai_commitment"

    spike: above its own trend. pace: the month on pace above last month. contract_cap, contract_tier and contract_commitment: the month's projection breaking a contract's spend cap, reaching its next spend tier or ending short of its minimum commitment. ai_commitment: an AI spend commitment on pace to end short.

  • alerts[].sentAtstring

    When this month's notification for the finding went out; absent when none has yet.

Errors

  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (workspaceId), or lacks the required role.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
GET /v1/workspaces/{regionId}/usage-alerts
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/usage-alerts" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "period": "string",
   "settings": {
      "enabled": boolean,
      "sensitivity": "low" | "medium" | "high",
      "minimums": { "string": number },
      "updatedAt": "string"
   },
   "preset": { "spikePct": number, "pacePct": number, "minAmount": number },
   "currencies": [
      { "currency": "string", "minimum": number, "defaultMinimum": number, "custom": boolean }
   ],
   "alerts": [
      {
         "key": "string",
         "finding": { "type": "string", ... },
         "title": "string",
         "titleMessageId": "string",
         "titleParams": { },
         "body": "string",
         "bodyMessageId": "string",
         "bodyParams": { },
         "sentAt": "string"
      }
   ],
   "generatedAt": "string"
}

Update usage alert settings

Turns usage alerts on or off and sets their sensitivity and minimums.

PATCH/v1/workspaces/{regionId}/usage-alerts/settings

Body

  • enabledboolean

    Whether usage alerts are sent.

  • sensitivity"low" | "medium" | "high"

    high: 25% above the trend, 20% above last month, from 100 a month. medium (the default): 50%, 30%, from 500. low: 100%, 50%, from 2,000. The minimum is in each subject's own currency, scaled for currencies like JPY (medium: JPY 75,000) unless the workspace set its own for that currency.

  • minimums{ [currency]: number | null }

    The least a finding must add (or miss by) over a month, per currency (ISO 4217, upper case), at most 50 currencies: used as set, whatever the sensitivity. Merged into what is stored; null for a currency goes back to its default.

Returns

200 OK with the object shown in the response.

More details

Changes what the workspace is alerted about and returns the saved setting. Each field left out keeps what is stored. Turned off, nothing is sent, and the spend page still shows what the rules find.

Signed-in session only, by an administrator of the buyer workspace: the setting decides what everyone in the workspace is told. An API key gets 403.

Errors

  • 400 Bad Request - A sensitivity that isn't low, medium or high, or a minimum that isn't an amount of 0 or more with at most two decimals for a three-letter currency code.
  • 403 Forbidden - Code HUMAN_SESSION_REQUIRED for an API key or an AI agent; otherwise the caller isn't an administrator of this buyer workspace ("Only a workspace administrator can change usage alerts: they decide what everyone in the workspace is told.").
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
PATCH /v1/workspaces/{regionId}/usage-alerts/settings
Request
curl -X PATCH "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/usage-alerts/settings" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "enabled": boolean,
   "sensitivity": "low" | "medium" | "high",
   "minimums": { "USD": 1000, "JPY": null }
}
Response · 200 OK
{
  "enabled": true,
  "sensitivity": "low",
  "minimums": {
    "PLATE-10MM": 18400
  },
  "updatedAt": "2026-11-20T08:15:02.000Z",
  "updatedBy": "Priya Nair"
}
Response schema
{
   "enabled": boolean,
   "sensitivity": "low" | "medium" | "high",
   "minimums": { "string": number },
   "updatedAt": "string",
   "updatedBy": "string"
}
Talk to us