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

# Use an API key

> Connect Claude Code or another MCP client with an API key

An API key connects Claude Code, or any MCP client that can send a header, to your Allocait account without a sign-in screen. To sign in through the connector instead, see [Connect Claude](https://docs.allocait.app/claude/connect.md).

## Get an API key

**1. Create the key**

In Allocait, go to **Settings > API keys** and select **Create API key**.

**2. Name it and choose its access**

Give the key a name, such as "Claude Code on my laptop", and choose its access:

* **Read only** lets Claude call the read tools.
* **Read and change** lets Claude also create, change and delete your portfolios, holdings, cash entries, rules and research. Webhooks and preferences stay in the app. Deleting a portfolio or a scenario also needs its name, exactly as you confirmed it.

See [Access levels](https://docs.allocait.app/concepts/access-levels.md) for the full comparison.

**3. Choose when it expires**

Choose **Never**, **90 days** or **1 year**. An expired key stops working, and you create a new one.

**4. Copy the key**

The key starts with `alc_`. Allocait generates it, shows it once and stores only a hash, so you can't view it again later.

To see what Claude does before you allow changes, start with a read-only key. You can create a second key with different access later. For key rules and scope, see [Authentication](https://docs.allocait.app/api/authentication.md).

## Enter the key in Claude Code

Add the server with the key in a header. Replace `YOUR_API_KEY` with the key you copied:

```bash theme={null}
claude mcp add --transport http allocait https://api.allocait.app/functions/v1/mcp --header "x-api-key: YOUR_API_KEY"
```

Allocait's MCP server reads the key from the `x-api-key` header.

## Use another MCP client

Point the client at this URL and send your API key as the `x-api-key` header on every request:

```text theme={null}
https://api.allocait.app/functions/v1/mcp
```

For a worked example, see [Other MCP clients](https://docs.allocait.app/recipes/use-with-any-mcp-client.md). ChatGPT and Codex sign in instead of using a key: see [Connect ChatGPT](https://docs.allocait.app/chatgpt/connect.md).

## Next steps

> [card] [Access levels](https://docs.allocait.app/concepts/access-levels.md)
>
> What Read only and Read and change allow.

> [card] [Authentication](https://docs.allocait.app/api/authentication.md)
>
> Key permissions and scope.


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