Micro Packing Displacement Analysis
by Packing displacement analysis in Onchain & crypto
Compare strict rank-prefix packing with rank-order greedy-fit and score-density greedy-fit for up to 64 passages under a 1–2048 token budget. Report evidence displacement and optional observed selection violations. Uses declared integer costs/scores; no tokenization or causal attribution.
https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis- Price
- $0.078
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 346 ms
- 670 ms slowest 5%
- Last check
- Passed
- 2 h ago, next any minute now
Reliability
How to call it
POST https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis
Each call costs $0.078 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://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis
content-type: application/json
{
"budget": 8,
"candidates": [
{
"evidenceIds": [
"e1"
],
"passageId": "p1",
"rank": 1,
"score": 9,
"tokens": 6
},
{
"evidenceIds": [
"e2"
],
"passageId": "p2",
"rank": 2,
"score": 8,
"tokens": 5
},
{
"evidenceIds": [
"e2"
],
"passageId": "p3",
"rank": 3,
"score": 3,
"tokens": 2
}
],
"dataClass": "synthetic",
"observedSelectedPassageIds": null,
"requiredEvidenceIds": [
"e1",
"e2"
]
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
budget | integer | Yes | |
candidates | array | Yes | |
dataClass | string | Yes | One of: public, synthetic. |
observedSelectedPassageIds | array or null | Yes | |
requiredEvidenceIds | array | Yes |
Example response
The provider's example. We can't check it without paying.
Example response, 67 lines
{
"amountBaseUnits": "78000",
"boundaries": [
"Public or synthetic inputs only. Caller labels are declarations,…"
],
"inputDigest": "sha256:dca4136fd984b5a0cd6170947e2b89cf4f9a472443ac80e7b00623a80…",
"offerId": "packing-displacement-analysis",
"receiptDigest": "sha256:24985ca1d03b3240df328902b9b5f442b1d3c93678823c9b5c0ad363a…",
"result": {
"budget": 8,
"causalityEstablished": false,
"dataClass": "synthetic",
"densityDisplacedPassageIds": [
"p1"
],
"densityGreedy": {
"coverageBps": 5000,
"coveredEvidenceIds": [
"e2"
],
"selectedPassageIds": [
"p2",
"p3"
],
"totalScore": 11,
"usedTokens": 7
},
"greedyAddedPassageIds": [
"p3"
],
"greedyFit": {
"coverageBps": 10000,
"coveredEvidenceIds": [
"e1",
"e2"
],
"selectedPassageIds": [
"p1",
"p3"
],
"totalScore": 12,
"usedTokens": 8
},
"greedyRecoveredEvidenceIds": [
"e2"
],
"inputSha256": "sha256:dca4136fd984b5a0cd6170947e2b89cf4f9a472443ac80e7b00623a80…",
"limits": [
"Public/synthetic is a caller declaration, not content inspection…"
],
"observedSelection": null,
"rankPrefix": {
"coverageBps": 5000,
"coveredEvidenceIds": [
"e1"
],
"selectedPassageIds": [
"p1"
],
"totalScore": 9,
"usedTokens": 6
},
"resultSha256": "sha256:45a542ef56b8f1a295b2ca7ab633aa121d2a07a6dd811984bd941498e…",
"sourcesVerified": false
},
"version": "maha-microproducts/0.1"
}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.078.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis' \
-H 'content-type: application/json' \
--data-raw '{"budget":8,"candidates":[{"evidenceIds":["e1"],"passageId":"p1","rank":1,"score":9,"tokens":6},{"evidenceIds":["e2"],"passageId":"p2","rank":2,"score":8,"tokens":5},{"evidenceIds":["e2"],"passageId":"p3","rank":3,"score":3,"tokens":2}],"dataClass":"synthetic","observedSelectedPassageIds":null,"requiredEvidenceIds":["e1","e2"]}'
# 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://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis' \
-H 'content-type: application/json' \
--data-raw '{"budget":8,"candidates":[{"evidenceIds":["e1"],"passageId":"p1","rank":1,"score":9,"tokens":6},{"evidenceIds":["e2"],"passageId":"p2","rank":2,"score":8,"tokens":5},{"evidenceIds":["e2"],"passageId":"p3","rank":3,"score":3,"tokens":2}],"dataClass":"synthetic","observedSelectedPassageIds":null,"requiredEvidenceIds":["e1","e2"]}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: 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.078 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.078" });
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.078 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fwww.mahastrategies.com%2Fapi%2Fv1%2Fmicro%2Fpacking-displacement-analysis&method=POST
const res = await pay("https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"budget": 8,
"candidates": [
{
"evidenceIds": [
"e1"
],
"passageId": "p1",
"rank": 1,
"score": 9,
"tokens": 6
},
{
"evidenceIds": [
"e2"
],
"passageId": "p2",
"rank": 2,
"score": 8,
"tokens": 5
},
{
"evidenceIds": [
"e2"
],
"passageId": "p3",
"rank": 3,
"score": 3,
"tokens": 2
}
],
"dataClass": "synthetic",
"observedSelectedPassageIds": null,
"requiredEvidenceIds": [
"e1",
"e2"
]
}),
});
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.078 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.078"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis",
json={
"budget": 8,
"candidates": [
{
"evidenceIds": [
"e1",
],
"passageId": "p1",
"rank": 1,
"score": 9,
"tokens": 6,
},
{
"evidenceIds": [
"e2",
],
"passageId": "p2",
"rank": 2,
"score": 8,
"tokens": 5,
},
{
"evidenceIds": [
"e2",
],
"passageId": "p3",
"rank": 3,
"score": 3,
"tokens": 2,
},
],
"dataClass": "synthetic",
"observedSelectedPassageIds": None,
"requiredEvidenceIds": [
"e1",
"e2",
],
},
)
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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 2 h ago | Passed | 402 | 329 ms | $0.078 |
| 6 h ago | Passed | 402 | 428 ms | $0.078 |
| 10 h ago | Passed | 402 | 384 ms | $0.078 |
| 14 h ago | Passed | 402 | 694 ms | $0.078 |
| 18 h ago | Passed | 402 | 587 ms | $0.078 |
Show 10 older checks
| 22 h ago | Passed | 402 | 323 ms | $0.078 |
| 26 h ago | Passed | 402 | 322 ms | $0.078 |
| 30 h ago | Passed | 402 | 340 ms | $0.078 |
| 34 h ago | Passed | 402 | 267 ms | $0.078 |
| 37 h ago | Passed | 402 | 346 ms | $0.078 |
| 41 h ago | Passed | 402 | 341 ms | $0.078 |
| 45 h ago | Passed | 402 | 670 ms | $0.078 |
| 2 days ago | Passed | 402 | 549 ms | $0.078 |
| 2 days ago | Passed | 402 | 418 ms | $0.078 |
| 2 days ago | Passed | 402 | 488 ms | $0.078 |