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

> ## Agent Instructions
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The catalog of every model — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# Authenticate

> Log in through your browser on a workstation, or set `REACTOR_API_KEY` for CI.

The CLI authenticates with a partner API key. On a workstation, `reactor auth login` creates that
key for you in the browser. In CI, get a key from the [dashboard](https://reactor.inc/dashboard) and
set it in the environment.

## Interactive (macOS / Linux workstation)

`reactor auth login` opens your browser on reactor.inc and waits for you to approve the login.

<Warning>
  Check that the confirmation code in the browser is the same as the code in your terminal. When the
  two codes are different, do not approve the login.
</Warning>

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth login
# → Confirmation code: BDXW-7Q2M
#   Open this URL to approve the login: <approval-url>
#   Opened your browser; waiting for approval... (Ctrl-C to cancel)
# ✓ Authenticated
#   Credentials stored in system keychain
```

Approval creates a new API key for this machine. The key is stored in the **system keychain** (macOS
Keychain or Linux Secret Service). Non-sensitive metadata (account ID, server URL) is saved to
`~/.reactor/config.yaml`.

When you run `reactor auth login` again and the stored key still works, the CLI keeps it and tells
you that you are already authenticated.

### Other ways to log in

| Flag                   | Description                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------- |
| `--no-browser`         | Do not open a browser. The CLI prints the approval URL for you to open on any device. |
| `--with-api-key`       | Skip the browser and enter an existing API key at a hidden prompt.                    |
| `--new-key`            | Replace the stored key with a fresh one, even when the stored key still works.        |
| `--device-name <name>` | Label this machine's key in the dashboard. The default is the hostname.               |

Some machines have no browser of their own, such as a host you reach over SSH. Use `--no-browser`
there, then open the printed URL on another device:

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth login --no-browser
```

## Non-interactive (CI/CD, headless Linux, Docker)

Set `REACTOR_API_KEY` in the environment:

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
export REACTOR_API_KEY=<your-api-key>
reactor auth status
```

When `REACTOR_API_KEY` is set it takes precedence over the system keychain. `reactor auth login`
becomes a no-op (it prints an informational message and exits without prompting or writing to the
keychain).

## Check status

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth status
```

Sample output:

```
✓ Authenticated
  Account: <your-account-id>
  Server:  https://api.reactor.inc
  Key source: REACTOR_API_KEY (environment variable)
```

The `Key source:` line tells you whether the key came from the environment or the keychain.

## Log out

`reactor auth logout` removes the stored credentials from the machine: the keychain entry and the
cached account metadata in `~/.reactor/config.yaml`. If `REACTOR_API_KEY` is set, the command warns
you to unset it, because the environment variable keeps authenticating the shell.

When the key came from a browser login, logout also revokes it on the server, so it stops working on
every machine. Revocation is best effort. When it fails, the CLI prints a warning and still clears
the local credentials.

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth logout
```

## Server override

The default server is `https://api.reactor.inc`. Override per-invocation with `--server <url>`, or
persistently with `REACTOR_SERVER=<url>` in the environment.

## Next

<CardGroup cols={2}>
  <Card title="Register a model" icon="box" href="/deploy/platform/register">
    Provision a model record on the platform.
  </Card>

  <Card title="Publish a release" icon="upload" href="/deploy/platform/publish">
    Build the image and upload weights in one command.
  </Card>
</CardGroup>
