# Set up with an agent

An agent can prepare Liquid CLI, request access, and check the result. You must sign in and approve access in your browser.
The agent does not need your password or an API key in the chat.

## 1. Prepare the CLI

Ask the agent to follow the [CLI installation steps](https://liquidinference.ai/docs/cli.md).
The CLI supports macOS and Linux. Make sure that `arc` is on the agent's `PATH`.

If the computer already has access, check it first:

```bash
arc whoami --json
arc api GET /v1/models
```

`arc whoami` shows the local configuration. The API request checks access without a paid inference request.
If the saved workspace and access are correct, continue with step 3.

## 2. Ask the user to approve access

Run this command on the computer where the agent will use Liquid:

```bash
arc login --no-open </dev/null
```

The command prints a link and a code. It waits for approval without a browser on that computer.
The input redirect prevents terminal prompts after approval. Keep the command active while the user completes these steps.
The request expires after 10 minutes.

Give the user the link and code, with these instructions:

1. Open the link in your browser.
2. Sign in, or create an account.
3. Compare the page's code with the code from the agent.
4. Select the workspace that the agent must use.
5. Review the requested access.
6. Select **Approve** if the code, workspace, and access are correct.
7. Return to the agent so it can complete setup.

Sign-up preserves the approval request. A new account also needs a workspace before the approval page opens.
If the browser loses the request, open the same link again before it expires.

On a first sign-in, the CLI requests permission to create an API key. Only a workspace owner or admin can approve this access.
After approval, the CLI creates a key and saves it locally. The key can spend the workspace balance.
The CLI does not print the key. See [API keys](https://liquidinference.ai/docs/keys.md) for limits and revocation.

If you are a member, ask an owner or admin for a key through your usual secure channel.
Save it yourself with `arc login --key` in a terminal. Do not paste it into the agent chat.

## 3. Continue after approval

Wait for the login command to finish successfully. Then check the workspace and access again:

```bash
arc whoami --json
arc api GET /v1/models
```

Keep credentials in the CLI configuration. Use `arc api` to send requests without a key in the command text.
Use the [connection guides](https://liquidinference.ai/docs/connect-overview.md) to select a tool, or follow the [Quickstart](https://liquidinference.ai/docs/quickstart.md) for an API request.
Agree on a price cap before the first paid request.

## If setup stops

| Result                                                                | Next step                                                                                                         |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| The login command still waits, and the request has not expired        | Complete approval through the same link.                                                                          |
| The command stopped, the request expired, or the code no longer works | Run `arc login --no-open </dev/null` again. Give the user the new link and code.                                  |
| The user denied access                                                | Stop setup. Start another request only if the user asks.                                                          |
| Sign-in succeeded, but the CLI could not create a key                 | With the user's approval, run `arc keys create agent --save`. This needs a token with the `keys` scope.           |
| The saved workspace is wrong                                          | Use `arc workspace list` and `arc workspace use <workspace>` for a saved workspace. Otherwise, start a new login. |
| The API refuses the saved key                                         | Run login again, or ask the user to save a valid key in their terminal.                                           |

The CLI does not save a pending login request. It cannot resume that request after the command stops.
An approval page alone does not confirm that the CLI saved a key. Always check the command result and API access.

For an MCP client with browser authorization, use the [MCP connection guide](https://liquidinference.ai/docs/connect-mcp-server.md) instead.
