Skip to main content
Download the REST API specification to generate a typed client, validate requests and responses, or give a coding agent the exact routes.

Save the specification

This saves the JSON specification as openapi.json in your current directory. Downloading the specification is public. For authenticated REST requests, send your key in the X-API-Key header; each operation declares its security requirements. See Authentication for key setup and public-route exceptions. The specification covers REST routes. WebSocket commands and channels have a separate contract.

Generate a TypeScript client

Use Node.js 22.18 or newer and the downloaded openapi.json in a local Node project. For a new project, run npm init --yes first. These commands use Hey API’s Fetch client generator:
The generated methods, types, and Fetch client are written to src/client. The parser override selects a patched YAML dependency for the generator. Keep these tooling versions and your project lockfile with the specification when reproducing the client.
Save this as health.ts. The public /health route lets you check the generated client without using an API key.
health.ts
In a standalone project, compile and run it with:
A successful response contains service: "0xarchive-api" and status: "ok". In an existing application, use your project’s TypeScript configuration instead of this standalone compile command.
For protected operations, configure client.setConfig({ auth: () => apiKey }), where apiKey comes from your server’s secret configuration. The generated client uses the X-API-Key security header, not Bearer authentication. Keep private keys on your server, not in browser code.

Integration checks

  • Route and venue: Choose the method, path, and venue family in Endpoint reference. Hyperliquid core, Spot, HIP-3, HIP-4, Lighter, and Lighter on Robinhood Chain have distinct routes and symbol formats.
  • Parameters and time bounds: Read the route’s symbol format, filters, request limits, and time-window rules. Use Venue coverage when choosing a historical window.
  • Authentication and responses: Set X-API-Key for protected routes and handle the documented responses and the error codes on Errors. Keep the response envelope rather than assuming every route returns a bare array.
  • Pagination: Follow the route’s pagination rules, including meta.next_cursor where provided. Validate one bounded request, for example in the API playground, before expanding the workload.
  • Schemas: Inspect the operation and component JSON schemas in Schemas when code generation or validation needs them.
For coding-agent route selection, use the Coding agents guide. For maintained SDKs, CLI, MCP, or other execution choices, see Choose an interface.

Versions and troubleshooting

Keep the downloaded specification alongside your generated client so the same input can reproduce that client. When refreshing it, compare the routes and schemas your application uses, regenerate the client, and run your integration checks. The specification version above comes from the JSON contract; this article’s modification date is not an API version.
Endpoint reference uses the specification bundled with these docs. The docs host serves that JSON directly and keeps semantic parity with https://0xarchive.io/openapi.json.If a route differs between the JSON and its reference page, use the public JSON contract for code generation. Contact 0xArchive with the method, path, specification version, and request ID when available so the discrepancy can be checked.

Next step

Browse every route with its parameters, authentication, and examples in the Endpoint reference.
Last modified on October 6, 2026