API reference

AI spend

AI model spend by invoicer, vendor, model and meter, set against your purchase orders.

More about this resource

New with AI spend controls. AI spend is what the AI service lines on your connected AWS, Google Cloud, Azure and OCI billing cost (Amazon Bedrock, SageMaker, Vertex AI, Azure OpenAI, OCI Generative AI and the marketplace models on the same invoice), plus what the AI providers you connect directly report (see AI providers). Pleaxy reads them through the same read-only connection as the rest of the bill, under the same data-source choice: a connection that allows current_cost gives the month to date and a forecast, one that allows invoices the closed month. AWS is the exception: it gives AI lines through Cost Explorer only, so an AWS connection needs current_cost for any AI figure (with it, the closed month comes too). The supplier is whoever invoices (the invoicer); the company whose model was used is the vendor on the line, so Claude on Bedrock is AWS spend with vendor anthropic, and nothing is counted twice. Every amount is in the invoicer's billing currency, never converted or summed across currencies. Attribution rules map the providers' tags, labels, projects and workspaces to cost centers (GetAiAttribution), and an approved order line can set the provider's own spending ceiling (SetAiSpendLimit, opt-in).

Get AI spend

AI spend for a period, by invoicer, vendor, model or cost center.

GET/v1/workspaces/{regionId}/ai-spend

Parameters

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

  • groupBy"invoicer" | "vendor" | "model" | "costCenter"

    What each group is. Defaults to invoicer, which matches your invoices. vendor sums one model vendor across invoicers (what you spend on Claude, wherever it is billed), model one model id as billed, costCenter the attribution rules' cost centers.

Returns

200 OK with the object shown in the response.

More details

For a period (by default the current month), the AI spend of every connected invoicer, grouped as groupBy says: month to date, the forecast for the whole period, the last closed month and the change against it, with the usage by meter, and beside each invoicer the open purchase order lines raised to it and what is left on them. The figures are the AI lines the connections synced (daily for current_cost, as the month-to-date cost today). An invoicer whose connection reads only invoices shows the closed month: its month to date and forecast are absent (an AWS account that reads only invoices has no AI lines and is listed in notReadable). The forecast is the provider's where it gives one (AWS Cost Explorer), otherwise linear on the days elapsed. Amounts are in each invoicer's billing currency, and totals are one entry per currency, never summed across currencies. Grouping by costCenter follows the attribution rules (GetAiAttribution); a line no rule matches is unattributed.

Response fields

  • periodstring

    The month the figures are for, YYYY-MM.

  • asOfstring

    When the newest line was synced, ISO 8601. The month to date is as of then, not now.

  • totalsArray<object>

    One entry per billing currency, never summed across currencies: monthToDate, forecast for the whole period, lastMonth (the last closed month) and changePct, the forecast's change against lastMonth in percent.

  • groups[].keystring

    As groupBy says: the invoicer's cloud connection id; the vendor (anthropic, openai, google, meta, mistral, amazon, microsoft, cohere, xai, deepseek or unknown for a usage type Pleaxy hasn't mapped yet); the model id as billed, e.g. claude-sonnet-4-5 or gemini-2.5-pro; or the cost center's code.

  • groups[].labelstring

    What to show for the group: the connection's account label, the vendor's name, the model's name or the cost center's name.

  • groups[].invoicerstring

    Who bills the group's spend, a cloud or an AI provider, with invoicerId its connection: always with groupBy invoicer, and for a vendor or model group when a single connection bills all of it (Claude only through Bedrock, say); absent when several do. A cost center group never has one.

  • groups[].monthToDatenumber

    In the group's currency, with forecast, lastMonth and changePct as in totals. monthToDate and forecast are absent for an invoicer whose connection reads only invoices: it shows lastMonth only.

  • groups[].quantitiesArray<object>

    The usage by meter. Token-metered lines: input_tokens, output_tokens, cached_input_tokens, cache_write_tokens, batch_input_tokens, batch_output_tokens, images, audio_seconds, embeddings_tokens or requests. Capacity lines: gpu_hours, ptu_hours, model_units_hours or cluster_hours. other for a line Pleaxy hasn't mapped to a meter yet. unit is the quantity's unit: 1M_tokens, tokens, requests, images, seconds, gpu_hours, ptu_hours, model_unit_hours, or units for an unmapped line.

  • groups[].purchaseOrdersArray<object>

    The open purchase order lines raised to the group's invoicer, with what is left on each (remaining, in the group's currency) after the invoices already drawn on it. Only for a group with an invoicer.

  • groups[].servicesArray<object>

    Only with groupBy invoicer: the group's figures by the provider's own service (Amazon Bedrock, with the marketplace models it bills; Amazon SageMaker; Vertex AI; ...), as the Spend page's Cloud tab shows them.

  • unattributedArray<object>

    Only with groupBy costCenter: the spend no attribution rule matched, one entry per currency in a group's shape, shown and never hidden. Write a rule for it with SetAiAttribution.

  • notReadableArray<object>

    Connected accounts with no AI lines, and why: needs_current_cost for an AWS account whose connection doesn't allow current cost (AWS gives its AI lines through Cost Explorer only), not_synced_yet for one whose AI lines haven't been read yet. Absent when there are none.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM, or groupBy isn't invoicer, vendor, model or costCenter.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend
