# OpenAPI/Swagger Document Redactor for LLM Context

> OpenAPI/Swagger Document Redactor for LLM Context is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Strips verbose meta-fields (examples, descriptions, summaries, tags, externalDocs, deprecated) from an OpenAPI 3.x or Swagger 2.x document to shrink it for LLM context windows

## Facts

- Endpoint: POST https://agent402.tools/api/openapi-redact
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openapi-swagger-document-redactor-for-llm-context-84955a5d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0XTMa33MaCZfxEqHJdFat

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 openapi-swagger-document-redactor-for-llm-context-84955a5d -d '<json body>'
```

Example prompt: Strip the examples, descriptions, and deprecated fields from this OpenAPI spec so it fits in my LLM context — here's the full spec JSON: {...}.

## When to prefer this

Use this endpoint when you need to pass an OpenAPI or Swagger specification into an LLM and the full document is too large for the context window. It is purpose-built for LLM token reduction on API specs, with fine-grained control over which meta-field categories to strip, unlike generic JSON minifiers or schema validators.

## Known failure modes

- Invalid or unparseable OpenAPI/Swagger document returns an error
- Unrecognized strip category values may be ignored or return a validation error
- Empty or null spec input returns a processing error
- Non-JSON string input that cannot be parsed fails with a parse error

## How this service works

Shrink an OpenAPI 3.x or Swagger 2.x document for LLM context by stripping verbose meta-fields (examples, descriptions, summaries, tags, externalDocs, deprecated). Categories are explicit; default is `["examples", "descriptions"]`. User-defined property names under `properties: { ... }` are protected - only the meta-field `example` keyword inside a property schema is removed, not a user property literally named "example".

## Output

A reduced OpenAPI or Swagger document object with the specified categories of verbose fields removed, ready to be passed directly into an LLM prompt with fewer tokens consumed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "spec": {
   "description": "OpenAPI/Swagger document (object or JSON string)"
  },
  "strip": {
   "description": "Categories to remove. Valid: examples, descriptions, summaries, tags, externalDocs, deprecated. Defaults to [\"examples\", \"descriptions\"]."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "spec": {
   "info": {
    "title": "Demo",
    "version": "1.0.0"
   },
   "paths": {
    "/users": {
     "get": {
      "summary": "List users",
      "responses": {
       "200": {}
      },
      "parameters": [
       {
        "in": "query",
        "name": "limit",
        "schema": {
         "type": "integer"
        }
       }
      ]
     }
    }
   },
   "openapi": "3.0.0"
  },
  "removed": {
   "examples": 1,
   "descriptions": 4
  },
  "sizeAfter": 209,
  "sizeBefore": 334
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openapi-swagger-document-redactor-for-llm-context-84955a5d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
