For AI agents: markdown of this page — /docs-content-en/ai/credentials/list.md documentation index — /llms.txt
List keys
GET /v1/ai/credentials
Returns your BYOK keys (USER scope) and shared keys of the current Bitrix24 account (PORTAL scope), together with usage statistics for the last 30 days. PORTAL keys are connected by the administrator in the Vibecode dashboard.
Parameters
There are no request parameters.
Examples
curl — personal key
curl https://vibecode.bitrix24.com/v1/ai/credentials \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl https://vibecode.bitrix24.com/v1/ai/credentials \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/ai/credentials', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
data.forEach((cred) => {
console.log(`${cred.name} (${cred.scope}, ${cred.provider.name}) — ${cred.usage.requests} group requests over 30 days`)
})
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/ai/credentials', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
console.log('Credentials connected:', data.length)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data |
array | Array of connected keys |
data[].id |
string | Unique key ID |
data[].providerId |
string | Provider ID. List: GET /v1/ai/providers |
data[].provider.slug |
string | System provider name: openai, anthropic, custom-openai-compat, etc. |
data[].provider.name |
string | Display name of the provider |
data[].name |
string | Key name set by the user |
data[].scope |
string | Key scope: USER — your personal key, PORTAL — shared within the current Bitrix24 account |
data[].isDefault |
boolean | Default-key flag for the provider |
data[].lastError |
string | null | Last verification error (null if there were no errors) |
data[].lastErrorAt |
string | null | Time of the last error in ISO 8601 |
data[].usage.requests |
number | Group request count over the last 30 days: USER — user + provider, PORTAL — Bitrix24 account + provider |
data[].usage.promptTokens |
number | Input tokens for the same group over 30 days |
data[].usage.completionTokens |
number | Response tokens for the same group over 30 days |
data[].createdAt |
string | Creation time in ISO 8601 |
data[].updatedAt |
string | Time of the last update in ISO 8601 |
Response example
{
"success": true,
"data": [
{
"id": "cred_abc123def456",
"providerId": "openai",
"provider": {
"slug": "openai",
"name": "OpenAI"
},
"name": "My personal OpenAI",
"scope": "USER",
"isDefault": true,
"lastError": null,
"lastErrorAt": null,
"usage": {
"requests": 142,
"promptTokens": 45200,
"completionTokens": 18300
},
"createdAt": "2026-04-15T10:00:00.000Z",
"updatedAt": "2026-04-20T14:30:00.000Z"
}
]
}
If no keys are connected, data is an empty array:
{
"success": true,
"data": []
}
Error response example
403 scope_missing — the API key does not have the vibe:ai scope:
{
"success": false,
"error": {
"code": "scope_missing",
"message": "API key does not have the vibe:ai scope"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 403 | scope_missing |
The API key lacks the vibe:ai scope |
| 401 | MISSING_API_KEY |
The X-Api-Key header was not provided |
Full list of common API errors — Errors.
Known specifics
USER and PORTAL keys are visible. The list includes your personal keys and shared keys of the current Bitrix24 account. The scope field distinguishes them. Operations on an individual key via /v1/ai/credentials/:id (update, deletion, verification, statistics, and model management) are available only for your own USER keys; a PORTAL key or another user's USER key returns 404 not_found.
lastError shows the latest problem. If a key's lastError is not null, the provider returned an error on the last check (via POST /v1/ai/credentials/:id/test or when the key was used in a chat completion request). The field resets on a successful PATCH that updates credentials or on a successful check.
Statistics for a fixed 30-day period. The usage field contains figures for the last 30 days with no option to set the period. It aggregates by user and provider for USER keys, and by all users of the current Bitrix24 account and provider for PORTAL keys. Multiple keys in the same group receive identical usage; do not sum these repeated figures. For an arbitrary period, use GET /v1/ai/credentials/:id/usage?days=N.