# Get account

> Who the credential in the request belongs to, and — for an API key — which scopes it holds and how much of its spending limit is left.

`GET /me`

**Auth:** API key or OAuth token

## Response

### 200 — The authenticated identity

- `data` (required, object)
  - `auth` (required, object)
    - `method` (required, string) — One of: `"api-key"`, `"oauth"`.
    - `apiKey` (object) — Present when authenticated with an API key.
      - `id` (required, string)
      - `keyPreview` (required, string) — Example `"mak_abc...xyz"`.
      - `name` (required, string | null)
      - `scopes` (required, string[])
      - `spending` (required, object)
        - …
  - `userId` (required, string) — Example `"user_01JD8G3W1R5T6Y7U8I9O0P1Q2W"`.

```json
{
  "data": {
    "auth": {
      "method": "api-key",
      "apiKey": {
        "id": "string",
        "keyPreview": "mak_abc...xyz",
        "name": "string",
        "scopes": [
          "generate"
        ],
        "spending": {
          "limit": "string",
          "mode": "limited",
          "period": "day",
          "remaining": "string",
          "used": "string"
        }
      }
    },
    "userId": "user_01JD8G3W1R5T6Y7U8I9O0P1Q2W"
  }
}
```

## Request samples

### cURL

```bash
curl https://api.mynth.io/me \
  -H "Authorization: Bearer $MYNTH_API_KEY"
```

### JavaScript

```ts
const response = await fetch("https://api.mynth.io/me", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.MYNTH_API_KEY}`,
  },
});

const { data } = await response.json();
```

The full schema for this endpoint is in the [OpenAPI document](https://api.mynth.io/openapi.json).
