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

Terminal
curl https://vibecode.bitrix24.com/v1/ai/credentials \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl https://vibecode.bitrix24.com/v1/ai/credentials \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
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

javascript
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
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionArray of connected keys
Fielddata[].id Typestring DescriptionUnique key ID
Fielddata[].providerId Typestring DescriptionProvider ID. List: GET /v1/ai/providers
Fielddata[].provider.slug Typestring DescriptionSystem provider name: openai, anthropic, custom-openai-compat, etc.
Fielddata[].provider.name Typestring DescriptionDisplay name of the provider
Fielddata[].name Typestring DescriptionKey name set by the user
Fielddata[].scope Typestring DescriptionKey scope: USER — your personal key, PORTAL — shared within the current Bitrix24 account
Fielddata[].isDefault Typeboolean DescriptionDefault-key flag for the provider
Fielddata[].lastError Typestring | null DescriptionLast verification error (null if there were no errors)
Fielddata[].lastErrorAt Typestring | null DescriptionTime of the last error in ISO 8601
Fielddata[].usage.requests Typenumber DescriptionGroup request count over the last 30 days: USER — user + provider, PORTAL — Bitrix24 account + provider
Fielddata[].usage.promptTokens Typenumber DescriptionInput tokens for the same group over 30 days
Fielddata[].usage.completionTokens Typenumber DescriptionResponse tokens for the same group over 30 days
Fielddata[].createdAt Typestring DescriptionCreation time in ISO 8601
Fielddata[].updatedAt Typestring DescriptionTime of the last update in ISO 8601

Response example

JSON
{
  "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:

JSON
{
  "success": true,
  "data": []
}

Error response example

403 scope_missing — the API key does not have the vibe:ai scope:

JSON
{
  "success": false,
  "error": {
    "code": "scope_missing",
    "message": "API key does not have the vibe:ai scope"
  }
}

Errors

HTTP Code Description
HTTP403 Codescope_missing DescriptionThe API key lacks the vibe:ai scope
HTTP401 CodeMISSING_API_KEY DescriptionThe 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.

See also