AiMeCredentialPutV1 ai.me-credential-put@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-put.v1.json

ai.me-credential-put@1 (OpenVibe.AI; L36 Y1): the person stores or replaces their own provider key at PUT /api/v1/me/credentials/{provider}. Only the person's own Network token or their AI site session may send it. `key` is required the first time and whenever `base_url` changes; a later save may leave it out to keep the stored key. The key is sealed at rest, tested on save and never returned, logged or put in an error.

Fields

FieldTypeRequiredDescriptionConstraints
providerenumyesThe provider. The route names it too; when both are present they must agree. A custom provider must name its endpoint in base_url.
  • one of "anthropic", "openai", "gemini", "deepseek", "mistral", "xai", "groq", "cerebras", "together", "fireworks", "openrouter", "minimax", "custom"
keystringThe provider key. Required the first time and whenever base_url changes; optional afterwards, when the stored key is kept. Never returned.
  • minLength 8
  • maxLength 400
base_urlstringThe endpoint, for a custom provider or to override the provider's own. https only, no credentials, query or fragment; reached through the guarded fetcher's egress rules.
  • pattern ^https://[^\s/?#@]+(/[^\s?#]*)?$
  • maxLength 300
budget_usd_per_daynumberThe person's own daily cap on this key; 0 or absent means no cap.
  • minimum 0
  • maximum 1000
modelsobjectThe model this key should use per kind of work. `auto` is not a model: absent means the provider's default, and the person's ai.me-preferences choose between keys.
  • no other fields
models.chatstring
  • minLength 1
  • maxLength 120
models.codestring
  • minLength 1
  • maxLength 120
models.visionstring
  • minLength 1
  • maxLength 120
models.imagestring
  • minLength 1
  • maxLength 120

Examples

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

Valid: anthropic
{
  "provider": "anthropic",
  "key": "sk-ant-test-0123456789",
  "budget_usd_per_day": 2,
  "models": {
    "chat": "claude-haiku-5-5",
    "vision": "claude-sonnet-5-5"
  }
}
Valid: custom
{
  "provider": "custom",
  "key": "sk-test-custom-0123456789",
  "base_url": "https://llm.example.com/v1"
}
Rejected: custom-without-base
{
  "provider": "custom",
  "key": "sk-test-custom-0123456789"
}
Rejected: http-base
{
  "provider": "custom",
  "key": "sk-test-custom-0123456789",
  "base_url": "http://llm.example.com/v1"
}

Validate

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