How to Activate
Two methods — both produce the same behavior:- Header-Based (Recommended)
- Test Key Prefix
Add Works with any API key (live or test). The header takes precedence.
X-LimitGuard-Mode: sandbox to any request:Sandbox Behavior
Mock Data Examples
/v1/entity/check (sandbox)
/v1/risk/score (sandbox)
Rate Limit Response
When the sandbox rate limit is exceeded:Retry-After: 60 header.
Use Cases
Middleware Execution Order
Sandbox detection runs before x402 payment verification in the middleware stack:This means sandbox mode skips payment verification entirely. The x402 middleware sees the sandbox flag and passes through without checking for payment.
Transitioning to Production
When ready to use real data:- Remove
X-LimitGuard-Mode: sandboxheader, or - Switch from
lg_test_key to alg_live_key