78trust / 100

Abtest Evaluate

by HALOWERK Agent Tools in Documents & files

x402 APIPassing, checked 10 h ago

Reads one conversion experiment two ways at once. Frequentist: two-proportion test, p value, confidence interval on the absolute lift, and the sample size the requested minimum detectable effect needs at the requested power. Bayesian: Beta-Binomial posteriors, probability the variant is better, expected loss either way, credible intervals - closed form, not sampled, so the numbers repeat exactly. looks_taken carries the adjusted threshold and the rate you actually ran at.

POST
https://tools.halowerk.com/v1/abtest/evaluate
Price
$0.002
per call in USDC
Uptime
98.5%
last 30 days
Response time
129 ms
185 ms slowest 5%
Last check
Passed
10 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

POST https://tools.halowerk.com/v1/abtest/evaluate

Each call costs $0.002 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://tools.halowerk.com/v1/abtest/evaluate
content-type: application/json

{
  "confidence_level": 0.95,
  "control": {
    "conversions": 241,
    "visitors": 4820
  },
  "looks_taken": 3,
  "minimum_detectable_effect_rel": 0.1,
  "variant": {
    "conversions": 302,
    "visitors": 4790
  }
}

Parameters

ParameterTypeRequiredDescription
alternativestringNotwo_sided asks whether the groups differ, greater whether the variant is above the control. One of: two_sided, greater. Default: "two_sided".
confidence_levelnumberNo Default: 0.95.
controlobjectYesBaseline group. conversions may not exceed visitors.
looks_takenintegerNoHow often the running test has been evaluated. Above 1 the threshold is adjusted and the real false positive rate is reported. Default: 1.
minimum_detectable_effect_relnumberNoRelative effect the test should be able to find, e.g. 0.1 for ten percent above the control rate. Default: 0.1.
powernumberNoProbability of finding that effect if it is there. Default: 0.8.
prior_alphanumberNoBeta prior, successes. 1 with prior_beta 1 is uniform. Default: 1.
prior_betanumberNoBeta prior, failures. Default: 1.
variantobjectYesGroup under test. conversions may not exceed visitors.

Example response

The provider's example. We can't check it without paying.

Example response, 80 lines
{
  "bayesian": {
    "credible_interval_control": [
      0.044204,
      0.056523
    ],
    "credible_interval_variant": [
      0.056515,
      0.070291
    ],
    "expected_loss_choosing_control": 0.01169,
    "expected_loss_choosing_variant": 0.000002,
    "method": "closed-form Beta-Binomial, no sampling",
    "posterior_control": {
      "alpha": 242,
      "beta": 4580,
      "mean": 0.050187
    },
    "posterior_variant": {
      "alpha": 303,
      "beta": 4489,
      "mean": 0.06323
    },
    "prior": {
      "alpha": 1,
      "beta": 1
    },
    "probability_exact": true,
    "probability_variant_better": 0.997196
  },
  "control": {
    "conversions": 241,
    "rate": 0.05,
    "visitors": 4820
  },
  "deterministic": true,
  "frequentist": {
    "absolute_lift": 0.013048,
    "alpha": 0.05,
    "alternative": "two_sided",
    "confidence_interval_absolute": [
      0.003816,
      0.02228
    ],
    "confidence_level": 0.95,
    "note": null,
    "p_value": 0.0056071682,
    "relative_lift": 0.26096,
    "significant": true,
    "standard_error": 0.00471,
    "z": 2.769911
  },
  "peeking": {
    "adjusted_alpha": 0.01666667,
    "correction": "bonferroni",
    "effective_false_positive_rate_unadjusted": 0.142625,
    "looks_taken": 3,
    "significant_after_adjustment": true
  },
  "sample_size": {
    "current_control": 4820,
    "current_variant": 4790,
    "minimum_detectable_effect_rel": 0.1,
    "power": 0.8,
    "required_per_group": 30245,
    "sufficient": false
  },
  "stateless": true,
  "variant": {
    "conversions": 302,
    "rate": 0.063048,
    "visitors": 4790
  },
  "verdict": {
    "decision": "keep_running",
    "reasons": [
      "Fewer observations per group (4790) than the 30245 the requested minimum detectable effect needs."
    ]
  }
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.002.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://tools.halowerk.com/v1/abtest/evaluate' \
  -H 'content-type: application/json' \
  --data-raw '{"confidence_level":0.95,"control":{"conversions":241,"visitors":4820},"looks_taken":3,"minimum_detectable_effect_rel":0.1,"variant":{"conversions":302,"visitors":4790}}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://tools.halowerk.com/v1/abtest/evaluate' \
  -H 'content-type: application/json' \
  --data-raw '{"confidence_level":0.95,"control":{"conversions":241,"visitors":4820},"looks_taken":3,"minimum_detectable_effect_rel":0.1,"variant":{"conversions":302,"visitors":4790}}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.002 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.002" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.002 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Ftools.halowerk.com%2Fv1%2Fabtest%2Fevaluate&method=POST
const res = await pay("https://tools.halowerk.com/v1/abtest/evaluate", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "confidence_level": 0.95,
    "control": {
      "conversions": 241,
      "visitors": 4820
    },
    "looks_taken": 3,
    "minimum_detectable_effect_rel": 0.1,
    "variant": {
      "conversions": 302,
      "visitors": 4790
    }
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.002 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.002"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://tools.halowerk.com/v1/abtest/evaluate",
        json={
            "confidence_level": 0.95,
            "control": {
                "conversions": 241,
                "visitors": 4820,
            },
            "looks_taken": 3,
            "minimum_detectable_effect_rel": 0.1,
            "variant": {
                "conversions": 302,
                "visitors": 4790,
            },
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
10 h agoPassed402132 ms$0.002
20 h agoPassed402123 ms$0.002
31 h agoPassed402135 ms$0.002
41 h agoPassed402121 ms$0.002
2 days agoPassed402198 ms$0.002
Show 10 older checks
3 days agoPassed402120 ms$0.002
3 days agoPassed402167 ms$0.002
5 days agoTimed out---
6 days agoPassed402185 ms$0.002
7 days agoPassed402150 ms$0.002
7 days agoPassed402129 ms$0.002
8 days agoPassed402135 ms$0.002
8 days agoPassed402125 ms$0.002
8 days agoPassed402123 ms$0.002
9 days agoPassed402158 ms$0.002