---
title: "Reference — Egenverk Babbla"
description: "Constants, filters, capabilities and WP-CLI commands in Egenverk Babbla for those who customise the site."
canonical: https://egenverk.se/en/plugins/babbla/docs/reference
lang: en
updated: 2026-10-14
alternate: https://egenverk.se/plugins/babbla/docs/referens.md
---
# Reference

Egenverk Babbla · v0.52.0 · WordPress 6.2+, WooCommerce 7.0+, PHP 7.4+ · Updated 2026-10-14

Babbla is in early development (0.x). The names below may change before 1.0.

## Constants in wp-config.php

A constant takes precedence over the field on the settings page and keeps the key out of the database. The field then reads "Set in wp-config.php." and cannot be edited. Older installs may have `BBL_ANTHROPIC_KEY` or `BBL_OPENAI_KEY`; they still work, but the `EGVB_` name wins when both are defined.

| Constant | Value |
|---|---|
| `EGVB_ANTHROPIC_KEY` | API key for Anthropic |
| `EGVB_OPENAI_KEY` | API key for OpenAI |
| `EGVB_GOOGLE_SERVICE_ACCOUNT` | The service account's JSON key, or an absolute path to the JSON file. The Google key field is disabled. |

```php
define( 'EGVB_ANTHROPIC_KEY', '...' );
define( 'EGVB_OPENAI_KEY', '...' );
define( 'EGVB_GOOGLE_SERVICE_ACCOUNT', '/absolute/path/key.json' );
```

## Capabilities

| Capability | Grants |
|---|---|
| `egvb_chat` | Chat access |
| `egvb_manage` | Babbla administration: settings, usage and diagnostics |

These capabilities are granted on the **Access** tab. They never grant any WordPress or WooCommerce capability.

## Filters

| Filter | Does | Default |
|---|---|---|
| `egvb_capability` | A capability that also gives chat access | `egvb_chat` |
| `egvb_admin_capability` | A capability that also gives Babbla administration | `egvb_manage` |
| `egvb_tool_capability` | The capability the assistant's store tools require | `manage_woocommerce` |
| `egvb_rate_limit` | Messages a user may send per minute | `30` |
| `egvb_upload_rate_limit` | Uploads per ten minutes per user | `30` |
| `egvb_agent_concurrency` | Assistant questions answered at the same time, at least 1 | `2` |
| `egvb_poll_interval` | The minimum seconds a closed chat waits between its scheduled requests, 0–600; a way for a busy site to space out requests | `0` |
| `egvb_files_dir` | The folder where attached files are stored | See [Data and privacy](data-and-privacy) |
| `egvb_agent_tools` | Lets another plugin add tools for the assistant | |
| `egvb_integrations` | Lets that plugin declare its integration: name, version, tools and what they read | |
| `egvb_redacted_keys` | More field names to remove from tool results | |
| `egvb_tool_status_label` | The text the chat shows while a tool runs | |
| `egvb_anthropic_request`, `egvb_openai_request` | The body of the request to each provider, just before it is sent | |

Tools added through `egvb_agent_tools` are used only once an administrator has switched their integration on under Settings. Tools without a declaration are grouped as tools from an undeclared plugin and can be switched off too.

A tool callback receives the arguments and the asking user's id, `fn( array $args, int $user_id )`. A tool that reads the user's own data must use that id, since the job runs in the background with no user logged in.

## WP-CLI

| Command | Does |
|---|---|
| `wp egvb job list` | Lists the assistant's 20 most recent jobs, optionally filtered with `--status` |
| `wp egvb job run` with a job id | Runs a job straight away. The limit on simultaneous questions does not apply here. |
| `wp egvb lean on`, `off`, `status` | Switches lean chat reads on, off, or shows their state |

## REST API

The chat uses the REST namespace `babbla/v1` with the WordPress login cookie and nonce. Every route requires chat access and follows the same rules for who sees what as the chat.

## Resources

- [Product page](https://egenverk.se/en/plugins/babbla)
- [Changelog](https://egenverk.se/en/plugins/babbla/changelog)
- [Docs](https://egenverk.se/en/plugins/babbla/docs)
- Previous: [Troubleshooting](https://egenverk.se/en/plugins/babbla/docs/troubleshooting)
