# Strale Context Window Optimizer

> Strale Context Window Optimizer is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0324/call, status unknown (last checked 2026-10-12).

Optimizes and compresses document text to fit within AI context windows while preserving key information

## Facts

- Endpoint: GET https://api.strale.io/x402/v2/context-window-optimize?utm_source=zero.xyz
- Price: $0.0324/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/strale-context-window-optimizer-7c30d213
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J3j2VfUkipbXOIcn0zhmD

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 strale-context-window-optimizer-7c30d213
```

Example prompt: Can you optimize this large document so it fits within my AI model's context window? Here's the full text: [document text].

## When to prefer this

Choose this endpoint when you need a verifiable, audited text compression step for large documents before passing them to an LLM, especially in regulated or trust-sensitive agentic workflows where cryptographic proof of transformation is required. Prefer over generic summarization when you need context-window-specific sizing guarantees and an immutable audit trail.

## Known failure modes

- Missing or empty 'documents' field returns a 400 error
- Document too large to meaningfully compress may return partial or error response
- Malformed input string may cause processing failure
- Network timeout on very large document inputs
- Payment failure via x402 protocol blocks request

## How this service works

The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.

## Output

Returns an optimized, compressed version of the input documents that fits within typical AI context windows, with cryptographic audit record and chain hash for verification of the transformation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "documents": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "excluded": {
  "type": "array"
 },
 "selected": {
  "type": "array"
 },
 "tokens_remaining": {
  "type": "integer"
 },
 "total_tokens_used": {
  "type": "integer"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/strale-context-window-optimizer-7c30d213/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
