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

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

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

# AiMeCredentialPutV1 `ai.me-credential-put@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-put.v1.json`](/docs/contracts/ai.me-credential-put.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

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `provider` | enum | yes | The 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"` |
| `key` | string |  | The provider key. Required the first time and whenever base\_url changes; optional afterwards, when the stored key is kept. Never returned. | - `minLength 8`<br>- `maxLength 400` |
| `base_url` | string |  | The 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?#]*)?$`<br>- `maxLength 300` |
| `budget_usd_per_day` | number |  | The person's own daily cap on this key; 0 or absent means no cap. | - `minimum 0`<br>- `maximum 1000` |
| `models` | object |  | The 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.chat` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.code` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.vision` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `models.image` | string |  |  | - `minLength 1`<br>- `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 }] }
~~~~