Request
GET /v1/workspaces/reg_01k5x8p9j3q7vn2mhb4tzc6rde.buyer/ai-spend?period=2026-10&groupBy=vendor
Response · 200 OK
{
   "period": "2026-10",
   "asOf": "2026-10-29T06:10:00.000Z",
   "totals": [
      { "currency": "USD", "monthToDate": 57280.14, "forecast": 61400, "lastMonth": 48930.55, "changePct": 25.5 }
   ],
   "groups": [
      {
         "key": "anthropic",
         "label": "Anthropic",
         "invoicer": "aws",
         "invoicerId": "conn_01k7q2n4m8b3xd5fwj9hz6rsvt",
         "currency": "USD",
         "monthToDate": 44612.3,
         "forecast": 47830,
         "lastMonth": 38104.2,
         "changePct": 25.5,
         "quantities": [
            { "meter": "input_tokens", "unit": "1M_tokens", "quantity": 7120.4 },
            { "meter": "output_tokens", "unit": "1M_tokens", "quantity": 918.3 },
            { "meter": "cached_input_tokens", "unit": "1M_tokens", "quantity": 15480 },
            { "meter": "cache_write_tokens", "unit": "1M_tokens", "quantity": 1288.7 }
         ],
         "purchaseOrders": [ { "poId": "PO-8842", "lineNo": 1, "remaining": 4200 } ]
      },
      {
         "key": "amazon",
         "label": "Amazon",
         "invoicer": "aws",
         "invoicerId": "conn_01k7q2n4m8b3xd5fwj9hz6rsvt",
         "currency": "USD",
         "monthToDate": 12667.84,
         "forecast": 13570,
         "lastMonth": 10826.35,
         "changePct": 25.3,
         "quantities": [
            { "meter": "input_tokens", "unit": "1M_tokens", "quantity": 10874.8 },
            { "meter": "output_tokens", "unit": "1M_tokens", "quantity": 1240 }
         ],
         "purchaseOrders": [ { "poId": "PO-8842", "lineNo": 1, "remaining": 4200 } ]
      }
   ]
}

List AI usage lines

Lists the AI usage lines behind the figures, one page at a time.

GET/v1/workspaces/{regionId}/ai-spend/lines

Parameters

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

  • invoicerIdstring

    Only lines billed through this cloud connection.

  • vendorstring

    Only this model vendor, e.g. anthropic.

  • modelstring

    Only this model id as billed, e.g. claude-sonnet-4-5.

  • costCenterstring

    Only lines attributed to this cost center (its code). Lines are attributed by the attribution rules.

  • limitnumber

    Page size, 1 to 500. Defaults to 100.

  • cursorstring

    The nextCursor from the previous page. Omit it for the first page.

Returns

200 OK with the object shown in the response.

More details

The normalised lines the AI spend is summed from: one per invoicer, day, vendor, model, meter and region, as the provider's billing reported it. Each connector reads its own names (AWS Cost Explorer usage types, Google Cloud billing export SKUs, Azure Cost Management meters, OCI usage SKUs) and maps them to a vendor, model and meter; a usage type Pleaxy doesn't know yet is kept with its raw name and vendor unknown, never dropped. Newest day first. Pass a page's nextCursor back as cursor for the next page, and keep going until nextCursor is absent. Lines are kept at daily grain for 90 days, then by month.

Response fields

  • invoicerstring

    The cloud whose bill the line is on, with invoicerId its connection. It is the supplier, whatever the model's vendor.

  • vendorstring

    The company whose model was used, read from the usage type, SKU or meter name. unknown when Pleaxy hasn't mapped that usage type yet; rawUsageType then says what the provider called it.

  • modelstring

    The model id as the provider bills it, e.g. claude-sonnet-4-5 or gemini-2.5-pro.

  • shapestring

    tokens for a token-metered line (vendor × model × meter × region); capacity for provisioned throughput, GPU hours or a dedicated cluster (vendor × sku × meter).

  • meterstring

    input_tokens, output_tokens, cached_input_tokens, cache_write_tokens, batch_input_tokens, batch_output_tokens, images, audio_seconds, embeddings_tokens or requests for tokens; gpu_hours, ptu_hours, model_units_hours or cluster_hours for capacity; other, with unit units, for a usage type Pleaxy hasn't mapped yet.

  • daystring

    YYYY-MM-DD. After 90 days lines are kept by month, and day is then the month's first day.

  • amountnumber

    What the provider costs the line, before tax, in currency: as the provider reports it, never converted.

  • unitPricenumber

    amount divided by quantity, in the rate card's unit, when quantity is above 0: what the line was effectively charged, to set against ListAiRateCards.

  • attributionobject

    How the provider itself attributes the line, under the names it uses: a cost allocation tag or application inference profile (AWS), a label or project (Google Cloud), a resource group or tag (Azure), a compartment (OCI). Absent when the line carries none.

  • sourcestring

    Which read the line came from: AWS Cost Explorer (cost_explorer), the Google Cloud BigQuery billing export (billing_export), Azure Cost Management (cost_management) or the OCI Usage API (usage_api).

  • rawServicestring

    The provider's own service name and, as rawUsageType, its usage type, SKU or meter name, kept for audits and on every unmapped line.

  • nextCursorstring

    Opaque. Absent when there are no older lines.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM, limit is out of range, or cursor isn't one this route returned.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/lines
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/lines" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "lines": [
      {
         "invoicerId": "string",
         "invoicer": "aws" | "gcp" | "azure" | "oci" | "openai" | "anthropic" | "mistral" | "snowflake",
         "vendor": "anthropic" | "openai" | "google" | "meta" | "mistral" | "amazon" | "microsoft" | "cohere" | "xai" | "deepseek" | "unknown",
         "model": "string",
         "shape": "tokens" | "capacity",
         "meter": "string",
         "region": "string",
         "day": "string",
         "quantity": number,
         "unit": "1M_tokens" | "tokens" | "requests" | "images" | "seconds" | "gpu_hours" | "ptu_hours" | "model_unit_hours" | "units",
         "amount": number,
         "currency": "string",
         "unitPrice": number,
         "attribution": { "tag": "string", "label": "string", "project": "string", "resourceGroup": "string", "compartment": "string", "inferenceProfile": "string" },
         "source": "cost_explorer" | "billing_export" | "cost_management" | "usage_api",
         "rawService": "string",
         "rawUsageType": "string"
      }
   ],
   "nextCursor": "string"
}

