AiMeCredentialTestV1 ai.me-credential-test@1

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

Version
1.0.0
Owner
ai
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/ai/me-credential-test.v1.json

ai.me-credential-test@1 (OpenVibe.AI; L36 Y1/Y8): the answer to POST /api/v1/me/credentials/{provider}/test and to the test that runs on save. It lists the provider's models (up to five samples), or, when it lists none, makes a one-token request to its cheapest model. `ok` is false for a refused key, an empty endpoint or a timeout (10 s). `error` is a redacted line that never carries the key. `balance` is present only when the provider reports one.

Fields

FieldTypeRequiredDescriptionConstraints
okbooleanyes
models_countintegeryes
  • minimum 0
sample_modelsarray of stringyes
  • maxItems 5
  • items: minLength 1
  • items: maxLength 120
latency_msintegeryes
  • minimum 0
balanceone ofyes
errorone ofyes

Examples

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

Valid: ok
{
  "ok": true,
  "models_count": 3,
  "sample_models": [
    "gpt-4o-mini",
    "gpt-4o",
    "o4-mini"
  ],
  "latency_ms": 184,
  "balance": null,
  "error": null
}
Valid: refused
{
  "ok": false,
  "models_count": 0,
  "sample_models": [],
  "latency_ms": 42,
  "balance": {
    "amount": 1.25,
    "currency": "USD"
  },
  "error": {
    "code": "provider.auth",
    "message": "the provider refused the key (401)"
  }
}
Rejected: negative-latency
{
  "ok": true,
  "models_count": 1,
  "sample_models": [
    "m"
  ],
  "latency_ms": -1,
  "balance": null,
  "error": null
}

Validate

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