Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview

Per-second usage from running intervals

Defaults to the current calendar month (UTC) up to now.

GET/v1/usage
Authorization
AuthorizationBearer token · headerrequired

Org-scoped API key, pols_....

Query parameters
fromstring<date-time>

Start of the window (inclusive, RFC 3339).

tostring<date-time>

End of the window (exclusive, RFC 3339).

Responses
200

The usage report.

fromstring<date-time>required
tostring<date-time>required
total_secondsinteger<int64>required

Running sandbox-seconds in the window.

total_vcpu_secondsinteger<int64>required
estimated_cost_eurstringrequired

At list rates; billing is a manual invoice in the MVP.

by_sizeSizeUsage[]required
Show properties
Array of SizeUsage
sizeSizerequired

Sandbox size. small: 2 vCPU, 4 GiB RAM, 20 GiB disk. default: 4 vCPU, 8 GiB, 50 GiB. large: 8 vCPU, 16 GiB, 100 GiB. xlarge: 16 vCPU, 32 GiB, 200 GiB.

Allowed:smalldefaultlargexlarge
secondsinteger<int64>required
estimated_cost_eurstringrequired

Decimal string with 4 places.

sandboxesSandboxUsage[]required
Show properties
Array of SandboxUsage
sandbox_idstringrequired
namestring | null
sizeSizerequired

Sandbox size. small: 2 vCPU, 4 GiB RAM, 20 GiB disk. default: 4 vCPU, 8 GiB, 50 GiB. large: 8 vCPU, 16 GiB, 100 GiB. xlarge: 16 vCPU, 32 GiB, 200 GiB.

Allowed:smalldefaultlargexlarge
secondsinteger<int64>required
estimated_cost_eurstringrequired
429

Rate limited (rate_limited): too many requests or failed authentications from this address, too many requests or lifecycle calls for this org, or too many of its exec, file, computer and CDP calls in progress at once. Retry after Retry-After seconds.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
default

Error.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
Request
curl -X GET 'https://api.pols.so/v1/usage' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "from": "2019-08-24T14:15:22Z",
  "to": "2019-08-24T14:15:22Z",
  "total_seconds": 0,
  "total_vcpu_seconds": 0,
  "estimated_cost_eur": "string",
  "by_size": [
    {
      "size": "small",
      "seconds": 0,
      "estimated_cost_eur": "string"
    }
  ],
  "sandboxes": [
    {
      "sandbox_id": "string",
      "name": "string",
      "size": "small",
      "seconds": 0,
      "estimated_cost_eur": "string"
    }
  ]
}