First bounded request
This first job fetches the latest Hyperliquid core BTC order book, saves it, and stops. Set the key in the agent’s environment, then give it the prompt:Using 0xArchive, fetch the Hyperliquid core BTC order book with depth 1 from GET /v1/hyperliquid/orderbook/BTC. Read the API key from the environment and send it in the X-API-Key header. Make one request, save the response to btc-orderbook.json, print the HTTP status and the request ID, then stop.
jq, which prints the request ID from the saved body.
200 and a request ID, and btc-orderbook.json holds success: true, an order book in data with one bid level and one ask level, and that ID in meta.request_id. On an error, the status is not 200, the file holds the error body, and jq prints its top-level request_id. Check that the path names the venue family and that the symbol was not recased or stripped. A successful first call says nothing about another venue family or data type.
The agent needs three pages for this job: the Hyperliquid REST guide for the route family, the Hyperliquid native L2 endpoint for the exact parameters, and REST authentication for the X-API-Key header.
When the job needs history, make that a second bounded request with explicit Unix-millisecond bounds. This window, the five minutes that ended one hour ago, is inside every plan’s history, including Free’s most recent 30 days:
meta.has_more is true, the response carries meta.next_cursor; log it, and pass it back as cursor with the same bounds for the next page. Add pagination loops, batching, and retries only after one page parses correctly.
Job checklist
Give the agent these fields with every job. If one is missing, the agent should ask rather than guess a venue family, broaden a symbol list, or start calling the API.- Job and stop condition: what to fetch and when to stop, such as “one request, then save and stop”.
- Venue family:
hyperliquid,hyperliquid/hip3,hyperliquid/hip4,hyperliquid/spot, orlighter. This is the REST path prefix after/v1/, and it decides the route. - Symbol:
BTC,xyz:XYZ100for HIP-3,HYPE-USDCfor Spot, or an outcome side such as#0for HIP-4. REST also accepts0and%230for that side; the WebSocket takes only#0. - Output destination: where the result and its request IDs are written, such as a file, a notebook, a warehouse table, or a support case.
start, end, and limit, plus where the cursor is kept.
Pick the interface
- The agent runs shell commands: the CLI for JSON output, or
curlagainst REST as above. - The agent edits and runs application code: an SDK, or a client generated from OpenAPI.
- The agent calls MCP tools: the MCP server, which signs in through the client’s built-in OAuth flow and needs no 0xArchive API key.
- The agent loads Skills (
SKILL.mdworkflows): the Agent skill, for reusable request recipes. - The agent only reads and writes files: docs Markdown and OpenAPI, with the agent writing code for you to run.
Control what the agent can reach
These rules apply to every job, whichever interface runs it.- Routes: the agent takes the venue family from Venue coverage, and the exact path and parameters from OpenAPI or the matching REST page. It never builds a path from a guess.
- Credentials: API keys for REST, SDK, CLI, Agent skill, or WebSocket work stay in the host environment or a secret manager. The hosted MCP server uses OAuth instead. Never paste a key into a prompt, generated source, or a saved response.
- Data check: when the output feeds a backtest, alert, export, dashboard, or model, the agent runs the Data quality checks for the same window and stores the result with the output.
- Payments and wallets: Facilitator covers x402 payment infrastructure and SIWE verification covers wallet-owned account verification. Neither changes routes, schemas, or freshness checks.
Use a different path when
Do not use 0xArchive for venue data outside Hyperliquid and Lighter, wallet transaction history, contract-event indexing, RPC archive reads, transaction submission, order execution, account trading, or broad CEX price coverage. Route benchmark, index, financial-product, standalone or substitute market-data, raw-redistribution, white-label, and OEM uses to Data rights.Recovery rules
401: stop and fix the key source or theX-API-Keyheader.403: read the error body and keep the original scope. Do not switch routes on an assumed upgrade path.404: check the namespace and symbol format in Venue coverage before retrying.429: read theerror_code. Retryrate_limitedwithin a bounded budget, after itsretry_afterseconds when it has one; stop oninsufficient_credits. When you reach a limit has the full rule.- Unsure of the route: ask for the venue family, then use its page in the Endpoint reference.
- Unsure of a field: read the endpoint’s schema in OpenAPI instead of inventing fields.
- Missing or stale quality decision: stop downstream writes and apply the gap policy in Data quality.