# Agent Rest Stop – SizeCap (Document Byte-Cap Fitter)

> Agent Rest Stop – SizeCap (Document Byte-Cap Fitter) is a paid API for AI agents from agent-gas-station.agent-gas-station.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-02).

Truncates or fits a document to a specified maximum byte size, returning a compacted version that does not exceed the byte cap.

## Facts

- Endpoint: POST https://agent-gas-station.agent-gas-station.workers.dev/v1/SizeCap?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-rest-stop-sizecap-document-byte-cap-fitter-b2094c49
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2iaiZ0_Thm-RFoHX4_mcU

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 agent-rest-stop-sizecap-document-byte-cap-fitter-b2094c49 -d '<json body>'
```

Example prompt: Take this article and trim it down so it fits under 4096 bytes — keep as much content as possible but don't go over that limit.

## When to prefer this

Choose this endpoint when you need a simple, deterministic byte-cap on a document — especially in agentic pipelines where downstream services or LLM context windows have hard byte limits. It is distinct from general text summarization or compression: it enforces a strict byte ceiling rather than semantically condensing content.

## Known failure modes

- max_bytes value is not a valid number string, causing a parse error
- doc is empty or null, resulting in an empty or error response
- max_bytes is smaller than minimum viable content, returning nearly empty output
- Very large documents may hit request size limits before being processed
- Payment failure ($0.01 USDC) if x402 payment header is missing or invalid

## How this service works

Fits a document under a byte cap.

## Output

A version of the input document that has been truncated or fitted to not exceed the specified max_bytes limit, returned as a string.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "doc": {
   "type": "string"
  },
  "max_bytes": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-rest-stop-sizecap-document-byte-cap-fitter-b2094c49/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-gas-station.agent-gas-station.workers.dev](https://www.zero.xyz/host/agent-gas-station.agent-gas-station.workers.dev/llms.txt)
