---
title: "ai.credential@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/ai.credential@1"
updated: null
---

# ai.credential@1 · OpenVibe.Services

HTML: [ai.credential@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/ai.credential@1)

# AiCredential `ai.credential@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

An older major, still in the catalog. The current one is [`ai.credential@2`](/docs/contracts/ai.credential).

- Version: 1.0.0
- Owner: ai
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/ai/credential.v1.json`](/docs/contracts/ai.credential@1.json)

ai.credential@1 (OpenVibe.AI; roadmap WS-O task 2): a stored credential as its owner service reads it (GET or PUT /api/v1/credentials/{subject}): never the key, only its last four characters.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `subject` | string | yes |  | - `pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$` |
| `owner` | string | yes | The service that stored it; only it may use or change it. | - `pattern ^[a-z][a-z0-9-]{1,31}$` |
| `provider` | enum | yes |  | - `one of "openai", "anthropic", "link"` |
| `machine` | string \| null |  | provider link: the machine it runs on, or \`any\` of the person's own (contracts 0.221.0) | - `pattern ^(dev_[0-9A-HJKMNP-TV-Z]{26}\|any)$` |
| `base_url` | string \| null |  |  | - `maxLength 300` |
| `key_hint` | string |  |  | - `pattern ^…[\s\S]{1,4}$` |
| `models` | object |  | Model per Live role; \`chat\` is the default for the others. | - `no other fields` |
| `models.chat` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.vision` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.director` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.summary` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.legacy` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `budget_usd_per_day` | number \| null |  |  | - `minimum 0` |
| `spent_usd_today` | number |  |  | - `minimum 0` |
| `created_at` | string | yes |  | - `format date-time` |
| `updated_at` | string | yes |  | - `format date-time` |
| `last_used_at` | string \| null |  |  | - `format date-time` |

## Examples

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

The fixtures that ship with the package are the current major's.

## Validate

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