# Packing Displacement Analysis

> Packing Displacement Analysis is a paid API for AI agents from www.mahastrategies.com, paid per call via x402, $0.078/call, status unknown (last checked 2026-10-16).

Compares strict rank-prefix packing, rank-order greedy-fit, and score-density greedy-fit strategies for up to 64 passages under a token budget, reporting evidence displacement and optional selection violations.

## Facts

- Endpoint: POST https://www.mahastrategies.com/api/v1/micro/packing-displacement-analysis?utm_source=zero.xyz
- Price: $0.078/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/packing-displacement-analysis-248123c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__d3_9k95szbgRcGnLGxz2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability packing-displacement-analysis-248123c1 -d '<json body>'
```

Example prompt: Compare strict rank-prefix packing against rank-order greedy-fit and score-density greedy-fit for these 20 candidate passages — each with declared token costs and relevance scores — using a 512-token budget, with required evidence IDs [e1, e2, e3], and check whether my observed selection [p1, p4, p7] violates the optimal strategy. Data class is synthetic.

## When to prefer this

Choose this endpoint when you need a deterministic, integer-cost comparison of multiple context-window packing strategies without any tokenization or causal inference — specifically when auditing RAG pipelines, verifying that observed passage selections are consistent with optimal strategies, or quantifying evidence displacement across rank-prefix and greedy-fit methods. It is uniquely suited for scenarios where you have explicit declared costs and scores and want a reproducible algorithmic comparison rather than a heuristic or ML-based recommendation.

## Known failure modes

- More than 64 candidates or required evidence IDs submitted — rejected with validation error
- Token budget outside 1–2048 range — rejected
- Missing required fields (dataClass, budget, requiredEvidenceIds, candidates) — 400-level error
- Invalid dataClass enum value (not 'public' or 'synthetic') — schema validation failure
- Payment not processed — x402 payment required error
- observedSelectedPassageIds array exceeds 64 items — rejected

## How this service works

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.

## Output

Returns a structured result object containing per-strategy packing outcomes, evidence displacement counts, optional observed selection violation flags, boundary arrays, an offer ID ('packing-displacement-analysis'), version string, amount in base units, and cryptographic input/receipt digests for auditability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "dataClass",
      "budget",
      "requiredEvidenceIds",
      "candidates",
      "observedSelectedPassageIds"
     ],
     "properties": {
      "budget": {
       "type": "integer",
       "maximum": 2048,
       "minimum": 1
      },
      "dataClass": {
       "enum": [
        "public",
        "synthetic"
       ],
       "type": "string"
      },
      "candidates": {
       "type": "array",
       "maxItems": 64,
       "minItems": 1
      },
      "requiredEvidenceIds": {
       "type": "array",
       "maxItems": 64,
       "minItems": 1
      },
      "observedSelectedPassageIds": {
       "anyOf": [
        {
         "type": "array",
         "maxItems": 64,
         "minItems": 0
        },
        {
         "type": "null"
        }
       ]
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "version",
      "offerId",
      "amountBaseUnits",
      "inputDigest",
      "result",
      "boundaries",
      "receiptDigest"
     ],
     "properties": {
      "result": {
       "type": "object"
      },
      "offerId": {
       "enum": [
        "packing-displacement-analysis"
       ],
       "type": "string"
      },
      "version": {
       "enum": [
        "maha-microproducts/0.1"
       ],
       "type": "string"
      },
      "boundaries": {
       "type": "array",
       "maxItems": 128,
       "minItems": 0
      },
      "inputDigest": {
       "type": "string",
       "maxLength": 71
      },
      "receiptDigest": {
       "type": "string",
       "maxLength": 71
      },
      "amountBaseUnits": {
       "enum": [
        "78000"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/packing-displacement-analysis-248123c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.mahastrategies.com](https://www.zero.xyz/host/www.mahastrategies.com/llms.txt)
