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

# SDK Compatibility

> Use existing Hyperliquid SDKs (nomeida/hyperliquid for JS, hyperliquid-python-sdk for Python) against GoldRush by overriding the base URL and injecting an Authorization header.

The most popular Hyperliquid SDKs work against GoldRush after a one-line `baseUrl` override and adding an `Authorization` header.

## JavaScript / TypeScript: [`nomeida/hyperliquid`](https://github.com/nomeida/hyperliquid)

### Install

<CodeGroup>
  ```bash npm theme={null}
  npm install hyperliquid
  ```

  ```bash yarn theme={null}
  yarn add hyperliquid
  ```
</CodeGroup>

### Configure

```typescript theme={null}
import { Hyperliquid } from "hyperliquid";

const sdk = new Hyperliquid({
  // Point at GoldRush
  baseUrl: "https://hypercore.goldrushdata.com",
  // Inject the Authorization header on every request
  headers: {
    Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,
  },
});

// Existing methods work unchanged
const ctxs = await sdk.info.metaAndAssetCtxs();
const account = await sdk.info.clearinghouseState({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
const spot = await sdk.info.spotClearinghouseState({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
const orders = await sdk.info.frontendOpenOrders({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
```

<Note>
  If your SDK version doesn't expose a `headers` option, wrap `fetch` to inject the header globally before instantiating the SDK. See the patch pattern below.
</Note>

### Header injection fallback

```typescript theme={null}
const originalFetch = globalThis.fetch;
globalThis.fetch = (input, init = {}) => {
  const headers = new Headers(init.headers);
  if (typeof input === "string" && input.startsWith("https://hypercore.goldrushdata.com")) {
    headers.set("Authorization", `Bearer ${process.env.GOLDRUSH_API_KEY}`);
  }
  return originalFetch(input, { ...init, headers });
};
```

## Python: [`hyperliquid-dex/hyperliquid-python-sdk`](https://github.com/hyperliquid-dex/hyperliquid-python-sdk)

### Install

```bash theme={null}
pip install hyperliquid-python-sdk
```

### Configure

```python theme={null}
import os
from hyperliquid.info import Info

# Point Info at GoldRush
info = Info(base_url="https://hypercore.goldrushdata.com", skip_ws=True)

# Inject the Authorization header on the underlying session
info.session.headers.update({
    "Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"
})

# Existing methods work unchanged
ctxs = info.meta_and_asset_ctxs()
account = info.user_state("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
spot = info.spot_user_state("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
orders = info.frontend_open_orders("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
```

<Tip>
  `skip_ws=True` is recommended when using the Info API only - it skips the WebSocket connection that the SDK opens by default to upstream Hyperliquid. For real-time event streams, use the [GoldRush Streaming API](/goldrush-streaming-api/overview) instead.
</Tip>

## Verification

After cutover, confirm everything is wired correctly:

1. **Diff a known wallet** - call `clearinghouseState` for the same wallet against both endpoints; the JSON shape (keys, nesting, types) should match exactly.
2. **Confirm auth** - remove the API key and confirm you get a `401` with body `{"error":"unauthorized"}`. If you get any other response, your request isn't reaching GoldRush.

## Other SDKs

The pattern is the same for any HTTP client: override the base URL to `https://hypercore.goldrushdata.com` and attach `Authorization: Bearer <GOLDRUSH_API_KEY>`. If you run into a specific SDK that doesn't expose either knob, [email us](mailto:support@covalenthq.com) - we'll publish a recipe.
