> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weflayr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# A/B tests

> Split the calls that send one slug between two routes, to compare them in production.

An A/B test splits the calls that send its `strategy/<slug>` as their model between two variants, A and B, by the share you set. Each variant sends its calls to a [routing strategy](https://docs.weflayr.com/product/routing-strategies.md) (its live version, or one version you pin) or to one model. Each call goes to a variant at random, so one customer's calls can reach both.

You can also keep some customers out of the test: their calls always go to the target you set for them.

<video src="https://mintcdn.com/weflayr/TmxJIL9nvZwA4h_j/images/product/ab-test-page.mp4?fit=max&auto=format&n=TmxJIL9nvZwA4h_j&q=85&s=cdd411fd63a474769043e793c565b52a" poster="/images/product/ab-test-page-poster.jpg" aria-label="A/B testing page: the list of tests, then a test with its two variants, the share of each and the customers kept out" controls loop muted playsInline preload="metadata" />

Create and change A/B tests on the dashboard's **A/B testing** page, or with the [management API](https://docs.weflayr.com/api/management/set-ab-test.md) (also accessible with the [MCP server](https://docs.weflayr.com/api/management/mcp-server.md)). Every save creates a new version, and you can restore an older one.

## Call an A/B test

Call it the way you call a strategy, with its slug as the model: `strategy/<slug>`, or `strategy/<slug>:<version>` to pin one of its versions. A/B tests and strategies share the same slugs, so a slug names one or the other.

## End a test

Weflayr never ends a test or picks a winner, and does not report the results of each variant yet. Once you have chosen a variant, change the model your code sends:

* A variant sending its calls to a strategy: send that strategy's `strategy/<slug>`, or `strategy/<slug>:<version>` if the variant pins a version.
* A variant sending its calls to a model: send that model, with its `provider` and `region`.

Then archive the test: the gateway refuses the calls that still send its slug. A strategy that an A/B test sends calls to cannot be archived until the test is.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.