ReportAiUsageOpenResult report.ai-usage-open-result@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
report
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/report/ai-usage-open-result.v1.json

report.ai-usage-open-result@1: the open AI meter (plan L40/L41). What the whole network spends on AI, in public: the tokens, the share of them that came from a provider cache, the share that the own keys of people paid, and the spend by week. No person, no site and no key is in it: the rows are summed before they are answered.

Fields

FieldTypeRequiredDescriptionConstraints
callsintegeryesThe AI calls behind these numbers.
  • minimum 0
tokensobjectyes
  • no other fields
tokens.inputintegeryesThe uncached input tokens.
  • minimum 0
tokens.outputintegeryes
  • minimum 0
tokens.cache_readintegeryes
  • minimum 0
tokens.cache_writeintegeryes
  • minimum 0
cache_sharenumberyesThe share of the prompt tokens that came from a provider cache.
  • minimum 0
  • maximum 1
cache_saved_usdnumberyes
  • minimum 0
own_key_sharenumberyesThe share of the tokens that the own keys of people paid.
  • minimum 0
  • maximum 1
own_key_callsintegeryes
  • minimum 0
list_cost_usdnumberyes
  • minimum 0
charged_usdnumberyes
  • minimum 0
fee_usdnumberyes
  • minimum 0
spend_by_weekarray of objectyes
  • items: no other fields
spend_by_week[].weekstringyesThe Monday of the week.
  • pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
spend_by_week[].callsintegeryes
  • minimum 0
spend_by_week[].list_cost_usdnumberyes
  • minimum 0
spend_by_week[].charged_usdnumberyes
  • minimum 0
spend_by_week[].cache_saved_usdnumberyes
  • minimum 0

Examples

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

Valid: open
{
  "calls": 120,
  "tokens": {
    "input": 1000,
    "output": 200,
    "cache_read": 800,
    "cache_write": 150
  },
  "cache_share": 0.41,
  "cache_saved_usd": 0.12,
  "own_key_share": 0.25,
  "own_key_calls": 30,
  "list_cost_usd": 1.23,
  "charged_usd": 0.9,
  "fee_usd": 0.02,
  "spend_by_week": [
    {
      "week": "2026-10-27",
      "calls": 30,
      "list_cost_usd": 0.4,
      "charged_usd": 0.3,
      "cache_saved_usd": 0.05
    }
  ]
}
Rejected: names-a-person
{
  "calls": 120,
  "tokens": {
    "input": 1000,
    "output": 200,
    "cache_read": 800,
    "cache_write": 150
  },
  "cache_share": 0.41,
  "cache_saved_usd": 0.12,
  "own_key_share": 0.25,
  "own_key_calls": 30,
  "list_cost_usd": 1.23,
  "charged_usd": 0.9,
  "fee_usd": 0.02,
  "spend_by_week": [],
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('report.ai-usage-open-result@1', value);   // { valid, errors: [{ path, message }] }