> ## 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.

# SDK installation

> Install 0xArchive SDK packages or use OpenAPI when a language package is unavailable for your runtime.

Use the SDK package that matches your runtime. If your runtime is not listed, use REST, WebSocket, CLI, or generate a client from OpenAPI.

<Tabs>
  <Tab title="TypeScript">
    ```bash theme={"theme":"github-dark"}
    npm install @0xarchive/sdk
    ```
  </Tab>

  <Tab title="Rust">
    ```bash theme={"theme":"github-dark"}
    cargo add oxarchive
    ```
  </Tab>

  <Tab title="Python">
    ```bash theme={"theme":"github-dark"}
    pip install oxarchive
    ```

    Add WebSocket support when the app needs live streams, replay, or gap callbacks.

    ```bash theme={"theme":"github-dark"}
    pip install 'oxarchive[websocket]'
    ```
  </Tab>
</Tabs>

## Environment

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

## Public Package Surfaces

Use the published packages when they match your runtime.

| Runtime                 | Package          | Use it for                                                                                                         |
| ----------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------ |
| TypeScript / JavaScript | `@0xarchive/sdk` | Typed REST helpers, WebSocket client, replay helpers, and reconstruction utilities                                 |
| Rust                    | `oxarchive`      | Async market-data clients; enable the `websocket` feature when the app needs streaming helpers                     |
| Python                  | `oxarchive`      | Sync and async REST helpers, Pydantic models, pagination, optional WebSocket support, and reconstruction utilities |

Source repositories: [sdk-typescript](https://github.com/0xArchiveIO/sdk-typescript) · [sdk-python](https://github.com/0xArchiveIO/sdk-python) · [sdk-rust](https://github.com/0xArchiveIO/sdk-rust).

The package READMEs keep venue clients visible. Hyperliquid core, HIP-3, HIP-4, Spot, and Lighter helpers use runtime-specific namespaces. TypeScript and Python Spot helpers use `client.spot`; Rust Spot helpers use `client.hyperliquid.spot`. HIP-3 and HIP-4 stay under `client.hyperliquid.*` where the installed package exposes those helpers. Use OpenAPI or direct REST when the installed package version does not expose a helper for the route family you need.

The Python package uses `from oxarchive import Client` for REST-shaped workflows and `from oxarchive import OxArchiveWs` when the optional WebSocket extra is installed. The Rust crate is also named `oxarchive`; enable its `websocket` feature when stream helpers belong in the Rust application.

## Package Truth Checklist

Record package truth before adding an SDK dependency or asking an agent to edit install docs.

| Field             | Capture                                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------------------ |
| Runtime           | TypeScript/JavaScript, Python, Rust, or another language                                               |
| Package name      | `@0xarchive/sdk`, `oxarchive`, or generated OpenAPI client name                                        |
| Install command   | `npm install`, `pip install`, `cargo add`, or codegen command                                          |
| Optional features | Python `websocket` extra, Rust `websocket` feature, or TypeScript WebSocket helpers                    |
| Source            | Package registry page, repository README, package manifest, generated OpenAPI source, or release notes |
| First request     | One authenticated order-book or freshness call with request-ID logging                                 |

## Choosing A Package

Choose an SDK when it reduces application code: shared auth, typed request options, WebSocket helpers, or reconstruction utilities. Use REST directly when a runtime only needs a few calls or when a package is not part of the current first-party surface. Use OpenAPI code generation when you need a typed client in another language and want the contract to come from the pinned REST spec.

## Install Discipline

Keep SDK versions explicit in application repositories and review release notes before changing clients that run production jobs. A market-data client can fail quietly if a response envelope, pagination helper, or decimal parsing behavior changes. Keep `meta.request_id` available to callers even when the SDK wraps the response in a typed object.

## Install Checklist

Before merging an SDK dependency, record the package name, public registry source, version pin, runtime, and enabled features. For Rust, note whether the `websocket` feature is enabled. For TypeScript, note whether the app uses REST helpers, `OxArchiveWs`, reconstruction utilities, or all three. For Python, note whether the `websocket` extra is installed. For generated clients, record the OpenAPI source file or URL used to generate the package.

Run one narrow authenticated request after installation: Hyperliquid `BTC` order book is a good smoke test because it confirms auth, base URL, response parsing, and request metadata. Do not widen into historical pulls, replay, or reconstruction until that first call can log the route family and request ID.

## Runtime Notes

Node-based tooling such as CLI and MCP Server is a separate product surface from an application SDK. Use the CLI for shell jobs and CI. Use the MCP Server for MCP-capable hosts. Use the SDK when the market-data call belongs inside application code.

## Review Rule

Installation docs should not imply an SDK exists for a language unless the package surface is real. If a language package is absent, route users to REST, WebSocket, CLI, or OpenAPI code generation instead of inventing package names. When a package is listed, include the package name, install command, import shape, optional WebSocket behavior, and first-request smoke test.
