# Payments AI CLI

> Install the Payments AI CLI and let an AI agent sign you up and create your first checkout link.

The **Payments AI CLI** (`pai`) is the terminal surface for the same Public API your agents use through MCP.

Need MCP instead? See the [MCP server](/mcp) page. This page covers the CLI only.

## Install

Install the standalone binary on macOS or Linux:

```bash
curl -fsSL https://cli.mor.payments.ai/install.sh | sh
```

Verify the install:

```bash
pai --version
```

Run `pai help` for the command list, or `pai help --format json` for a machine-readable catalog.

## Try it with an AI agent

Paste the prompt below into an AI agent that can run terminal commands, such as Claude Code, Codex, or Cursor. The CLI carries its own step-by-step instructions (`pai skills show`), so the agent signs you up with an email code, asks what you want to sell, and hands you a test checkout link.

```text
Sign me up for Payments AI on sandbox with the CLI and give me a checkout link.
```

## Environments

The CLI targets **live** or **sandbox** Public API hosts. Resolution order (highest wins):

1. `--env` on the command line
2. `PAI_ENV`
3. Active sign-in profile environment
4. Merchant API key prefix (`pai_test_*` → sandbox, `pai_live_*` → live)
5. Default **live**

Use **`--env sandbox`** when you want test mode. Real money still requires merchant verification (KYC) and go-live on the dashboard.

If your override disagrees with the key prefix (for example a `pai_live_*` key with `--env sandbox`), the CLI **refuses the request** with exit code **10** and a corrected command hint.
