---
title: "platform.cost-snapshot@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/platform.cost-snapshot"
updated: null
---

# platform.cost-snapshot@1 · OpenVibe.Services

HTML: [platform.cost-snapshot@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/platform.cost-snapshot)

# CostSnapshot `platform.cost-snapshot@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: network
- Visibility: first-party
- Status: active
- Compatibility: backward
- Decision: [ADR-034](/docs/adr/ADR-034)
- Schema: [`https://openvibe.network/contracts/platform/cost-snapshot.v1.json`](/docs/contracts/platform.cost-snapshot.json)

Cost and volume for a window, by carrier or provider, with the counterfactuals: what the same work would have cost all-local, all-provider and with the optimiser (roadmap WS-Z9 task 6).

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `window_start` | string | yes |  | - `format date-time` |
| `window_end` | string | yes |  | - `format date-time` |
| `project_id` | string |  |  | - `pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$` |
| `scope` | string | yes | events, jobs, ai, media, … |  |
| `by_target` | array of object | yes |  | - `items: no other fields` |
| `by_target[].id` | string | yes |  |  |
| `by_target[].units` | number | yes |  | - `minimum 0` |
| `by_target[].cost_usd` | number | yes |  | - `minimum 0` |
| `by_target[].p50_ms` | number |  |  | - `minimum 0` |
| `by_target[].p95_ms` | number |  |  | - `minimum 0` |
| `actual_usd` | number | yes |  | - `minimum 0` |
| `counterfactual_usd` | object |  | e.g. all\_local, all\_provider, lowest\_latency |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: events-day

~~~~
{
  "window_start": "2026-09-28T00:00:00Z",
  "window_end": "2026-09-29T00:00:00Z",
  "scope": "events",
  "by_target": [
    {
      "id": "pg-delivery",
      "units": 18294,
      "cost_usd": 0,
      "p50_ms": 11,
      "p95_ms": 37
    }
  ],
  "actual_usd": 0,
  "counterfactual_usd": {
    "all_provider": 0.02
  }
}
~~~~

Rejected: no-targets

~~~~
{
  "window_start": "2026-09-28T23:00:00Z",
  "window_end": "2026-09-28T23:00:00Z",
  "scope": "events",
  "actual_usd": 0
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('platform.cost-snapshot@1', value);   // { valid, errors: [{ path, message }] }
~~~~
