# Quickstart

> Make your first authenticated calls to the Proxima API, from a health check to listing your wallets.

This guide takes you from nothing to a working, authenticated request in a few minutes. You need a Proxima account
with an active license; create one on [app.proxima.tools](https://app.proxima.tools/) if you do not have one yet.

## 1. Check that the API is reachable

`GET /health` needs no token:

```bash
curl https://api-mig.proxima.tools/health
```

```json
{ "ok": true, "ts": 1767225600000 }
```

## 2. Get a session token

Proxima tokens come from a Turnkey sign-in that you exchange with [`POST /auth/exchange`](/reference/authentication/#exchange-token).
[Authentication](/getting-started/authentication/) walks through the full flow, including how to bind the token to a
license.

Once you have an **upgraded** token, keep it in an environment variable. Every example in this reference reads it
from there:

```bash
export PROXIMA_JWT="eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9…"
```

> **Danger:** The token gives full control of your account, including wallets and funds. Do not paste it into shared terminals,
> commit it or send it to anyone, including Proxima support.

## 3. Confirm who you are

[`GET /auth/me`](/reference/authentication/#retrieve-current-session) returns the user, session and license behind
the token:

**cURL**

```bash
curl https://api-mig.proxima.tools/auth/me \
  -H "Authorization: Bearer $PROXIMA_JWT"
```
**JavaScript**

```js
const response = await fetch("https://api-mig.proxima.tools/auth/me", {
  headers: { Authorization: `Bearer ${process.env.PROXIMA_JWT}` },
});
console.log(await response.json());
```
```json
{
  "user_id": "a91d4e70-2c3b-4f6e-8d15-7b9c0e2f4a68",
  "turnkey_user_id": "e1b7c5a3-9d2f-4b6e-8c4a-3f7d1e9b5a20",
  "role": "PUBLIC",
  "session_id": "3f6c1a2e-8b4d-4c7a-9e21-5d0b7f8a6c13",
  "license_key": "<license_key>"
}
```

If `license_key` is missing, the token is a base token: call [`POST /auth/upgrade`](/reference/authentication/#upgrade-token)
before going further.

## 4. Read the platform constants

[`GET /get-constants`](/reference/platform/#retrieve-constants) describes the chains, launchpads and features that are
live. Read it once at startup instead of hard-coding chain lists:

```bash
curl https://api-mig.proxima.tools/get-constants \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

## 5. List your wallets

Wallet reads are scoped by chain. [`GET /wallets/get/{chain_id}`](/reference/wallets/#list-wallets) lists the wallets
of your license with their balances on that chain:

**cURL**

```bash
curl https://api-mig.proxima.tools/wallets/get/sol \
  -H "Authorization: Bearer $PROXIMA_JWT"
```
**JavaScript**

```js
const response = await fetch("https://api-mig.proxima.tools/wallets/get/sol", {
  headers: { Authorization: `Bearer ${process.env.PROXIMA_JWT}` },
});
const { wallets } = await response.json();
for (const wallet of wallets) console.log(wallet.pubkey, wallet.native_balances.sol);
```
Balances are integer strings in base units: `"1250000000"` lamports is 1.25 SOL. See
[Conventions](/getting-started/conventions/#amounts-and-large-integers).

## 6. Handle errors

Every failure returns `ok: false` with a `code`:

```json
{ "ok": false, "code": "invalid_session", "message": "unauthorized" }
```

A minimal wrapper that turns errors into exceptions:

```js
const API_URL = "https://api-mig.proxima.tools";

export async function proxima(path, { method = "GET", body, headers } = {}) {
  const response = await fetch(`${API_URL}${path}`, {
    method,
    headers: {
      Authorization: `Bearer ${process.env.PROXIMA_JWT}`,
      ...(body ? { "Content-Type": "application/json" } : {}),
      ...headers,
    },
    body: body ? JSON.stringify(body) : undefined,
  });
  const data = await response.json().catch(() => ({}));
  if (!response.ok || data.ok === false) {
    const error = new Error(data.message ?? response.statusText);
    Object.assign(error, { status: response.status, code: data.code, body: data });
    throw error;
  }
  return data;
}

const { wallets } = await proxima("/wallets/get/sol");
```

Some actions can answer `401 2fa_required` when the account protects them with a second factor. Read
[Two-factor step-up](/getting-started/two-factor-step-up/) before automating withdrawals or key exports.

## Next steps

- Browse the [reference](/reference/) by resource, or filter every endpoint by method and path.
- Subscribe to [WebSocket channels](/realtime/websocket/) to receive balance and PnL updates without polling.
- Download the [OpenAPI spec](/openapi.json) to generate a client or import the API into Postman or Insomnia.
