# Authentication

> One API key for REST and MCP.

Page: https://doxtract.manoonlabs.com/docs/api/authentication

Create a key on [API Keys](https://doxtract.manoonlabs.com/settings/developer). The full secret is shown once; later the console shows its prefix. Send it on every call as `Authorization: Bearer <key>` or `x-api-key: <key>`.

**Header**

```text
Authorization: Bearer mldxt_...
```

The key acts as the workspace it belongs to. Authenticated calls are listed in [Plan](https://doxtract.manoonlabs.com/plan) for the period, and each call updates the key's last used time.

## Base URL and bodies

- Base URL: `https://doxtract.manoonlabs.com`
- POST and PATCH bodies are JSON objects with `Content-Type: application/json`. DELETE takes no body.
- `POST /api/v1/parse` and `POST /api/v1/upload/{inbox_id}` also take `multipart/form-data`, so curl can upload with -F.
- An unknown key returns 400 `Unexpected key`, a missing one 400 `Missing key`, and invalid JSON 400 `Request body must be JSON`.
- GET and DELETE routes read their input from the path and the query string.
- Keys are created and revoked in the console. Schemas are deleted there too. Inboxes and documents can be deleted with the API.

## Check your key

### Identity

`GET /api/v1/whoami`

Return the workspace and token for this bearer key, and the credits left this month.

- There is no request body.
- credits_remaining is the credits left this month. It does not change the balance.
- Use this to confirm a key before you parse.

**Request**

```bash
curl -X GET https://doxtract.manoonlabs.com/api/v1/whoami \
  -H "Authorization: Bearer mldxt_..."
```

**Response**

```json
{
  "status": "ok",
  "workspaceId": "cm7workspace",
  "tokenId": "cm7token",
  "credits_remaining": 59
}
```
