# GrowthBook

> Manage GrowthBook feature flags and A/B experiments - list and toggle features, browse experiments, projects, environments, and metrics.

Lets an agent work with your GrowthBook feature flags and experiments: list and inspect features, toggle a flag on or off per environment, browse experiments and their results, and read projects, environments, SDK connections, and metrics.

## What it can do

| Method | What it does |
| --- | --- |
| `growthbook_features_list` | List feature flags, optionally filtered by project. |
| `growthbook_feature_get` | Get one feature flag with its per-environment state and rules. |
| `growthbook_feature_toggle` | Enable or disable a feature flag per environment (write). |
| `growthbook_experiments_list` | List experiments (A/B tests), optionally filtered by project. |
| `growthbook_experiment_get` | Get one experiment with variations, status, and results metadata. |
| `growthbook_projects_list` | List projects. |
| `growthbook_environments_list` | List environments. |
| `growthbook_sdk_connections_list` | List SDK connections (the client keys apps use to fetch flags). |
| `growthbook_metrics_list` | List metrics used to evaluate experiments. |
| `growthbook_request` | Generic passthrough to any GrowthBook endpoint for full API coverage. |

## How to get credentials

1. Sign in to [app.growthbook.io](https://app.growthbook.io) (or your self-hosted instance).
2. Open **Settings → API Keys** ([app.growthbook.io/settings/keys](https://app.growthbook.io/settings/keys)).
3. Create a **Secret** API key (not an SDK/client key) and copy it - the full token is shown only once.
4. Paste the token into FlyMyAI. If you self-host GrowthBook, also set `GROWTHBOOK_BASE_URL` to your instance's API base (for example `https://gb.example.com/api/v1`).

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `GROWTHBOOK_API_KEY` | GrowthBook → Settings → API Keys (Secret key) |
| `GROWTHBOOK_BASE_URL` | Optional - self-hosted only. Default `https://api.growthbook.io/api/v1` for GrowthBook Cloud |

## Troubleshooting

- **`401 Unauthorized`** - the key is wrong, revoked, or is an SDK/client key rather than a Secret key. Create a Secret key under Settings → API Keys.
- **Calls hit the wrong host** - self-hosted users must set `GROWTHBOOK_BASE_URL`; otherwise calls go to GrowthBook Cloud.
- **`growthbook_feature_toggle` does nothing visible** - check the environment ids. They must match the ids returned by `growthbook_environments_list` (for example `production`, `dev`).

## Links

- [GrowthBook API reference](https://docs.growthbook.io/api)
- [API keys](https://app.growthbook.io/settings/keys)
