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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
provider | enum | yes | openai = any OpenAI-compatible endpoint. |
|
base_url | string |
| ||
api_key | string | Required 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. |
| |
models | object | Model per Live role; `chat` is the default for the others. |
| |
models.chat | string |
| ||
models.vision | string |
| ||
models.director | string |
| ||
models.summary | string |
| ||
models.legacy | string |
| ||
budget_usd_per_day | number | The person's own daily cap on estimated spend with this key; 0 or absent = no cap. |
|
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 }] }