# Context Preparation API — Inspect

> Context Preparation API — Inspect is a paid API for AI agents from nexus-x402-ff2a.onrender.com, paid per call via x402, $0.0002/call, status unknown (last checked 2026-09-14).

Runs deterministic safety inspection, multi-format cleaning, structural chunking, hybrid ranking, contradiction detection, and target-model token packing on text content for AI agent pipelines.

## Facts

- Endpoint: POST https://nexus-x402-ff2a.onrender.com/v1/inspect
- Price: $0.0002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/context-preparation-api-inspect-3c64b51d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MJaqVr0nBJ3rsdH6H_7Gd

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 context-preparation-api-inspect-3c64b51d -d '<json body>'
```

Example prompt: Can you inspect this article for safety issues, detect any contradictions, clean it up, and chunk it into 512-token pieces ranked by relevance to the question 'What are the key risks of autonomous vehicles?' — pack the result for GPT-4 within a 4096-token budget?

## When to prefer this

Choose this endpoint when you need a deterministic, auditable pre-processing pipeline for AI agent context windows — especially when you require safety inspection, contradiction detection, and token-budget-aware packing in a single call. Prefer it over ad-hoc chunking libraries when you need hybrid ranking (semantic + structural) and need the output validated against a specific target model's constraints. It is particularly well-suited for RAG pipelines, long-document QA, and any agentic workflow where untrusted or multi-source documents must be safely ingested before LLM inference.

## Known failure modes

- Missing required 'content' or 'documents' field returns a validation error
- Invalid or out-of-range maxTokens or chunkTokens integers cause processing failure
- Malformed queryEmbedding array (wrong dimensions) causes ranking step to fail
- Payment not included or insufficient — x402 payment of 0.0002 USDC required per call
- Oversized input exceeding model limits may result in truncation warnings or errors
- Network timeout on the Render-hosted service during cold start

## How this service works

Deterministic multi-format cleaning, safety inspection, structural chunking, hybrid ranking, contradiction checks, and target-model token packing for AI agents.

## Output

Returns a JSON object with: the operation type performed ('clean', 'inspect', 'pack', or 'prepare'), the processed content string, an array of structural chunks (each as an object), a safety array listing any detected issues, a warnings array, a metrics object with processing statistics, a target object describing model context details, and an optional potentialContradictions array listing detected conflicting statements across documents.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "redact": {
   "type": "boolean",
   "description": "Defaults to true for /prepare and false for other operations."
  },
  "target": {
   "type": "object"
  },
  "content": {
   "type": "string"
  },
  "question": {
   "type": "string"
  },
  "documents": {
   "type": "array"
  },
  "maxTokens": {
   "type": "integer"
  },
  "chunkTokens": {
   "type": "integer"
  },
  "queryEmbedding": {
   "type": "array"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "operation",
  "content",
  "chunks",
  "warnings",
  "safety",
  "metrics",
  "target"
 ],
 "properties": {
  "chunks": {
   "type": "array",
   "items": {
    "type": "object"
   }
  },
  "safety": {
   "type": "array",
   "items": {
    "type": "object"
   }
  },
  "target": {
   "type": "object"
  },
  "content": {
   "type": "string"
  },
  "metrics": {
   "type": "object"
  },
  "warnings": {
   "type": "array",
   "items": {
    "type": "object"
   }
  },
  "operation": {
   "enum": [
    "clean",
    "inspect",
    "pack",
    "prepare"
   ]
  },
  "potentialContradictions": {
   "type": "array",
   "items": {
    "type": "object"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/context-preparation-api-inspect-3c64b51d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nexus-x402-ff2a.onrender.com](https://www.zero.xyz/host/nexus-x402-ff2a.onrender.com/llms.txt)