List AI rate cards

Lists the public list prices of AI models, as in force on a day.

GET/v1/workspaces/{regionId}/ai-rate-cards

Parameters

  • invoicer"aws" | "gcp" | "azure" | "oci"

    Only this invoicer's prices.

  • vendorstring

    Only this vendor's models, e.g. anthropic.

  • modelstring

    Only this model id as billed.

  • onstring

    A day, YYYY-MM-DD: only the entry in force on it, per invoicer, vendor, model, meter and region. Left out, every entry is returned.

Returns

200 OK with the object shown in the response.

More details

The public list prices Pleaxy keeps for every invoicer, vendor, model, meter and region it maps, with effective dates, taken from the providers' own pricing pages. A price change is a new entry with its own effectiveFrom; nothing is edited in place, so a line is always judged against the price that applied on its day. With on, only the entry in force on that day is returned per invoicer, vendor, model, meter and region; without it, every entry, past and current. A contract's negotiated rate or discount off list overrides the rate card when Pleaxy checks your lines; the rate cards themselves can't be edited.

Response fields

  • unitPricenumber

    The list price per unit, in currency: per 1,000,000 tokens for 1M_tokens, per hour for the capacity units.

  • regionstring

    Only where the invoicer prices by region; absent for a price that applies everywhere.

  • effectiveFromstring

    The day the price took effect, YYYY-MM-DD, and as effectiveTo, once replaced, the last day it applied. No effectiveTo: still in force.

  • sourceUrlstring

    The provider's pricing page the entry was taken from.

Errors

  • 400 Bad Request - on isn't a day as YYYY-MM-DD, or invoicer isn't aws, gcp, azure or oci.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-rate-cards
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-rate-cards" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
[
   {
      "invoicer": "aws" | "gcp" | "azure" | "oci" | "openai" | "anthropic" | "mistral" | "snowflake",
      "vendor": "string",
      "model": "string",
      "meter": "string",
      "region": "string",
      "unit": "1M_tokens" | "tokens" | "requests" | "images" | "seconds" | "gpu_hours" | "ptu_hours" | "model_unit_hours",
      "unitPrice": number,
      "currency": "string",
      "effectiveFrom": "string",
      "effectiveTo": "string",
      "sourceUrl": "string"
   }
]

Check AI spend

Says whether the period's forecast fits the open purchase order lines and the budget.

POST/v1/workspaces/{regionId}/ai-spend/check

Body

  • invoicerIdstring

    The cloud connection to check: its forecast against every open purchase order line raised to it.

  • costCenterstring

    A cost center's code or name: its attributed AI spend and forecast against its budget for the period, when budgets are on. Lines are attributed by the attribution rules.

  • poIdstring

    A purchase order: only its open lines, for the invoicer it was raised to.

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

Returns

200 OK with the object shown in the response.

More details

Answers "will Bedrock fit PO-8842 this month" from the same figures as GetAiSpend: the month to date and forecast of one invoicer, one cost center or one purchase order, set against the open purchase order lines raised to that invoicer and, with a cost center and budgets on, its budget. Nothing is saved and nothing blocks: the outcome is what the Spend page's AI tab shows and what the Assistant and the check_ai_spend MCP tool answer. Name at least one of invoicerId, costCenter and poId; poId implies the invoicer it was raised to.

Response fields

  • outcomestring

    fits: the forecast is within what the open lines (and the budget) have left. over: it isn't; each line's overBy says by how much, and budget.remaining goes negative. no_po: no open purchase order line is raised to the invoicer for the period. no_budget: a cost center was given but has no budget for the period, or budgets are off.

  • currencystring

    The invoicer's billing currency, which monthToDate, forecast and the lines' figures are in. Nothing is converted: a budget kept in another currency gives no_budget.

  • purchaseOrdersArray<object>

    The open lines checked, each with remaining after the invoices already drawn on it and, when the forecast exceeds that, overBy.

  • budgetobject

    Only with costCenter and budgets on: the cost center's budget for the period, committed (open purchase orders), actual (invoices), accruing (attributed AI spend month to date, not yet invoiced: a third figure, never folded into the other two) and remaining.

