ExchangeGeneration exchange.generation@1

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

Version
1.0.0
Owner
exchange
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-025
Schema
https://openvibe.network/contracts/exchange/generation.v1.json

Owner-scoped request accounting. Cost is USD and latency is milliseconds; prompts and outputs are excluded.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • minLength 1
  • maxLength 256
modelstring | nullyes
providerstring | nullyes
costnumberyes
  • minimum 0
total_costnumberyes
  • minimum 0
latencynumberyes
  • minimum 0
tokens_promptintegeryes
  • minimum 0
tokens_completionintegeryes
  • minimum 0
created_atstringyes
  • format date-time

Examples

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

Valid: example
{
  "id": "run_fixture",
  "model": "maker/model",
  "provider": "maker",
  "cost": 0.001,
  "total_cost": 0.001,
  "latency": 10,
  "tokens_prompt": 12,
  "tokens_completion": 3,
  "created_at": "2026-11-09T00:00:00Z"
}
Rejected: example
{
  "id": "run_fixture"
}

Validate

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