> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding Agents

> Use 0xArchive safely inside Claude Code, Codex, Cursor, Windsurf, Copilot, Gemini CLI, and similar coding-agent hosts.

Coding agents need route map, symbol rules, auth handling, tooling setup, and recovery paths before they generate requests against 0xArchive. The safest path is to make the agent name the job, venue family, symbol, time window, execution surface, and quality gate before it writes code.

The core distinction: Claude Code, Codex, Cursor, Windsurf, Copilot, Gemini CLI, Devin, OpenCode, and similar products are coding-agent hosts. OpenClaw is a harness/runtime. MCP Server, CLI, SDKs, OpenAPI, docs Markdown, `llms.txt`, and Skills are reusable context or tool surfaces.

## Choose The Surface

| User environment                  | Use this 0xArchive surface                                                                 | Good first action                                                                        |
| --------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
| Web LLM                           | Docs pages, `.md` routes, `llms.txt`, OpenAPI excerpts                                     | Ask it to cite the route family before writing code                                      |
| Coding agent with repo access     | OpenAPI and docs Markdown first; CLI, SDK, MCP, or Skill as needed                         | Give it the exact job, venue, symbol, and time window                                    |
| Coding agent with terminal access | CLI or SDK, plus OpenAPI for route map                                                     | Run one bounded request and inspect JSON before expanding                                |
| Automation script                 | REST, SDK, CLI JSON                                                                        | Store the interface-specific key variable in the environment                             |
| MCP-capable host                  | MCP Server                                                                                 | Configure `OXARCHIVE_API_KEY` in the host secret or environment store                    |
| Skill-capable host                | Skill / `SKILL.md` package                                                                 | Load reusable route rules and shell-backed request patterns                              |
| Generated client                  | Pinned `openapi.json`                                                                      | Generate routes from the spec, then add data-quality gates                               |
| OpenClaw harness                  | Skill for simple OpenClaw use; ACP for external coding agents; MCP bridge only when needed | Choose the OpenClaw path first, then pass 0xArchive context through the matching surface |

## Why 0xArchive Fits

0xArchive gives agents exact route families and schemas instead of asking them to infer product behavior. A coding agent can read OpenAPI for `/v1/hyperliquid/orderbook/BTC`, use [Venue Coverage](/venue-coverage) to keep HIP-3 and HIP-4 separate, use [Authentication](/authentication) for `X-API-Key`, and use [Errors](/errors) to preserve `meta.request_id`.

## Minimum Job Packet

Give the agent a small packet before it generates a client, script, or workflow:

| Field               | Example                                                                                                  | Why it matters                                                        |
| ------------------- | -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Job                 | "Pull historical trades for a backtest"                                                                  | Selects REST, WebSocket, CLI, SDK, MCP Server, Skill, or Data Catalog |
| Venue family        | `hyperliquid`, `hyperliquid/hip3`, `hyperliquid/hip4`, `hyperliquid/spot`, or `lighter`                  | Prevents route-family guessing                                        |
| Symbol              | `BTC`, `km:US500`, `%230`, `HYPE-USDC`, or `BTC` on Lighter                                              | Keeps symbol parsing explicit                                         |
| Window              | `start`, `end`, `limit`, and cursor behavior                                                             | Keeps historical output reproducible                                  |
| Execution surface   | REST, CLI, SDK, MCP Server, Skill, or OpenAPI codegen                                                    | Keeps setup instructions tied to the host                             |
| Response contract   | Endpoint-specific OpenAPI schema, WebSocket message schema, export schema, or data-quality coverage body | Prevents universal-envelope assumptions                               |
| Quality requirement | status, coverage, incident, latency, or SLA preflight                                                    | Prevents silent use of stale or interrupted windows                   |

## First Bounded Request

For a terminal-capable agent, start with one request and inspect the response before adding loops, storage, or models.

```bash theme={"theme":"github-dark"}
export OXARCHIVE_API_KEY="0xa_your_api_key"

curl "https://api.0xarchive.io/v1/hyperliquid/trades/BTC?start=2026-01-01T00:00:00Z&end=2026-01-01T01:00:00Z&limit=100" \
  -H "X-API-Key: $OXARCHIVE_API_KEY"
```

The agent should log the route, query parameters, status code, cursor if present, and `meta.request_id` when the response exposes it. If the next step is a backtest, alert, export, dashboard, or model input, run a [Data Quality](/data-quality) check for the same venue, symbol, and window before widening.

## Use A Different Path When

Do not use 0xArchive tooling surfaces for unsupported venue data, wallet indexing, contract-event search, RPC infrastructure, transaction submission, or account execution.

Do not paste real keys into prompts. Put keys in the host environment, secret store, or local process configuration.

## Expansion Order

<Steps>
  <Step title="Confirm the route family">
    Use [Venue Coverage](/venue-coverage) and OpenAPI before creating route helpers.
  </Step>

  <Step title="Run one small request">
    Inspect JSON shape, endpoint-specific response contract, pagination fields, and request ID before adding storage or loops.
  </Step>

  <Step title="Add the quality decision">
    Store the coverage or incident result with downstream output when the job feeds analysis or production behavior.
  </Step>

  <Step title="Choose the durable surface">
    Keep shell jobs in CLI, tool-calling hosts in MCP Server, reusable host instructions in Skill, application code in SDKs, and route generation in OpenAPI.
  </Step>
</Steps>

## Agent Recovery Rules

<AccordionGroup>
  <Accordion title="Route uncertainty">
    Ask for the venue family before calling a route. Use Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter, then pick the generated reference endpoint.
  </Accordion>

  <Accordion title="Schema uncertainty">
    Read OpenAPI instead of inventing fields. Generated clients should keep `meta.request_id` in logs and errors.
  </Accordion>

  <Accordion title="Data freshness uncertainty">
    Add a data-quality preflight for backtests, alerts, exports, and model inputs.
  </Accordion>

  <Accordion title="Tooling uncertainty">
    Use REST or OpenAPI as the fallback. Add CLI, SDK, MCP, or Skill instructions only when the host and local setup support that surface.
  </Accordion>
</AccordionGroup>

## Next Step

Open [Choose An Interface](/tooling) for the host/harness/surface matrix, [AI And Coding Agents](/ai-clients) for prompt patterns, and [CLI](/cli) for JSON workflows.