Errors

  • 400 Bad Request - None of invoicerId, costCenter and poId was given, or period isn't a month as YYYY-MM.
  • 404 Not Found - No cloud connection, cost center or purchase order with that id in the workspace.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
POST /v1/workspaces/{regionId}/ai-spend/check
Request
curl -X POST "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/check" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "invoicerId": "string",
   "costCenter": "string",
   "poId": "string",
   "period": "string"
}
Response · 200 OK
{
   "outcome": "fits" | "over" | "no_po" | "no_budget",
   "period": "string",
   "currency": "string",
   "monthToDate": number,
   "forecast": number,
   "purchaseOrders": [ { "poId": "string", "lineNo": number, "remaining": number, "overBy": number } ],
   "budget": { "costCenter": "string", "budget": number, "committed": number, "actual": number, "accruing": number, "remaining": number }
}

Suggest AI po lines

Purchase order lines prefilled from one invoicer's AI usage.

GET/v1/workspaces/{regionId}/ai-spend/po-lines

Parameters

  • invoicerIdstringRequired

    The invoicer whose usage the lines come from: groups[].invoicerId from GetAiSpend.

  • periodstring

    The month, YYYY-MM. Defaults to the last closed month.

Returns

200 OK with the object shown in the response.

More details

The lines "Add AI lines" prefills on a purchase order: for one invoicer and a month (by default the last closed one), one line per model and meter it billed, with the month's volume rounded up as the quantity and a unit price from your active contract term for that model (its rate, or its discount off list), else the list price today, else what the month was billed at - priceSource says which. Lines Pleaxy couldn't place on a meter, and credits without a money price, aren't offered. Nothing is saved: send the lines to CreatePurchaseOrder, with the contractId a line names. Needs 'view' access to purchase orders.

Response fields

  • providerstring

    For a cloud invoicer: the provider to raise the order to. A direct AI provider gives supplierConnectionId, its supplier entry, instead.

  • lines[].aiobject

    The line's AI scope, to send as lineItems[].ai.

  • lines[].unitstring

    The meter's unit: 1M_tokens for a token meter, gpu_hours and the like for capacity.

  • lines[].priceSourcestring

    contract (contractId and contractTermId name the term), list (the rate card on today's date) or billed (what the month cost per unit, when Pleaxy keeps no price for the model).

  • lines[].periodQuantitynumber

    What the month used, with periodAmount what it was billed, for the order form to show beside the line.

Errors

  • 400 Bad Request - invoicerId is missing, or period isn't a month as YYYY-MM.
  • 404 Not Found - No connected invoicer with that id in the workspace.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/po-lines
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/po-lines" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "invoicerId": "string",
   "invoicer": "string",
   "period": "string",
   "provider": "string",
   "supplierConnectionId": "string",
   "lines": [
      {
         "ai": { "invoicer": "string", "vendor": "string", "model": "string", "meter": "string", "region": "string" },
         "unit": "string",
         "qty": number,
         "unitPrice": number,
         "currency": "string",
         "priceSource": "contract" | "list" | "billed",
         "contractId": "string",
         "contractTermId": "string",
         "periodQuantity": number,
         "periodAmount": number
      }
   ]
}

Raise next AI period

Drafts the same order for the following month.

POST/v1/workspaces/{regionId}/ai-spend/next-period/{poId}

Parameters

  • poIdstringRequired

    The order to raise again: one with AI lines, or a cloud provider's order.

Returns

201 Created with the object shown in the response.

More details

"Raise next period": a draft of the same order - supplier, cost center, contract and lines - for the month after its lines'. Each AI line's quantity is the forecast from this month's usage so far, linear on the days elapsed (its own quantity when nothing was used yet); every other line keeps its quantity. The draft goes through the usual approval when submitted. Takes no body. Needs 'create' access to purchase orders.

Errors

  • 400 Bad Request - The order has no AI lines and isn't a cloud order.
  • 404 Not Found - No such order in the workspace.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
POST /v1/workspaces/{regionId}/ai-spend/next-period/{poId}
Request
curl -X POST "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/next-period/{poId}" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 201 Created
PurchaseOrder (the draft), as GetPurchaseOrder returns it

Get AI recommendations

AI spend no order covers, and cheaper ways to buy it.

GET/v1/workspaces/{regionId}/ai-spend/recommendations

Parameters

  • periodstring

    The month to check cover for, YYYY-MM. Defaults to this month.

Returns

200 OK with the object shown in the response.

More details

What the Spend page's AI tab recommends. uncovered lists each invoicer whose forecast for the month no open purchase order covers: no_po when no order is raised to it, over_po when the forecast runs past what its orders have left, with gap the amount a new order needs. savings lists cheaper ways to buy last month's usage, priced at today's list prices: batch (the most moving interactive tokens to the batch rate would save), cache (what each further 10% of input read from the cache saves) and reserve (GPU-hours used at a steady floor on most days, and the GPUs that floor keeps busy; no amount, since reservations are priced by contract). Amounts under 10 aren't listed, and every amount stays in the invoicer's billing currency. Needs 'view' access to suppliers or to invoices.

