Build a bounded HIVE research integration
Use the catalog, a scoped key, a server quote and an idempotent execution request. Preserve provenance and explicit unknowns.
Download the public Python and JavaScript examples, sandbox instructions and read-only external AI integration. The examples never buy credits or grant commercial access.
Start in the nonmonetary sandbox
Create a test-only account through the customer dashboard. Save the one-time owner and recovery keys securely. Issue a scoped research key with an explicit wallet mode and spending limits. A recovery key is not an ordinary research credential, and an API key does not verify an email address or legal identity.
Discover actual coverage
Inspect the v4 catalog, OpenAPI and source timestamps before choosing a domain. A supported adapter does not imply a complete or freshly collected source. The existing private pilot remains separate from v4 sandbox and test wallets.
JavaScript quote and execute example
const base = "https://hive.jtimphony.workers.dev";
const key = process.env.HIVE_RESEARCH_KEY;
const headers = {"Authorization": "Bearer " + key,
"Content-Type": "application/json"};
const quoteResponse = await fetch(base + "/v4/quotes", {
method: "POST", headers,
body: JSON.stringify({mode:"sandbox", service:"basic",
domains:["grants"], query:"education", limit:5})
});
if (!quoteResponse.ok) throw new Error("Quote refused");
const quote = await quoteResponse.json();
const response = await fetch(base + "/v4/research", {
method:"POST", headers,
body:JSON.stringify({quote_id:quote.quote_id,
max_units:quote.price_units,
idempotency_key:crypto.randomUUID()})
});
if (!response.ok) throw new Error("Research refused");
console.log(await response.json());Python quote and execute example
import json, os, urllib.request, uuid
base = "https://hive.jtimphony.workers.dev"
def post(path, body):
request = urllib.request.Request(base + path,
data=json.dumps(body).encode("utf-8"), method="POST",
headers={"Authorization": "Bearer " + os.environ["HIVE_RESEARCH_KEY"],
"Content-Type": "application/json"})
with urllib.request.urlopen(request, timeout=15) as response:
return json.load(response)
quote = post("/v4/quotes", {"mode":"sandbox", "service":"basic",
"domains":["grants"], "query":"education", "limit":5})
result = post("/v4/research", {"quote_id":quote["quote_id"],
"max_units":quote["price_units"],
"idempotency_key":str(uuid.uuid4())})
print(result)Generate and securely retain an idempotency key for each logical execution before sending it; reuse that same key when retrying a transport failure. Do not generate a fresh key for an uncertain prior charge. These examples omit a production retry store, which the integrating application must supply. Keep bearer keys out of query strings, logs, prompts and committed source.
Interpret outcomes
Read request identifiers, wallet mode, source observation times, citations, source claims, confidence basis and limitations. Source/provenance verification means checking the published record identity and traceability; it does not independently establish every claim as true. A machine-readable quote is spending authorization only for its accepted scope, not permission to buy an external service.
Handle authentication denial, exhausted quotas, insufficient credits, expired quotes, unavailable sources and request reversals explicitly. Avoid retry storms. Deep or comprehensive work may be rejected until delivery and unit economics are qualified.
MCP and agent commerce
Use the MCP integration guide and machine catalog for the actual compatibility level. An agent must have a scoped, revocable customer key and remain within the authorized credit ceiling. No cryptocurrency, x402 payment acceptance or additional payment provider is activated by these examples.