# API keys

An API key authenticates MassifyAI MCP calls as its permitted account in a pinned organization/project. Use it for supported headless workflows or intentional workspace routing. It does not install local recording, guard or sync hooks.

## 1. Create and enter a key

1. Select the intended organization and MassifyAI project in the console.
2. Open Settings → API keys, create a suitably scoped key and keep it in the OS/CI secret store.
3. Supply it through the client/adapter's supported hidden prompt or protected environment injection. Never paste it into chat, a command argument, a repository or a shared config.
4. Call live `whoami` from the resulting client connection and verify its organization/project.

The key is shown once. A key for another organization or project cannot be fixed by changing a label or a browser selector. Create the appropriate key instead.

## 2. Coding-agent setup

**Ready-to-use example**

```text
First follow https://www.massifyai.com/docs-assets/setup/connection-check.md. Complete setup only if needed, then continue below.

Read https://www.massifyai.com/docs/how-to/workspace-organizations.md. Inspect the supported setup for this coding agent. Configure the intended MCP connection using a key supplied through secure local input or my CI secret store. Never ask me to paste a key into this chat or print it. Preserve other workspace routes and verify the actual organization/project after reconnecting.
```

**Prompt template**

```text
First follow https://www.massifyai.com/docs-assets/setup/connection-check.md. Complete setup only if needed, then continue below.

Read https://www.massifyai.com/docs/how-to/workspace-organizations.md. Inspect the supported setup for this coding agent. Configure the intended MCP connection using a key supplied through secure local input or my CI secret store. Never ask me to paste a key into this chat or print it. Preserve other workspace routes and verify the actual organization/project after reconnecting.
```

Codex's supported direct HTTP config can name `bearer_token_env_var` rather than embedding a key. Stored OAuth or plugin configuration can change which credential actually wins; verify the live connection. Use only a released credential helper or supported client configuration to select the key securely.

Claude Code has local/project/user MCP scopes. Use a reviewed helper/proxy or a protected environment-based setup appropriate to that client. Do not copy a raw `--header` command containing a key into an agent chat or shell history.

## 3. Recording and sync

MCP key authentication is separate from the matching browser sign-in used by the current plugin's recording and skill-sync engine. Follow the client-specific routing page before claiming that all three work. A missing refreshable session is a browser-bootstrap prerequisite, not proof a working key is wrong.

## 4. Rotate or revoke

Create a replacement for the correct scope, enter it securely, reconnect and verify it before retiring the old key under your team's policy. Revoke a compromised key through Settings → API keys. Check the console's current behavior for account/password resets and key policy rather than assuming a token's lifetime.