Response fields

  • basisPeriodstring

    The month the savings are read from: the last closed one.

  • uncovered[].coverednumber

    What the open order lines raised to this invoicer have left for the month.

  • uncovered[].gapnumber

    forecast minus covered: what a new order needs. DraftAiOrders drafts it.

  • uncovered[].poIdsstring[]

    For over_po, the open orders that cover part of it.

  • accountsobject[]

    The same as uncovered for whole cloud accounts: all their spend, from the provider's current estimate, against the open orders covering the account. This month only. An account's AI spend is part of it, so never add the two lists.

  • savings[].savingnumber

    batch: the most it saves a month if all of it ran as batch (only work that can wait suits it). cache: what each further 10% of input served from the cache saves a month. Absent for reserve.

  • savings[].detail.cachedSharenumber

    cache: the share of input already read from the cache, 0 to 1.

  • savings[].detail.reservableUnitsnumber

    reserve: the GPUs the steady floor of steadyHoursPerDay keeps busy around the clock, on daysUsed days of the month.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/recommendations
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/recommendations" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "period": "string",
   "basisPeriod": "string",
   "uncovered": [
      {
         "invoicerId": "string",
         "invoicer": "string",
         "label": "string",
         "currency": "string",
         "monthToDate": number,
         "forecast": number,
         "covered": number,
         "gap": number,
         "reason": "no_po" | "over_po",
         "poIds": [ "string" ]
      }
   ],
   "accounts": [ "same as uncovered, for whole cloud accounts" ],
   "savings": [
      {
         "kind": "batch" | "cache" | "reserve",
         "invoicerId": "string",
         "invoicer": "string",
         "label": "string",
         "vendor": "string",
         "model": "string",
         "currency": "string",
         "spend": number,
         "saving": number,
         "detail": { "interactiveRate": number, "batchRate": number, "inputRate": number, "cachedRate": number, "cachedShare": number, "daysUsed": number, "steadyHoursPerDay": number, "reservableUnits": number }
      }
   ]
}

Draft AI orders

Drafts an order for each invoicer's uncovered AI spend.

POST/v1/workspaces/{regionId}/ai-spend/draft-orders

Body

  • invoicerIdsstring[]Required

    The invoicers to draft an order for, 1 to 20: uncovered[].invoicerId from GetAiRecommendations.

  • periodstring

    The month the orders cover, YYYY-MM. Defaults to this month.

  • scopestring

    ai (the default): lines per model and meter for the AI usage. account: one amount line for everything a cloud account bills, up to its gap in accounts, to the month's end.

Returns

200 OK with the object shown in the response.

More details

"Draft order" on a recommendation: for each invoicer named, a draft purchase order for the month with one line per model and meter of last month's usage, priced as SuggestAiPoLines prices them, each quantity the forecast from this month's usage so far. When open orders already cover part of the forecast, the quantities are scaled to the gap. A cloud's draft is raised to the provider for that account; a direct AI provider's to its supplier entry. skipped says why an invoicer got no draft. Drafts go through the usual approval when submitted. Needs 'create' access to purchase orders.

Response fields

  • drafts[].poIdstring

    The draft order: GetPurchaseOrder reads it, and submitting it sends it for approval.

  • skipped[].reasonstring

    no_usage: no AI usage to base an order on yet. no_supplier: a direct AI provider with no supplier entry to raise it to. no_forecast (scope account): no current spend estimate for the account yet. already_drafted: a draft, or an order waiting on approval, is already there for this spend this month; poId names it, and no second draft is made.

Errors

  • 400 Bad Request - invoicerIds is empty or has more than 20, period isn't a month as YYYY-MM, or scope is account for an invoicer that isn't a cloud account.
  • 404 Not Found - No connected invoicer with one of those ids in the workspace.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
POST /v1/workspaces/{regionId}/ai-spend/draft-orders
Request
curl -X POST "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/draft-orders" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "invoicerIds": [ "string" ],
   "period": "string",
   "scope": "ai" | "account"
}
Response · 200 OK
{
   "period": "string",
   "drafts": [ { "invoicerId": "string", "poId": "string", "currency": "string", "total": number } ],
   "skipped": [ { "invoicerId": "string", "reason": "no_usage" | "no_supplier" | "no_forecast" | "already_drafted", "poId": "string", "message": "string", "messageId": "string", "params": { } } ]
}

List AI commitments

Committed AI spend and capacity, and prepaid credits, with what is used.

GET/v1/workspaces/{regionId}/ai-spend/commitments

Returns

200 OK with the object shown in the response.

More details

What the Spend page's Commitments tab shows: each term of your active contracts with a committed spend or reserved capacity, with what the synced AI usage has used of it within the term, what's left and, for spend, the pace to the term's end; and each prepaid credit order line with what its invoices have drawn. Needs 'view' access to suppliers or to invoices.

Response fields

  • committednumber

    spend: the committed amount, in currency. capacity: the reserved units times the hours of the term so far. prepaid_credit: what the order line bought.

  • usednumber

    spend: the amounts of the synced AI lines the term covers, in its currency. capacity: the hours used. prepaid_credit: what invoices drew on the line.

  • projectednumber

    spend only: what the term will have used by its end at the pace so far.

