AiCredentialPut ai.credential-put@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/credential-put.v1.json

ai.credential-put@1 (OpenVibe.AI; roadmap WS-O task 2): a person's own provider key, stored by the service that holds their consent (Live, for a streamer's AI viewers), PUT /api/v1/credentials/{subject} with capability ai.credential.manage. OpenVibe.AI encrypts the key at rest and never returns it; runs that name the credential call that provider with it, never a shared key, and are limited by `budget_usd_per_day`. `base_url` is any https endpoint (OpenAI-compatible or Anthropic); OpenVibe.AI connects only to public addresses.

Fields

FieldTypeRequiredDescriptionConstraints
providerenumyesopenai = any OpenAI-compatible endpoint.
  • one of "openai", "anthropic"
base_urlstring
  • pattern ^https://[^\s/?#@]+(/[^\s?#]*)?$
  • maxLength 300
api_keystringRequired the first time, and whenever provider or base_url changes (a key is never sent to a new endpoint without being entered again); otherwise the stored key is kept.
  • minLength 8
  • maxLength 400
modelsobjectModel per Live role; `chat` is the default for the others.
  • no other fields
models.chatstring
  • minLength 1
  • maxLength 120
models.visionstring
  • minLength 1
  • maxLength 120
models.directorstring
  • minLength 1
  • maxLength 120
models.summarystring
  • minLength 1
  • maxLength 120
models.legacystring
  • minLength 1
  • maxLength 120
budget_usd_per_daynumberThe person's own daily cap on estimated spend with this key; 0 or absent = no cap.
  • minimum 0
  • maximum 1000

Examples

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

Valid: models-only
{
  "provider": "openai",
  "base_url": "https://openrouter.ai/api/v1",
  "models": {
    "chat": "gpt-4o-mini"
  }
}
Valid: openrouter
{
  "provider": "openai",
  "base_url": "https://openrouter.ai/api/v1",
  "api_key": "sk-or-v1-EXAMPLEEXAMPLEEXAMPLE",
  "models": {
    "chat": "gpt-4o-mini"
  },
  "budget_usd_per_day": 2
}
Rejected: http-base
{
  "provider": "openai",
  "base_url": "http://10.0.0.1/v1",
  "api_key": "sk-EXAMPLEEXAMPLE"
}

Validate

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