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

# Quickstart

> Authenticate against MESO and generate your first unit plan.

## 1. Get a token

MESO uses [Supabase Auth](https://supabase.com/docs/guides/auth). Every request
carries a user access token as a bearer credential. There are no long-lived API
keys.

```bash theme={null}
curl -X POST "$MESO_SUPABASE_URL/auth/v1/token?grant_type=password" \
  -H "apikey: $MESO_ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@school.ie","password":"..."}'
```

The response contains an `access_token`. That is your bearer token.

## 2. Call a capability

```bash theme={null}
curl -X POST "$MESO_FUNCTIONS_URL/unit-planning" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Science",
    "topic": "Photosynthesis",
    "learningOutcomes": ["1.1", "1.5"],
    "yearGroup": "2",
    "lessonsCount": 6,
    "assessment": {
      "method": "Investigation",
      "timing": "End of unit",
      "category": "Formative"
    },
    "lessonLength": 40,
    "mode": "fast"
  }'
```

## 3. Read the response

Every capability returns the same envelope:

```json theme={null}
{ "success": true, "data": { "...": "capability-specific payload" } }
```

On failure:

```json theme={null}
{ "success": false, "error": "Unauthorized" }
```

> [!TIP]
>
> `mode` is worth knowing early. `fast` (the default) runs a single-pass flow.
> `detailed` runs the slower multi-agent flow that the product surfaces as
> **MESO Think**.

## Next steps

> [card] [Authentication in depth](https://docs.mesolab.ai/authentication.md)

> [card] [Error contract](https://docs.mesolab.ai/api-reference/errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.