Errors

  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/commitments
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/commitments" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
[
   {
      "kind": "spend" | "capacity" | "prepaid_credit",
      "contractId": "string",
      "contractTitle": "string",
      "termId": "string",
      "poId": "string",
      "lineNo": number,
      "supplier": "string",
      "description": "string",
      "ai": { "invoicer": "string", "vendor": "string", "model": "string", "meter": "string" },
      "currency": "string",
      "termStart": "string",
      "termEnd": "string",
      "committed": number,
      "used": number,
      "remaining": number,
      "usedPct": number,
      "projected": number,
      "unit": "string"
   }
]

Get AI renewal rule

The rule that drafts next month's AI orders.

GET/v1/workspaces/{regionId}/ai-spend/renewal-rule

Returns

200 OK with the object shown in the response.

More details

Whether next month's AI orders are drafted from the forecast, from which day of the month, and what its last run drafted. Off until someone switches it on. Needs 'view' access to purchase orders.

Response fields

  • ownerSubstring

    Who switched it on: the drafts are raised in their name, while they are still a member of the workspace.

  • draftedForstring

    The last month drafts were raised for, YYYY-MM: each month is drafted once.

Errors

  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/renewal-rule
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/renewal-rule" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "enabled": boolean,
   "dayOfMonth": number,
   "ownerSub": "string",
   "updatedAt": "string",
   "draftedFor": "string",
   "lastRun": { "at": "string", "period": "string", "drafts": [ { "poId": "string", "draftId": "string" } ] }
}

Set AI renewal rule

Switches the AI order renewal rule on or off.

PUT/v1/workspaces/{regionId}/ai-spend/renewal-rule

Body

  • enabledbooleanRequired

    Whether next month's AI orders are drafted.

  • dayOfMonthnumber

    1 to 28: the day from which the drafts are raised. 25 when left out.

Returns

200 OK with the object shown in the response.

More details

On or after dayOfMonth, once a month, Pleaxy drafts next month's order for each open order with AI lines valid this month, as RaiseNextAiPeriod does, in the name of whoever switched the rule on. The rule runs when the workspace's AI spend is next read (the dashboard and the Spend page read it). Drafts never issue without the usual approval.

Signed-in session with 'create' access to purchase orders; an API key gets 403.

Errors

  • 400 Bad Request - dayOfMonth isn't a whole number from 1 to 28.
  • 403 Forbidden - The caller is an API key or lacks 'create' on purchase orders.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
PUT /v1/workspaces/{regionId}/ai-spend/renewal-rule
Request
curl -X PUT "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/renewal-rule" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "enabled": true,
   "dayOfMonth": 25
}
Response · 200 OK
The rule, as GetAiRenewalRule returns it

Get AI attribution

The rules that attribute AI spend to cost centers.

GET/v1/workspaces/{regionId}/ai-spend/attribution

Parameters

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

Returns

200 OK with the object shown in the response.

More details

Your attribution rules in order - the first that matches a line wins - with what each matched in the period, what no rule matched, and the dimension values behind the unmatched spend (largest first), to write the next rule from. A rule maps one provider dimension to a cost center: tag (AWS cost allocation tag) or label (Google Cloud), with its key; project (OpenAI, Google Cloud), workspace (Anthropic), resource_group (Azure), compartment (OCI), cluster (GPU clouds), api_key or inference_profile. A line no rule matches is unattributed: shown, never hidden. Needs 'view' access to suppliers or to invoices.

Response fields

  • versionnumber

    Send it back with SetAiAttribution, so a save can't overwrite someone else's.

  • rules[].invoicerIdstring

    Only that invoicer's lines; every invoicer when absent.

  • rules[].matchedArray<object>

    What the rule matched in the period, one entry per currency.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/attribution
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/attribution" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "period": "string",
   "version": number,
   "updatedAt": "string",
   "rules": [
      { "id": "string", "invoicerId": "string", "dimension": "string", "key": "string", "value": "string", "costCenter": "string", "matched": [ { "currency": "string", "amount": number } ] }
   ],
   "unattributed": [ { "currency": "string", "amount": number } ],
   "unmatchedValues": [ { "invoicerId": "string", "key": "string", "value": "string", "currency": "string", "amount": number } ]
}

Set AI attribution

Replaces the attribution rules.

PUT/v1/workspaces/{regionId}/ai-spend/attribution

Body

  • rulesArray<{ id?, invoicerId?, dimension, key?, value, costCenter }>Required

    Every rule, first match first. At most 200. Keep a rule's id to keep it; a new rule gets one.

  • versionnumberRequired

    The version GetAiAttribution returned; 0 for the first save.

Returns

200 OK with the object shown in the response.

More details

Replaces every rule, in order, from the version you read. A tag or label rule needs its key; the cost center must be one of the workspace's. A rule on an AWS tag or a Google Cloud label makes the next sync read that account's AI lines by it as well (one AWS tag key per account). Returns the rules as GetAiAttribution does. Needs 'edit' access to purchase orders.

Errors

  • 400 Bad Request - A tag or label rule has no key, or a cost center isn't one of the workspace's.
  • 409 Conflict - Someone saved the rules since you read them; read them again.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
PUT /v1/workspaces/{regionId}/ai-spend/attribution
Request
curl -X PUT "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/attribution" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "rules": [ { "dimension": "tag", "key": "team", "value": "search", "costCenter": "CC-410" } ],
   "version": 3
}
Response · 200 OK
The rules, as GetAiAttribution returns them

List AI cost centers

Cost centers' budgets with their AI spend accruing.

GET/v1/workspaces/{regionId}/ai-spend/cost-centers

