Get started

SDKs & Test Code

Copy-pasteable clients and runnable assertion suites across TypeScript, Vercel AI SDK, Python, Go, Rust, and cURL.

Zero-dependency HTTP contract

Every Mackerel endpoint accepts standard JSON over HTTPS with a single Authorization: Bearer header. Use native fetch, httpx, net/http, reqwest, or Vercel AI SDK tool() directly with zero SDK lock-in.

Runnable test suites

Drop the matching test file into your repository, export MACKEREL_API_KEY, and run your native test runner. Each test verifies override precedence, ACL isolation, and clean abstention against demo_sops.

set -euo pipefail

check() {
  curl -fsS -X POST "https://api.runmackerel.com/v1/search" \
    -H "Authorization: Bearer $MACKEREL_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Mackerel-ZDR: true" \
    -d "$1"
}

GOV=$(check '{"corpus":"demo_sops","query":"Can a contractor on our German entity expense a €140 client dinner?","groups":["finance-emea"]}' | jq -r '.governing[0].id')
test "$GOV" = "te-4.2b"

ABS=$(check '{"corpus":"demo_sops","query":"What is the office Wi-Fi password in Tokyo?","groups":["finance-emea"]}' | jq -r '.abstained')
test "$ABS" = "true"

echo "All Mackerel assertions passed."

What the test suite asserts

Test caseInputRequired assertion
Override precedenceDACH contractor €140 dinner, groups: [finance-emea]governing[0].id === "te-4.2b", overridden contains te-4.2, superseded contains eh-7.
ACL-before-retrievalLitigation hold query with groups: [] vs [legal]trace.considered is strictly smaller without legal; restricted rule never enters scoring.
Clean abstentionTokyo office Wi-Fi passwordabstained === true and governing.length === 0.

CI smoke check

Run the matching command in your terminal or CI pipeline:

MACKEREL_API_KEY=mk_test_... bash verify.sh