Context Pack
Select query-relevant verbatim excerpts under a character budget, deduplicate chunks and preserve source offsets for retrieval workflows.
1 credit per call · $0.01 USDC with x402
Sample input
{
"query": "Pro plan price",
"sources": [
{
"id": "s1",
"url": "https://example.com",
"text": "The Pro plan costs $25 per month."
}
],
"max_chars": 1000
}Worked sample output
{
"ok": true,
"mode": "context_pack",
"excerpts": [
{
"source_id": "s1",
"url": "https://example.com/",
"source_sha256": "e03b854ea32bb631569352ed4dfc3541a86da6ec8f82fd1415398f1536fb63dd",
"start_utf16": 0,
"end_utf16": 33,
"text": "The Pro plan costs $25 per month.",
"score": 2
}
],
"input_chars": 33,
"output_chars": 33,
"removed_duplicate_chunks": 0,
"character_reduction_ratio": 0,
"estimated_input_tokens": 9,
"estimated_output_tokens": 9,
"selection_method": "deterministic_lexical_overlap",
"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."
]
}Worked example using published sample data only. Own-data execution is paid.
Connect in curl
Set BOUNTY_API_KEY privately after your payment is verified. Change the retry key for each new logical request.
curl 'https://bounty-engineer-x402-prod.onrender.com/v1/prepaid/context-pack' \
-H "Authorization: Bearer $BOUNTY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: workflow-request-001' \
-H 'X-Max-Credits: 1' \
--data '{"query":"Pro plan price","sources":[{"id":"s1","url":"https://example.com","text":"The Pro plan costs $25 per month."}],"max_chars":1000}'Connect in n8n
Download the inactive n8n template. Import it, configure the private Header Auth credential, inspect the sample and run it manually. A new execution creates a new billable request; there is no automatic schedule.
Use an HTTP POST to https://bounty-engineer-x402-prod.onrender.com/v1/prepaid/context-pack. Send JSON and these headers; store the Bearer token as a private credential.
{
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_PRIVATE_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "UNIQUE_PER_LOGICAL_REQUEST",
"X-Max-Credits": "1"
},
"body": {
"query": "Pro plan price",
"sources": [
{
"id": "s1",
"url": "https://example.com",
"text": "The Pro plan costs $25 per month."
}
],
"max_chars": 1000
}
}Reuse a retry key only for the same input. Failed execution returns reserved credits. Full integration and recovery guide · Machine-readable recipe