Parameters

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

Returns

200 OK with the object shown in the response.

More details

Each cost center's budget, committed (approved orders) and actual (approved invoices) from budget control, with this month's attributed AI usage as accruing - a third figure, not yet invoiced - and its forecast, in the budget's currency; the percent of the budget with the forecast; and the alert sent. When the forecast with what's committed and invoiced reaches 80% or 100% of a budget, Pleaxy sends an ai_forecast_over_budget notification once per threshold per month, through the workspace's channels. Nothing blocks. Needs 'view' access to purchase orders.

Response fields

  • budgetModestring

    Budget control's mode. off: no budgets are kept, the rows carry the AI figures only and no alert is sent.

  • rows[].pctWithForecastnumber

    (committed + actual + forecast) / budget, in percent. Absent without a budget.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/cost-centers
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/cost-centers" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "period": "string",
   "budgetMode": "string",
   "thresholds": [ number ],
   "rows": [
      { "costCenter": "string", "costCenterName": "string", "currency": "string", "budget": number, "committed": number, "actual": number, "accruing": number, "forecast": number, "pctWithForecast": number, "alert": { "threshold": number, "sentAt": "string" } }
   ],
   "unattributed": [ { "currency": "string", "monthToDate": number, "forecast": number } ]
}

List AI spend limits

The spending ceilings set at providers, and their credentials.

GET/v1/workspaces/{regionId}/ai-spend/limits

Returns

200 OK with the object shown in the response.

More details

Opt-in: the spending ceilings Pleaxy set at providers from your approved order lines, and which invoicers have a limits credential (never the key). A ceiling is your own limit at the provider - an AWS budget, an OpenAI project limit, an Anthropic workspace limit, a Google Cloud budget or spend cap, an Azure budget - set with a credential you create separately from the read-only connection, and remove when you like. Needs 'view' access to purchase orders.

Response fields

  • limits[].enforcementstring

    deny: the provider stops spend at the ceiling (an OpenAI or Anthropic limit, a Google Cloud spend cap, an AWS budget action that attaches your deny policy - AWS refreshes budgets a few times a day, so hours late). alert: it only notifies (Azure, a Google Cloud or AWS budget without one).

  • limits[].readBackobject

    What reading the ceiling back from the provider gave, and when.

  • limits[].historyArray<object>

    Every write Pleaxy made for the line at the provider, the last 20.

Errors

  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/limits
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/limits" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "credentials": [ { "invoicerId": "string", "invoicer": "aws" | "openai" | "anthropic" | "gcp" | "azure", "keyHint": "string", "notifyEmail": "string", "createdAt": "string" } ],
   "limits": [
      {
         "poId": "string", "lineNo": number, "invoicerId": "string", "invoicer": "string", "target": "string",
         "amount": number, "currency": "string", "period": "string", "providerRef": "string",
         "enforcement": "deny" | "alert", "state": "set" | "failed" | "removed",
         "readBack": { "amount": number, "at": "string" },
         "history": [ { "at": "string", "by": "string", "action": "set" | "raise" | "remove" | "failed", "amount": number, "readBack": number, "error": "string" } ]
      }
   ]
}

Set AI spend limit

Sets an approved order line's amount as the provider's ceiling.

PUT/v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}

Parameters

  • poIdstringRequired

    The approved order.

  • lineNonumberRequired

    The order line whose amount is the ceiling.

Body

  • invoicerIdstringRequired

    The account or AI provider the order covers, with a limits credential.

  • targetstring

    OpenAI: the project (proj_...). Anthropic: the workspace (wrkspc_...). Google Cloud: the project, for a spend cap.

  • denyboolean

    Stop spend at the ceiling where the provider can. true when left out; false only alerts.

Returns

200 OK with the object shown in the response.

More details

Writes the line's amount as its invoicer's spending ceiling for the month (the line's first month when it starts later), reads it back and records the write. Only for an approved, open order raised to that invoicer, with a limits credential for it. Refused below the month to date, with the figures. Raising the line (a new version) raises the ceiling; closing the order removes it. Pleaxy never changes or deletes anything at the provider it didn't create. Needs 'edit' access to purchase orders.

Signed in through an agent, this is an agent request the person confirms in Pleaxy; an API key with 'edit' on purchase orders acts at once.

Errors

  • 400 Bad Request - The order isn't approved and open, or isn't raised to that invoicer; no limits credential for it; the ceiling would be below the month to date; or the provider refused it (the reason says why: the credential, a missing project or workspace, a currency it doesn't take).
  • 404 Not Found - No such order, line or invoicer, or limits aren't switched on in this region.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
PUT /v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}
Request
curl -X PUT "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "invoicerId": "aip_01k8q2m4xv7c9n3p5t6r8w0yzb",
   "target": "proj_abc"
}
Response · 200 OK
The limit, as an entry of ListAiSpendLimits' limits

Remove AI spend limit

Removes the ceiling Pleaxy set for an order line.

DELETE/v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}

Parameters

  • poIdstringRequired

    The order.

  • lineNonumberRequired

    The order line.

Returns

200 OK with the object shown in the response.

More details

Deletes the ceiling Pleaxy set for the line at the provider (only one Pleaxy named) and records it. Needs 'edit' access to purchase orders.

Errors

  • 404 Not Found - No ceiling for that line.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
