On this page

BuildAPI reference

API reference

Base URL: https://cloud.qbrix.io

This reference covers the endpoints you call from your application to run adaptive optimization: pools, experiments, selection and feedback, feature gates, and policies. Account, workspace, and billing management live in the console, not the API.

Tip

Prefer a typed client? Use an official SDK instead of raw HTTP — see the Python SDK and JavaScript / TypeScript SDK.

The curl examples below assume these environment variables:

export QBRIX_URL="https://cloud.qbrix.io"
export QBRIX_API_KEY="your-api-key"

Authentication

All requests authenticate with an API key. Create and manage keys under Settings → API Keys in the console, then pass the key in the X-API-Key header:

curl $QBRIX_URL/api/v1/pools \
  -H "X-API-Key: $QBRIX_API_KEY"

Keys inherit the role of the workspace member that created them, which determines the operations they can perform. Keep keys secret and rotate them from the console if one is exposed.

Pools

POST/api/v1/poolsCreate a new pool with arms
pool = client.pool.create(
    name="my-pool",
    arms=[
        {"name": "variant-a"},
        {"name": "variant-b"},
        {"name": "variant-c"},
    ],
)
GET/api/v1/poolsList all pools (paginated)
page = client.pool.list(limit=100, offset=0)
for pool in page.items:
    print(pool.name)
GET/api/v1/pools/{id}Get pool by ID
pool = client.pool.get("<pool-id>")
PATCH/api/v1/pools/{id}Update pool
DELETE/api/v1/pools/{id}Delete pool
client.pool.delete("<pool-id>")
GET/api/v1/pools/{id}/experimentsList experiments for pool
experiments = client.pool.list_experiments("<pool-id>")

Experiments

POST/api/v1/experimentsCreate a new experiment
experiment = client.experiment.create(
    name="hero-test",
    pool_id="<pool-id>",
    policy="BetaTSPolicy",
)
GET/api/v1/experimentsList experiments (paginated, filterable)
page = client.experiment.list(limit=100, offset=0)
for exp in page.items:
    print(f"{exp.name} ({exp.policy})")
GET/api/v1/experiments/{id}Get experiment by ID
experiment = client.experiment.get("<experiment-id>")
PATCH/api/v1/experiments/{id}Update experiment
experiment = client.experiment.update(
    "<experiment-id>",
    enabled=False,
)
POST/api/v1/experiments/{id}/resetReset learned params to configured policy_params

Resets the experiment's learned parameters back to its configured policy_params. Requires the experiment:write scope. The experiment must be paused first — a running experiment returns 409.

experiment = client.experiment.reset("<experiment-id>")
DELETE/api/v1/experiments/{id}Delete experiment

Agent (selection & feedback)

POST/api/v1/agent/selectSelect an arm
result = client.agent.select(
    experiment_id="<experiment-id>",
    context={"id": "user-123"},
)

For contextual policies, include the properties the experiment's schema declares:

from qbrix import Context
 
result = client.agent.select(
    experiment_id="<experiment-id>",
    context=Context(
        id="user-123",
        properties={"device": "mobile", "cart_value": 62.5},
        metadata={"country": "US"},
    ),
)
POST/api/v1/agent/feedbackSubmit reward feedback
client.agent.feedback(
    request_id="<request-id>",
    reward=1.0,
)
Note

Both SDKs support a per-call timeout and a fallback arm on select() so a call fails open instead of hanging or raising when qbrix is unreachable — this is client-side behavior, not a request parameter these endpoints accept. See Handling outages.

Feature gates

POST/api/v1/gates/{experiment_id}Create a feature gate
gate = client.gate.create(
    experiment_id="<experiment-id>",
    enabled=True,
    rollout_percentage=50.0,
)
GET/api/v1/gates/{experiment_id}Get feature gate config
gate = client.gate.get("<experiment-id>")
PATCH/api/v1/gates/{experiment_id}Update part of a feature gate

Writes the fields present in the body and leaves the rest of the gate as stored. An explicit null clears a field, and rules replaces the whole list — omit it to keep the stored rules, send [] to remove them.

gate = client.gate.update(
    experiment_id="<experiment-id>",
    rollout_percentage=50.0,
)
PUT/api/v1/gates/{experiment_id}Replace a feature gate

Replaces the whole configuration: any field absent from the body is reset to its default. Use PATCH unless you mean to rewrite the gate wholesale.

curl -X PUT $QBRIX_URL/api/v1/gates/<experiment-id> \
  -H "X-API-Key: $QBRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "rollout_percentage": 100,
    "rules": [
      {
        "key": "country",
        "operator": "in",
        "value": ["US", "GB", "DE"],
        "arm_id": "<arm-id>"
      }
    ]
  }'
DELETE/api/v1/gates/{experiment_id}Delete feature gate

Policies

GET/api/v1/policiesList all available policies

Returns all policies with their configurable parameters. See the Policies page for detailed guidance.