Context Pack
Token-budgeted context for an LLM prompt, gathered from the web.
Request
curl -X POST https://api.hushsearch.io/v1/context/ \
-H "X-API-Key: hs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "FastAPI dependency injection with async generators",
"tokens_num": 2000
}'Returns a single context string sized to a token budget, built from the most relevant passages across several sources, with the sources listed separately. Useful for dropping straight into a prompt.
Parameters
| Field | Type | Default | Notes |
|---|---|---|---|
query | string | — | Required. 1–2,000 characters. |
tokens_num | integer or "dynamic" | "dynamic" | Approximate token budget, 50–100,000. |
num_results | integer | 12 | Sources to consider, 1–40. |
category | string | — | Soft hint such as code, docs, github, financial_report. |
Response
{
"query": "how does pgvector HNSW indexing work",
"context": "[1] pgvector adds HNSW indexes …",
"tokens_num": 2048,
"sources": [{ "index": 1, "title": "…", "url": "https://…" }],
"credits_used": 2,
"credits_remaining": 498,
"response_time_ms": 2410
}