# Experiment

URL: https://docs.hanzo.ai/docs/cli/experiment

> The `hanzo experiment` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/experiment) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/experiment) · [SDKs](https://docs.hanzo.ai/docs/sdks)

A/B testing anything: a flag, an ad, a subject line, a model.

[API reference →](https://docs.hanzo.ai/docs/openapi/experiment)

```bash
hanzo experiment list
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                                                                                                                                          | What it does                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `hanzo experiment analyze <id>`                                                                                                                  | Per-variant conversion, lift and statistical significance against the control arm.                                                                                                                                                         |
| `hanzo experiment assign <id> --subject <subject>`                                                                                               | The variant one subject is bucketed into, and the payload that variant carries.                                                                                                                                                            |
| `hanzo experiment create --id <id> --metric-event <metricEvent> --variants '[{"control":false,"key":"<key>","payload":"<payload>","weight":0}]'` | Registers a controlled experiment AND puts its assignment flag live, in that order, so the arms start bucketing subjects the moment this returns 201 — the flag is created active at 100% rollout, with each variant weighted as declared. |
| `hanzo experiment decide <id> --winner <winner>`                                                                                                 | Promotes one variant to the whole rollout and records who decided.                                                                                                                                                                         |
| `hanzo experiment get <id>`                                                                                                                      | One experiment's definition and lifecycle: variants, weights, control arm, status and winner.                                                                                                                                              |
| `hanzo experiment health`                                                                                                                        | Whether the experiments subsystem is mounted and serving in this process.                                                                                                                                                                  |
| `hanzo experiment list`                                                                                                                          | Every experiment in the caller's org, with its variants, status and decision, ordered by project then id.                                                                                                                                  |