DELETE /v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}
Request
curl -X DELETE "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/limits/{poId}/{lineNo}" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
The limit, as an entry of ListAiSpendLimits' limits, with state removed

Set AI limit credential

Adds the separate credential an invoicer's ceilings are set with.

PUT/v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}

Parameters

  • invoicerIdstringRequired

    The cloud connection or AI provider id.

Body

  • roleArnstring

    AWS: the PleaxyAiLimits role ARN.

  • executionRoleArnstring

    AWS, to stop spend: the template's execution role ARN.

  • denyPolicyArnstring

    AWS, to stop spend: the template's deny policy ARN.

  • roleNamesArray<string>

    AWS, to stop spend: the role names the deny policy is attached to.

  • serviceAccountEmailstring

    Google Cloud: the limits service account.

  • clientIdstring

    Azure: the limits app's client id.

  • keystring

    OpenAI or Anthropic: a separate admin key for the limits.

  • notifyEmailstring

    Who the provider emails at a ceiling: needed for Azure, and for an AWS ceiling that stops spend.

Returns

200 OK with the object shown in the response.

More details

The write credential for one invoicer's ceilings, separate from its read-only connection, which is never widened: an AWS limits role (from Pleaxy's aws-ai-limits CloudFormation template: AWS Budgets only, and optionally a deny policy on Amazon Bedrock calls the budget attaches at 100%), a Google Cloud limits service account in the connection's identity pool, an Azure limits app with the connection's federated credential, or a separate OpenAI or Anthropic admin key (stored encrypted, never returned). Checked with one read before it is saved. Remove it to end the feature for that invoicer.

Signed-in session with 'edit' access to suppliers; an API key gets 403.

Errors

  • 400 Bad Request - A field the provider needs is missing; it's the read-only connection's own credential; or the provider refused it, and nothing was saved.
  • 403 Forbidden - The caller is an API key or lacks 'edit' on suppliers.
  • 404 Not Found - No such invoicer, or limits aren't switched on in this region.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
PUT /v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}
Request
curl -X PUT "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "roleArn": "arn:aws:iam::123456789012:role/PleaxyAiLimits"
}
Response · 200 OK
The credential, as an entry of ListAiSpendLimits' credentials

Remove AI limit credential

Removes an invoicer's limits credential.

DELETE/v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}

Parameters

  • invoicerIdstringRequired

    The cloud connection or AI provider id.

Returns

200 OK with the object shown in the response.

More details

Pleaxy sets no more ceilings at that invoicer; the read-only connection stays as it was. Delete the role, service account, app or key at the provider too.

Signed-in session with 'edit' access to suppliers; an API key gets 403.

Errors

  • 403 Forbidden - The caller is an API key or lacks 'edit' on suppliers.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
DELETE /v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}
Request
curl -X DELETE "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/limit-credentials/{invoicerId}" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "invoicerId": "string"
}

List AI seat counts

Seat-based AI products' active users for a month.

GET/v1/workspaces/{regionId}/ai-spend/seats

Parameters

  • periodstring

    The month, YYYY-MM. Defaults to the current month.

Returns

200 OK with the object shown in the response.

More details

Seat-based AI (ChatGPT Enterprise, Claude Enterprise, Microsoft 365 Copilot, GitHub Copilot, Cursor) is invoiced per seat. These are the active users recorded for each product in a month, and where each count came from. An invoice line with meter seats that bills more seats than the month's count is an ai_seats_above_active finding; a contract term that commits seats shows on the Commitments tab against the latest count. Needs 'view' access to suppliers or to invoices.

Errors

  • 400 Bad Request - period isn't a month as YYYY-MM.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/ai-spend/seats
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/seats" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
[
   { "invoicer": "string", "product": "string", "period": "string", "activeUsers": number, "source": "okta" | "entra" | "google_workspace" | "jumpcloud" | "provider_console" | "manual", "recordedAt": "string", "recordedBy": "string" }
]

Set AI seat count

Records a seat product's active users for a month.

PUT/v1/workspaces/{regionId}/ai-spend/seats

Body

  • invoicerstringRequired

    Who bills the seats: openai, anthropic, microsoft, github, cursor, ...

  • productstringRequired

    The seat product as the order line names it (its ai.model), e.g. chatgpt-enterprise.

  • periodstringRequired

    The month, YYYY-MM.

  • activeUsersnumberRequired

    Users holding a seat who signed in that month.

  • sourcestringRequired

    okta, entra, google_workspace, jumpcloud, provider_console or manual.

Returns

200 OK with the object shown in the response.

More details

Records how many users of a seat product were active in a month, as your identity provider (Okta, Microsoft Entra, Google Workspace, JumpCloud) or the provider's admin console reports them, replacing that month's count. Pleaxy doesn't read your identity provider itself: send the count from a script, an agent or by hand. Needs 'edit' access to invoices.

Errors

  • 400 Bad Request - A field is missing or out of range.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
PUT /v1/workspaces/{regionId}/ai-spend/seats
Request
curl -X PUT "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/ai-spend/seats" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "invoicer": "openai",
   "product": "chatgpt-enterprise",
   "period": "2026-10",
   "activeUsers": 182,
   "source": "okta"
}
Response · 200 OK
The count, as an entry of ListAiSeatCounts
Talk to us