# Bounty Engineer Context Pack API

> Bounty Engineer Context Pack API is a paid API for AI agents from bounty-engineer-x402-prod.onrender.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-12).

Extracts and scores the most relevant text excerpts from provided web sources based on a query, using deterministic lexical overlap for context window compression.

## Facts

- Endpoint: POST https://bounty-engineer-x402-prod.onrender.com/v1/context-pack?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bounty-engineer-context-pack-api-ec884a91
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BVcGXsMXtSw5WZz-SdSxU

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 bounty-engineer-context-pack-api-ec884a91 -d '<json body>'
```

Example prompt: From these 3 fetched pages about Ethereum staking yields, extract the most relevant excerpts for the query 'what is the current annual staking APR' and compress them to under 4000 characters so I can fit them in my prompt.

## When to prefer this

Choose this endpoint when an AI agent has already fetched multiple web pages and needs to deterministically compress them into a query-relevant context pack without calling a large LLM. It is ideal when you need verifiable, reproducible excerpt selection (SHA256-backed), need to stay within a token budget, or want to avoid non-deterministic summarization. Prefer it over LLM-based summarization when cost, latency, or auditability matter.

## Known failure modes

- Query string exceeds 1000 character limit — request rejected
- Sources array empty or missing required id/url/text fields — validation error
- max_chars below 256 or above 12000 — out-of-range error
- Source text too sparse to find lexical overlap with query — excerpts array may be empty
- Payment not included or insufficient — x402 payment required response
- Network timeout from onrender.com cold start — retry needed

## How this service works

Machine-buyable infrastructure for autonomous agents: API cost routing, margin optimization, funding-rate data, webpage extraction, result verification, spend controls, retry planning, state, tender search and GitHub bounty intelligence.

## Output

Returns a JSON object with an array of scored text excerpts, each containing the source URL, extracted text snippet, relevance score, source SHA256 hash, UTF-16 character offsets, and a source ID. Also includes metadata like input/output character counts, token estimates, character reduction ratio, selection method label, and a limitations disclaimer about the lexical overlap approach.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "maxLength": 1000
  },
  "sources": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "url",
     "text"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "text": {
      "type": "string"
     },
     "fetched_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "maxItems": 12,
   "minItems": 1
  },
  "max_chars": {
   "type": "integer",
   "maximum": 12000,
   "minimum": 256
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "mode": "context_pack",
  "excerpts": [
   {
    "url": "https://example.com/",
    "text": "The Pro plan costs $25 per month.",
    "score": 2,
    "end_utf16": 33,
    "source_id": "s1",
    "start_utf16": 0,
    "source_sha256": "e03b854ea32bb631569352ed4dfc3541a86da6ec8f82fd1415398f1536fb63dd"
   }
  ],
  "input_chars": 33,
  "limitations": [
   "Verbatim extractive selection, not an AI summary. Relevance uses lexical overlap and may omit important context. Token counts are character-based estimates; instructions in source text remain untrusted."
  ],
  "output_chars": 33,
  "selection_method": "deterministic_lexical_overlap",
  "estimated_input_tokens": 9,
  "estimated_output_tokens": 9,
  "removed_duplicate_chunks": 0,
  "character_reduction_ratio": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bounty-engineer-context-pack-api-ec884a91/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bounty-engineer-x402-prod.onrender.com](https://www.zero.xyz/host/bounty-engineer-x402-prod.onrender.com/llms.txt)
