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

# ai.credential.failed@1 · OpenVibe.Services

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

# AiCredentialFailedPayload `ai.credential.failed@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/events/payloads/ai.credential.failed.v1.json`](/docs/contracts/ai.credential.failed.json)

ai.credential.failed v1 (OpenVibe.AI; L36 Y8): a provider refused one of a person's own keys with 401 or 403 during a run. The key's status becomes failing and this event tells the products that may show it. \`error\` is a redacted line that never carries the key. Envelope: on\_behalf\_of the person, subject { type: credential, id: <subject>:<provider> }, visibility internal, priority important, actor service:ai.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `subject` | string | yes |  | - `pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$` |
| `provider` | enum | yes |  | - `one of "anthropic", "openai", "gemini", "deepseek", "mistral", "xai", "groq", "cerebras", "together", "fireworks", "openrouter", "minimax", "custom"` |
| `status` | const | yes |  | - `= "failing"` |
| `checked_at` | string | yes |  | - `format date-time` |
| `error` | string | yes | The redacted reason. Never the key. | - `minLength 1`<br>- `maxLength 500` |

## Examples

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

 Valid: refused

~~~~
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "provider": "anthropic",
  "status": "failing",
  "checked_at": "2026-10-31T09:00:00.000Z",
  "error": "the provider refused the key (401)"
}
~~~~

Rejected: leaks-key

~~~~
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "provider": "anthropic",
  "status": "failing",
  "checked_at": "2026-10-31T09:00:00.000Z",
  "error": "401 for sk-ant-EXAMPLE",
  "key": "sk-ant-EXAMPLE"
}
~~~~

## Validate

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