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

# List API keys

> List all active API keys for your account

## Authentication

Requires `x-auth-token` and `x-device-id` headers. Obtain these by calling the [login endpoint](/api-reference/user/login).

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://relay.bayse.markets/v1/user/me/api-keys \
    -H "x-auth-token: YOUR_AUTH_TOKEN" \
    -H "x-device-id: YOUR_DEVICE_ID"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://relay.bayse.markets/v1/user/me/api-keys', {
    headers: {
      'x-auth-token': 'YOUR_AUTH_TOKEN',
      'x-device-id': 'YOUR_DEVICE_ID',
    },
  });
  const { keys, total } = await response.json();
  ```

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

  resp = requests.get(
      'https://relay.bayse.markets/v1/user/me/api-keys',
      headers={
          'x-auth-token': 'YOUR_AUTH_TOKEN',
          'x-device-id': 'YOUR_DEVICE_ID',
      },
  )
  data = resp.json()
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://relay.bayse.markets/v1/user/me/api-keys", nil)
  req.Header.Set("x-auth-token", "YOUR_AUTH_TOKEN")
  req.Header.Set("x-device-id", "YOUR_DEVICE_ID")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

<ResponseField name="keys" type="array">
  List of API key objects.

  <Expandable title="key fields">
    <ResponseField name="id" type="string">
      Unique identifier for the key.
    </ResponseField>

    <ResponseField name="name" type="string">
      Label assigned at creation.
    </ResponseField>

    <ResponseField name="publicKey" type="string">
      The public key (`pk_*`).
    </ResponseField>

    <ResponseField name="secretKeyHint" type="string">
      Partial hint of the secret key for identification. The full secret key is never returned after creation.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 creation timestamp.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of active keys.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "keys": [
      {
        "id": "3f7a1b2c-d4e5-6789-abcd-ef0123456789",
        "name": "Trading bot",
        "publicKey": "pk_live_abcdef123456",
        "secretKeyHint": "sk_live_...xyz",
        "createdAt": "2026-02-17T10:30:00Z"
      }
    ],
    "total": 1
  }
  ```
</ResponseExample>
