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

# Authentication

> How to authenticate every request with your API key.

Every request authenticates with your API key, sent as a Bearer token:

```text theme={null}
Authorization: Bearer mk_live_xxxxxxxx
```

Create and manage keys in **Settings** on the partner desk. The full key is shown only once at creation and cannot be retrieved later, so save it somewhere secure and keep it secret. A request without a valid key returns `401`.

## Environments

Your key prefix selects the environment:

* `mk_live_` - production
* `mk_test_` - sandbox

The prefix is authoritative: a `mk_test_` key always runs against the sandbox, so a test call can never reach production by accident. The same endpoints serve both; only the key differs.

## Your first request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.marks.finance/api/v2/partners/account \
    -H "Authorization: Bearer mk_test_xxxxxxxx"
  ```

  ```python Python theme={null}
  import requests

  r = requests.get(
      "https://api.marks.finance/api/v2/partners/account",
      headers={"Authorization": "Bearer mk_test_xxxxxxxx"},
  )
  print(r.json()["data"])
  ```

  ```javascript JavaScript theme={null}
  const r = await fetch("https://api.marks.finance/api/v2/partners/account", {
    headers: { Authorization: "Bearer mk_test_xxxxxxxx" },
  });
  const { data } = await r.json();
  console.log(data);
  ```
</CodeGroup>
