AiProviderManageRequest ai.provider-manage-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- ai
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/ai/provider-manage-request.v1.json
ai.provider-manage-request@1: bodies of ai.provider.manage on OpenVibe.AI. POST /api/v1/providers creates or replaces a provider (key required) and PATCH /api/v1/providers/:key changes one (fields left out keep their value); a body carrying api_key or secret is refused (422: send secret_ref env:NAME, never a secret value). POST /api/v1/models (provider_key and model_key required) and PATCH /api/v1/models/:provider/:model upsert a model. POST /api/v1/quotas upserts a quota (scope_type and window required; scope_id too unless global; the same scope, window and workflow_prefix is one quota). POST /api/v1/providers/:key/disable|enable|reset and DELETE /api/v1/cache[?workflow=] take no body. Unknown fields are ignored.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: disable
{}Valid: provider
{
"key": "openai",
"kind": "openai",
"auth_mode": "bearer",
"secret_ref": "env:OPENAI_API_KEY",
"capabilities": [
"chat",
"embed"
],
"priority": 20
}Valid: quota
{
"scope_type": "service",
"scope_id": "live",
"window": "day",
"max_cost_usd": 25
}Rejected: secret-value
{
"key": "openai",
"kind": "openai",
"api_key": "sk-live-123",
"status": "paused"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.provider-manage-request@1', value); // { valid, errors: [{ path, message }] }