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

# ai.me-credential-test@1 · OpenVibe.Services

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

# AiMeCredentialTestV1 `ai.me-credential-test@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).

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

ai.me-credential-test@1 (OpenVibe.AI; L36 Y1/Y8): the answer to POST /api/v1/me/credentials/{provider}/test and to the test that runs on save. It lists the provider's models (up to five samples), or, when it lists none, makes a one-token request to its cheapest model. \`ok\` is false for a refused key, an empty endpoint or a timeout (10 s). \`error\` is a redacted line that never carries the key. \`balance\` is present only when the provider reports one.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `ok` | boolean | yes |  |  |
| `models_count` | integer | yes |  | - `minimum 0` |
| `sample_models` | array of string | yes |  | - `maxItems 5`<br>- `items: minLength 1`<br>- `items: maxLength 120` |
| `latency_ms` | integer | yes |  | - `minimum 0` |
| `balance` | one of | yes |  |  |
| `error` | one of | yes |  |  |

## Examples

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

 Valid: ok

~~~~
{
  "ok": true,
  "models_count": 3,
  "sample_models": [
    "gpt-4o-mini",
    "gpt-4o",
    "o4-mini"
  ],
  "latency_ms": 184,
  "balance": null,
  "error": null
}
~~~~

Valid: refused

~~~~
{
  "ok": false,
  "models_count": 0,
  "sample_models": [],
  "latency_ms": 42,
  "balance": {
    "amount": 1.25,
    "currency": "USD"
  },
  "error": {
    "code": "provider.auth",
    "message": "the provider refused the key (401)"
  }
}
~~~~

Rejected: negative-latency

~~~~
{
  "ok": true,
  "models_count": 1,
  "sample_models": [
    "m"
  ],
  "latency_ms": -1,
  "balance": null,
  "error": null
}
~~~~

## Validate

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