# Quickstart

> Install the CLI, sign in, run Claude Code through Nexus and see what it cost.

You need curl, a Nexus organization (sign in to [Nexus UI](/app) with your Google account or email; your first
sign-in creates your personal organization), and [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
installed. Nexus never installs a coding agent for you:

```sh
curl -fsSL https://claude.ai/install.sh | bash
```

## 1. Install the CLI

```sh
curl -fsSL https://api.nexus.inc/install.sh | bash
```

The installer downloads the `nexus` CLI from Nexus Gateway, checks it against its SHA-256 checksum and installs it to
`~/.nexus/bin/nexus` (set `NEXUS_INSTALL_DIR` to change the folder). It installs the native binary for your machine
when Gateway publishes one. Otherwise it installs the JavaScript CLI, which needs Node.js 22.6 or later. If that
folder isn't on your `PATH`, it prints the line to add. Open a new terminal and check:

```sh
nexus --version
```

## 2. Sign in

```sh
nexus auth login
```

The CLI shows a one-time code and opens Nexus UI. Check that the code matches, and approve it for your organization.
The CLI then has a token of its own: it is yours, lasts 90 days and can be revoked. Codes expire after ten minutes.

```sh
nexus auth status    # your organization, you, your role, and whether Gateway accepts your token
```

## 3. Add your Anthropic key

Through Nexus Gateway, Claude Code's calls go to Anthropic with your organization's own key. An owner or admin adds it
once:

```sh
nexus keys add anthropic sk-ant-…
```

The key is encrypted at rest and used for your organization only. `nexus keys list` shows which providers have a key.

## 4. Run Claude Code through Nexus

```sh
nexus claude --api
```

Claude Code starts as usual, with every model call going through Nexus Gateway: reserved against your organization's
budget, metered, checked against its policy and attributed to you and to this session. Arguments go to Claude Code
unchanged:

```sh
nexus claude --api -p "Summarize this repository in five bullet points"
```

Without `--api`, `nexus claude` takes your saved route (`nexus agents use`). The default is your own Claude plan: Nexus
records the session but does not meter it (see [Choose a route](/docs/guides/coding-agents#choose-a-route)).

## 5. See what it cost

```sh
nexus spend
```

You get the budget, what is spent, reserved and remaining (a member gets what is left for them), spend by product and
capability (Claude Code's calls show under `agents › claude`) and the latest calls. Nexus UI shows the same under
**Usage**, and your agent sessions on **Overview**.

> **Over budget.** Every call reserves its maximum cost before it runs. A call that would go over what is left of the budget is refused
> with `402`, so a budget is never overspent. Owners and admins set the organization's budget with
> [`POST /v1/orgs/budget`](/docs/api/organizations#set-budget).

## Next

- [Authentication](/docs/authentication): API keys for CI and scripts.
- [Claude Code](/docs/guides/claude-code) and [Codex](/docs/guides/codex): each one through Nexus Gateway, step by step.
- [Coding agents](/docs/guides/coding-agents): the two routes, models and budget.
- [Teams](/docs/concepts/teams): attribute spend to the teams of your organization.
- [API reference](/docs/api): every endpoint of the Nexus API.
