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

# Quickstart

> Set up Faces with your agent, or by hand: create a face, compile a document, and ask it what it would do.

# Quickstart

## With your agent

Paste this into your coding agent, whether Claude Code, Codex, Cursor or any other that takes
skills. Or read the skill first, at [faces-sh/skill](https://github.com/faces-sh/skill).

```text theme={null}
Set up Faces for me:
1. Run `npx skills add faces-sh/skill -g -y`. If it doesn't detect you, add `-a <your agent>`, e.g. `-a claude-code`.
2. Follow references/QUICKSTART.md in the faces skill: install the faces CLI, then sign me in, take my API key, or help me sign up here in this session or in a browser at faces.sh.
3. Explain my `me` face to me, and help me edit its details. In Claude Code the slash commands only load after a restart, so then tell me to type /exit and relaunch with `claude --continue` to pick this session back up.
4. Explain the Faces platform to me in one sentence and ask what I want to do next.
```

## By hand

The rest of this page walks through the API directly: register an account, create a face,
upload a source document, compile it, and ask the face what it would do.

## Prerequisites

* API base URL: `https://api.faces.sh`
* Replace `YOUR_API_KEY` with a real key obtained in step 2.

***

## 1. Register

> [!NOTE]
>
> If you already have an account, skip to step 2.

Register with email and password:

```bash theme={null}
curl -X POST https://api.faces.sh/auth/register-email \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alice",
    "email": "alice@example.com",
    "password": "Your-secure-password-1",
    "username": "alice"
  }'
```

`name` and `username` are optional: without a `username`, one is made from the email. The password needs 8 to 64 characters, with at least one uppercase letter, one lowercase letter and one digit.

```json theme={null}
{
  "success": true,
  "messages": [],
  "data": {
    "token": "eyJ...",
    "user_id": "311d4676-effb-4b20-...",
    "activation_required": true,
    "activation_checkout_url": "https://checkout.stripe.com/c/pay/cs_..."
  },
  "error": null,
  "meta": null
}
```

Use `data.token` as a Bearer token for subsequent requests, or create an API key (step 2).

> [!WARNING]
>
> A new account starts with a \*\*$0 balance**, so compiling and asking a face answer `402` until it has credit. Open `activation_checkout_url` to add your first $5 (you can choose more on the payment page). See [Billing](https://docs.headwaters.ai/guides/billing.md).

***

## 2. Create an API key

API keys are created with the JWT from step 1. An API key cannot create, list or change keys.

```bash theme={null}
curl -X POST https://api.faces.sh/v1/auth/api-keys \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-app"}'
```

```json theme={null}
{
  "id": "a1b2c3d4-...",
  "key": "sk-faces-...",
  "key_prefix": "sk-faces-abc12345",
  "name": "my-app"
}
```

Store this key. All examples below use `YOUR_API_KEY`.

***

## 3. Create a face

Your account already has one face, **`me`**: it is you, created with the account. Compile
your own writing into it to make a face of yourself. See [Your `me` face](https://docs.headwaters.ai/guides/people#your-me-face).
For this walkthrough, make a new one:

```bash theme={null}
curl -X POST https://api.faces.sh/v1/faces \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "alias": "alice",
    "name": "Alice",
    "basic_facts": {"age": "30", "gender": "woman", "location": "Berlin, Germany"}
  }'
```

```json theme={null}
{
  "alias": "alice",
  "object": "face",
  "name": "Alice",
  "basic_facts": {
    "age": {"value": "30", "status": "stated", "identification": "user-provided"},
    "gender": {"value": "woman", "status": "stated", "identification": "user-provided"},
    "location": {"value": "Berlin, Germany", "status": "stated", "identification": "user-provided"}
  },
  "compiled": false
}
```

***

## 4. Upload a source document

Upload a plain-text file the face wrote, such as an essay or a journal. Say what kind of writing it is with `medium`: it is required, and a document without one is refused with `422`:

```bash theme={null}
curl -X POST "https://api.faces.sh/v1/faces/alice/upload?medium=essay&perspective=first-person" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@alice_journal.txt"
```

`medium`, `perspective` and `type` are query parameters, not form fields. `medium` is what the text is, one of the 25 names [`GET /v1/media`](https://docs.headwaters.ai/guides/media) lists (`essay`, `email`, `speech`, `journal entry`, ...). `perspective` is `first-person` when the face wrote the text and `third-person` (the default) when it is about the face.

```json theme={null}
{
  "document_id": "5a8fa752-62cd-4cbb-bb6f-...",
  "alias": "alice",
  "label": "alice_journal.txt",
  "medium": "essay",
  "perspective": "first-person",
  "token_count": 347,
  "status": "not_compiled",
  "progress": 0.0,
  "compilable": true,
  "type": "document",
  ...
}
```

You can also upload PDF and Word (`.docx`) files, audio, or video; see [Faces guide](https://docs.headwaters.ai/guides/faces.md).

> [!NOTE]
>
> **A document is the face's own writing.** An interview, transcript or any other exchange
> between speakers is a thread: upload it with `type=thread&face_speaker=Alice` so only
> Alice's turns are used. See [Uploading threads](https://docs.headwaters.ai/guides/compile.md#uploading-threads).

***

## 5. Compile

Trigger compilation of the uploaded document, using the `document_id` from step 4:

```bash theme={null}
curl -X POST https://api.faces.sh/v1/compile/documents/DOC_ID/make \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Compilation is asynchronous (returns `202`). Poll the document status until it completes:

```bash theme={null}
curl https://api.faces.sh/v1/compile/documents/DOC_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
```

When `status` is `compiled`, the face is ready. While `finishing` is `true` the
compile is still in hand, so keep polling and offer no action. See [Compile](https://docs.headwaters.ai/guides/compile.md#finishing-the-one-field-to-branch-on).

***

## 6. Ask the face

Describe a situation and ask a question. `model` is the face and its maestro,
`@alice:maestro-1` (see [Naming a model](https://docs.headwaters.ai/guides/models.md)):

```bash theme={null}
curl -X POST https://api.faces.sh/v1/choices \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "@alice:maestro-1",
    "state": "A startup in Berlin offers me a design lead role at a lower salary than I earn now.",
    "instructions": "Should I take the offer?"
  }'
```

```json theme={null}
{
  "object": "choices",
  "model": "@alice:maestro-1",
  "choices": [
    {"name": "Take the offer", "description": "Berlin's freedom, meaningful work, and long-term impact outweigh salary. If the startup aligns with your values, it's worth the trade-off."},
    {"name": "Reject the offer", "description": "If the deadline feels rushed, it may signal poor collaboration. Trust your instincts about their process."},
    {"name": "Negotiate", "description": "If the title matters less, focus on salary, equity, or growth opportunities to bridge the gap."}
  ],
  "usage": {"input_tokens": 1243, "output_tokens": 250}
}
```

The face proposes the options it would weigh, strongest first. Leave `instructions` out and it
proposes the question it would ask instead. See [Choices](https://docs.headwaters.ai/guides/choices.md).

To have the face answer in its own words on any chat model, name the model after a `/`:

```bash theme={null}
curl -X POST https://api.faces.sh/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "@alice:maestro-1/gpt-5.4-mini",
    "messages": [{"role": "user", "content": "Should I take the offer? One line."}]
  }'
```

See [Chat](https://docs.headwaters.ai/guides/chat.md).

> [!TIP]
>
> For a situation longer than 3,000 tokens, or one your agent keeps building, put it in a
> [state](https://docs.headwaters.ai/guides/states.md) and send its id as `state_id`.

***

## Next steps

* [Add more faces and manage your library](https://docs.headwaters.ai/guides/faces.md)
* [Ask a face what it would do](https://docs.headwaters.ai/guides/choices.md)
* [Chat with a face on any model](https://docs.headwaters.ai/guides/chat.md)
* [Understand compilation](https://docs.headwaters.ai/guides/compile.md)
* [Build synthetic faces from boolean expressions](https://docs.headwaters.ai/guides/synthetic-faces.md)
* [Manage billing and subscription plans](https://docs.headwaters.ai/guides/billing.md)


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