# Prompt Compressor / Context Shrinker

> Prompt Compressor / Context Shrinker is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Rewrites a long system prompt down to a target compression ratio while preserving all instructions, constraints, and examples — dropping filler, redundancy, and ceremonial language.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/prompt-compress
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-3c248014
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_F81xisFFPiqYZhD1nIk9Y

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 x402-deployer-x402-deployer-workers-dev-3c248014 -d '<json body>'
```

Example prompt: Can you compress this 2000-token system prompt down to about 40% of its original length? Here's the prompt: [paste prompt]. Keep every instruction and constraint intact — just cut the filler, repetition, and polite padding.

## When to prefer this

Use this endpoint when you need to reduce token count and LLM API costs for long system prompts, especially when the prompt has verbose instructions, ceremonial politeness, or redundant repetition. Prefer this over manual editing when you want an AI-driven distillation that guarantees semantic preservation of every constraint and example.

## Known failure modes

- Prompt text missing or empty — returns 400 bad request
- Target ratio not specified or out of range — may default or error
- Payment not provided or insufficient USDC — returns 402 payment required
- Upstream Venice/mistral model unavailable — returns 503
- Prompt too short to meaningfully compress — may return near-original text
- Rate limiting on the worker — returns 429

## How this service works

Prompt compressor / context shrinker / prompt distiller / cost-cutter for long system prompts. Rewrites a long prompt down to a target ratio of its original length while preserving every instruction, constraint, and example's intent. Drops filler words, redundant repetition, and ceremonial politeness. Powered by Venice mistral-small-3-2-24b.

## Output

Returns the rewritten, compressed prompt text that preserves all original instructions, constraints, and example intent at the specified target ratio, with redundancy and filler removed.

## Example request

```json
{
 "prompt": "You are a helpful AI assistant. You should always be polite, respectful, and professional in your interactions with users. When responding to questions, make sure to provide accurate and helpful information. Always double-check your work before submitting responses. Never make up information or provide false data. If you don't know something, say so clearly. Be concise but thorough in your explanations. Consider the user's perspective and try to be as helpful as possible. Remember to maintain a friendly tone throughout the conversation. If the user asks for help with something, do your best to assist them in a clear and organized manner. Always respect user privacy and confidentiality. Follow all applicable laws and regulations. Be honest and transparent in your communications.",
 "targetRatio": 0.4
}
```

## 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": {
     "required": [
      "prompt"
     ],
     "properties": {
      "prompt": {
       "type": "string",
       "description": "Prompt to compress. Up to 60,000 chars."
      },
      "target_ratio": {
       "type": "number",
       "description": "Target length as a fraction of original. Range [0.1, 1.0]. Default 0.4."
      }
     }
    },
    "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",
     "properties": {
      "model": {
       "type": "string"
      },
      "source": {
       "type": "string"
      },
      "original": {
       "type": "string"
      },
      "compressed": {
       "type": "string"
      },
      "actual_ratio": {
       "type": "number"
      },
      "target_ratio": {
       "type": "number"
      },
      "original_chars": {
       "type": "integer"
      },
      "compressed_chars": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-3c248014/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
