Remotehost Docs
API ReferenceOrg workspaces

Read a workspace's usage at vendor cost, itemized

GET
/orgs/{orgId}/workspaces/{workspaceId}/usage/vendor-cost

Needs billing.read at the workspace. The usage of the projects in the workspace now, for the billing period, line by line at each vendor's own rate, with the usage fee and the platform fee, which are displayed for transparency: nothing bills them yet. A caller who cannot see the workspace (a member holding no project in it) gets the same 404 as a workspace that does not exist. An API key pinned to a workspace reads that workspace only, with billing.read in its own scopes; any other workspace, in this org or another, gets the same 404. No other API key may call it. Off until the workspace API is enabled for this deployment: until then it answers 404 to everyone.

Authorization

bearerAuth
AuthorizationBearer <token>

A RemoteHost API key (rh_sk_...) or a user session token.

In: header

Path Parameters

orgId*string
workspaceId*string

Query Parameters

period?string

current (the default), the org's billing period now; previous, the one before it.

Value in

  • "current"
  • "previous"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/orgs/string/workspaces/string/usage/vendor-cost"
{  "workspace": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "kind": "internal"  },  "period": "current",  "periodStartsAt": "string",  "periodEndsAt": "string",  "rateCatalogVersion": "string",  "lines": [    {      "resource": "compute",      "vendor": "string",      "region": "string",      "quantity": "string",      "unit": "machine-hour",      "rateUsd": "string",      "rateUnit": "machine-hour",      "costUsd": "string",      "unavailableReason": "region_not_priced"    }  ],  "totalCostUsd": "string",  "usageFee": {    "scheduleVersion": "string",    "percent": "string",    "marginPercentMax": "string",    "components": [      {        "id": "string",        "label": "string",        "percent": "string",        "kind": "pass_through"      }    ],    "amountUsd": "string"  },  "platformFeeUsd": "string",  "unavailable": [    {      "field": "usageFee",      "reason": "not_in_force",      "message": "string"    }  ]}