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

# Get started

> Connect your own tools to your Hypernova accounts, create an API key and make your first call.

A journal, a dashboard or a trading bot can read your balances, positions, orders and trade history, place and cancel orders, close positions and set leverage, under the same rules as the app.
To follow an account as it changes, open one [real-time stream](https://hypernova.xyz/docs/api/streaming.md) instead of polling.
API access is in pilot: if you don't see **API Keys** in Settings, your account is not enabled yet.

## Base URL

```
https://hypernova.xyz/api/v1
```

This is the base URL for production keys.
A test environment for `hn_test_` keys is available on request through the [Hypernova Discord](https://discord.gg/PBvZbvRTrN).

## Quickstart

**1. Create a key**

In the app, open **Settings → API Keys**, give the key a label, choose **read** to start, and copy the key. It is shown once.

**2. Make your first call**

Every endpoint is an HTTPS POST with a JSON body and your key as a bearer token.

> [tab] curl
>
> ```bash theme={null}
> export HN_API_KEY="hn_live_…"
>
> curl -sS -X POST "https://hypernova.xyz/api/v1/ListAccounts" \
>   -H "Authorization: Bearer $HN_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{}'
> ```

> [tab] Python
>
> ```python theme={null}
> import os
> import requests
>
> resp = requests.post(
>     "https://hypernova.xyz/api/v1/ListAccounts",
>     headers={"Authorization": f"Bearer {os.environ['HN_API_KEY']}"},
>     json={},
>     timeout=15,
> )
> resp.raise_for_status()
> print(resp.json())
> ```

> [tab] Node.js
>
> ```javascript theme={null}
> const resp = await fetch("https://hypernova.xyz/api/v1/ListAccounts", {
>   method: "POST",
>   headers: {
>     Authorization: `Bearer ${process.env.HN_API_KEY}`,
>     "Content-Type": "application/json",
>   },
>   body: "{}",
> });
> console.log(await resp.json());
> ```

You get your accounts, newest first. Pass an `accountId` from the answer to every endpoint whose body names an account. ListAccounts, ListMarkets and StreamAccountEvents take none, and answer `invalid_argument` if you send one. See [ListAccounts](https://hypernova.xyz/docs/api/accounts.md#listaccounts).

**3. Trade on a demo account**

Create a write key the same way and start with [PlaceOrder](https://hypernova.xyz/docs/api/place-order.md) on a demo account, which trades against real prices with no money at stake.
A key reaches a demo account only during the pilot. Once the API is fully live, a call that names one answers `permission_denied`, kind `DEMO_VIA_API_KEY`, and a key whose owner has only ever held demo accounts answers `unauthenticated`, kind `ACCOUNT_REQUIRED`.
Cancel the orders a key left resting on a demo account before then: they keep working afterwards, and only the app can then read or cancel them.
Neither means the key is broken, so do not replace it: place your test orders in the test environment instead, which you can ask for in the [Hypernova Discord](https://discord.gg/PBvZbvRTrN).

Every other endpoint is called the same way, at `{base}/<Endpoint>`: the endpoint pages show only the JSON body.
[StreamAccountEvents](https://hypernova.xyz/docs/api/streaming.md) is the one exception, with a framing of its own.

Runnable Python and Node.js examples, a first call and a stream reader with no dependencies, are in [hypernova-core/hypernova-api](https://github.com/hypernova-core/hypernova-api).

## Accounts and automation

The API reaches Assessment and funded accounts, and demo accounts during the pilot only.
Every call acts as the user who owns the key, sees only that user's accounts, and is subject to the same rules as the app.

> [!WARNING]
>
> **Automated trading is permitted on your own accounts, including through this API.** Every prohibited-conduct rule applies the same way to orders placed through the API as to orders placed by hand.
> Rulebook [section 13](https://hypernova.xyz/docs/rulebook.md#13-what-is-not-restricted) and [section 14](https://hypernova.xyz/docs/rulebook.md#14-prohibited-conduct) set the rules.
>
> * An automated strategy you build and operate yourself may trade one or more of your own accounts.
> * A third-party platform may hold an API key you create, to run your own strategy for you. You stay responsible for every order placed with that key.
> * Giving a key to another person so they can trade your account is sharing account credentials, which the Rulebook prohibits.

## API keys

Create and revoke keys in the app under **Settings → API Keys**, and send the key on every request as `Authorization: Bearer hn_live_…`.

| Scope | Can call |
| - | - |
| **read** | ListAccounts, ListMarkets, GetAccountSnapshot, ListOpenOrders, ListOrderHistory, ListTrades, ListFundingPayments, ListLeverage, StreamAccountEvents |
| **write** | Everything in read, plus PlaceOrder, SetLeverage, CancelOrder, CancelAllOrders, ClosePosition and CloseAllPositions |

* A request without a key, with a malformed or revoked key, or with a key of the wrong scope is refused before it reaches an account. A read key on a write endpoint answers `permission_denied`.
* A key is shown once, at creation. You can hold up to five live keys, and a revoked key fails on its next call.
* In **Settings → Account → Sign out of all**, **Sign out everywhere** ends your sessions and leaves your keys working. If a key may have leaked, choose **Sign out and revoke all API keys**, which ends every session and revokes every key together.
* When we detect a stolen session we end it and try to revoke your keys, and a key can stay live if that second step fails. Use **Sign out and revoke all API keys** to finish the recovery.
* After a revocation a running bot gets `unauthenticated` on every call until it is given a new key, and its resting orders stay on the book.
* Production keys start with `hn_live_`, test keys with `hn_test_`. Each environment keeps its own keys, so a key from one is unknown to the other.
* Rate limits are per user, shared across all of your keys, so a second key does not buy more throughput. See [Rate limits](https://hypernova.xyz/docs/api/conventions.md#rate-limits).

> [!WARNING]
>
> A write key can open and close positions. Keep keys on a server, never in a browser, a mobile app or a public repository, and revoke a key as soon as you stop using it.

## Not available yet

| Feature | Today |
| - | - |
| **Batch placement** | Place one order per call. Each call spends one write. |
| **Modify an order** | Cancel it and place a new one. |
| **Post-only orders** | Not accepted by PlaceOrder. Orders placed in the app may still carry the field. |
| **Market data and candles** | Read them from Hyperliquid's public API under each market's `hyperliquidCoin`. See [Market data](https://hypernova.xyz/docs/api/accounts.md#market-data). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.