CostSnapshot platform.cost-snapshot@1
Generated at from
openvibe-contracts v0.79.0 and
openvibe-sdk v0.25.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-034
- Schema
https://openvibe.network/contracts/platform/cost-snapshot.v1.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 |
| |
window_end | string | yes |
| |
project_id | string |
| ||
scope | string | yes | events, jobs, ai, media, … | |
by_target | array of object | yes |
| |
by_target[].id | string | yes | ||
by_target[].units | number | yes |
| |
by_target[].cost_usd | number | yes |
| |
by_target[].p50_ms | number |
| ||
by_target[].p95_ms | number |
| ||
actual_usd | number | yes |
| |
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 }] }