AiAttributionQuota ai.attribution-quota@1
Generated at from
openvibe-contracts v0.76.0 and
openvibe-sdk v0.20.1.
- Version
- 1.0.0
- Owner
- ai
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/ai/attribution-quota.v1.json
ai.attribution-quota@1 (OpenVibe.AI; roadmap WS-O task 2): a cap on one attribution as its service reads it (GET or PUT /api/v1/attribution-quotas/{attribution}), with what the current window has used.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
attribution | string | yes | <service>:<type>:<id>, the run's attribution as AI keys it (Live: live:user:<id>). |
|
window | enum | yes |
| |
workflow_prefix | string | null | |||
max_cost_usd | number | null |
| ||
max_requests | integer | null |
| ||
used | object | yes |
| |
used.requests | integer | yes |
| |
used.cost_usd | number | yes |
| |
window_resets_at | string | yes |
| |
updated_at | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: viewers
{
"attribution": "live:user:42",
"window": "day",
"workflow_prefix": "live.viewers.",
"max_cost_usd": 0.2,
"max_requests": null,
"used": {
"requests": 12,
"cost_usd": 0.034
},
"window_resets_at": "2026-09-29T00:00:00.000Z",
"updated_at": "2026-09-28T00:30:00.000Z"
}Rejected: bad-attribution
{
"attribution": "42",
"window": "day",
"used": {
"requests": 0,
"cost_usd": 0
},
"window_resets_at": "2026-09-29T00:00:00.000Z",
"updated_at": "2026-09-28T00:30:00.000Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.attribution-quota@1', value); // { valid, errors: [{ path, message }] }