# Authentication

Phineus Kitchen uses a password to sign in, and long-lived API tokens for programs and assistants.

## 1. Sign up

```
curl -X POST https://kitchen.phineus.ai/api/users/register \
  -H "Content-Type: application/json" \
  -d '{"username": "sam", "email": "sam@example.org", "fullName": "Sam Cook",
       "password": "a-long-passphrase", "passwordConfirm": "a-long-passphrase"}'
```

A private kitchen is created for you. You may add `"group": "My Kitchen"` to name it.

## 2. Sign in

```
curl -X POST https://kitchen.phineus.ai/api/auth/token \
  -d "username=sam&password=a-long-passphrase"
```

The answer contains `access_token`, a short-lived bearer token (two days). The web app also stores it in the
`kitchen.access_token` cookie.

## 3. Create an API token

Programs should not keep passwords. With the sign-in token, create a named API token:

```
curl -X POST https://kitchen.phineus.ai/api/users/api-tokens \
  -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "my-assistant"}'
```

The answer contains the `token`. It is shown once; store it. You can also create and revoke tokens in the app
under **User profile, API tokens**.

## 4. Use it

Send `Authorization: Bearer <token>` on every API request, and on MCP requests (see [MCP server](/help/mcp)).

Phineus Kitchen is a demo product run for testing. Nothing here is real or paid.
