# Quickstart

> Create an agent and funded Tempo Testnet wallet, send a policy-checked payment, and verify settlement.

- Human URL: https://conto.finance/docs/quickstart/setup
- Raw Markdown: https://conto.finance/docs/quickstart/setup.md
- Terminal view: https://conto.finance/ai/docs/quickstart/setup

Documentation group: Get started

Send `0.01 pathUSD` on **Tempo Testnet**, verify settlement, then test approval and denial. The setup wizard creates your agent, policy, SDK key, and funded test wallet.

## Choose your first test

| Path                                           | What you test                                           | Funds and signer                                        |
| ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| **This guide: Tempo Testnet**                  | Policy checks and an actual onchain transfer            | Free faucet tokens. Conto manages signing               |
| [Anonymous sandbox](https://conto.finance/docs/quickstart/agent-sandbox) | API decisions, configurable controls, and test receipts | Simulated settlement. No signer or funded wallet needed |

Save sandbox outcomes with the [controlled-payment test report](https://conto.finance/docs/cli/commands#save-a-controlled-payment-test-report); new sandbox keys include its read scopes.

## 1. Create your project

You need Node.js 20.19+, npm, an interactive terminal, and a browser. Sign in or create a Conto
account when the wizard opens the browser.

```bash
mkdir conto-first-payment
cd conto-first-payment
npx @conto_finance/create-conto-agent
```

Enter an agent name and type, keep the default daily limit, and choose **Tempo Testnet** (chain `42431`). The wizard creates the
agent, managed wallet, policy, and SDK key, then funds the wallet with faucet `pathUSD`.
It writes `.env.local`, `.gitignore`, `conto.config.json`, and `example.mjs`, and installs the CLI locally.

Store the generated credentials securely. To create each resource yourself, [set up in the
dashboard instead](#set-up-in-the-dashboard-instead). For CI without a browser, use the
[agent sandbox quickstart](https://conto.finance/docs/quickstart/agent-sandbox).

## 2. Verify the wallet before sending

From the same directory:

```bash
npx @conto_finance/create-conto-agent doctor
```

Confirm the agent is active, the wallet chain is `42431`, the balance is positive, and the key has
`payments:request` and `payments:execute`. Fix any failed checks before continuing.

## 3. Request and execute one payment

```bash
npx @conto_finance/create-conto-agent pay 0x0000000000000000000000000000000000000001 0.01 --json
```

The command requests a `0.01 pathUSD` payment to a test recipient, stops if controls do not approve
it, and executes an approved request. Save the returned `requestId` and `receipt`. Each new invocation creates a
new payment intent. Use the original ID to inspect an uncertain outcome.

The response puts the transaction ID, transaction hash, and explorer URL under
`receipt`. A submitted testnet transfer has `status: "processing"` and
`receipt.settlementMode: "live"`: here **live means an onchain transfer**, including testnet.
An anonymous sandbox receipt uses `settlementMode: "test"` instead.

## 4. Confirm settlement

Run `export CONTO_API_KEY="$(grep '^CONTO_API_KEY=' .env.local | cut -d= -f2-)"`, then replace `REQUEST_ID`
with the ID returned above:

```bash
curl -sS https://conto.finance/api/sdk/payments/REQUEST_ID \
  -H "Authorization: Bearer $CONTO_API_KEY"
```

Completion means `status: "completed"` and `transaction.status: "completed"`. Check `transaction.chain.id` is `"42431"`, and open `transaction.explorerUrl` to inspect the transfer on Tempo Testnet.
While it is `processing`, wait and check again. Do not repeat execution. See
[track and recover a payment](https://conto.finance/docs/guides/payment-lifecycle) for bounded polling and error handling.

## 5. See approval and denial

New organizations start with two starter policies, linked to every new agent:

- Up to 10 pathUSD: approved.
- Over 10 pathUSD: waits for a person to approve.
- Over 25 pathUSD, or over 100 pathUSD in a day: denied.

Check two larger amounts. Neither amount is approved automatically, so nothing is sent:

```bash
npx @conto_finance/create-conto-agent pay 0x0000000000000000000000000000000000000001 12 --json
npx @conto_finance/create-conto-agent pay 0x0000000000000000000000000000000000000001 30 --json
```

The first returns `REQUIRES_APPROVAL` and sends the owner a review request. Approving it sends the
payment, so deny it in **Inbox** or let it expire. The second returns `DENIED` with
the reason in `reasons`. Edit or replace the starter policies in **Policies**.

## If the result needs attention

| Result                                              | Next action                                                                                                                                                                                                      |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DENIED`                                            | Read `reasons`, then inspect wallet limits and applicable policies                                                                                                                                               |
| Every payment `DENIED` after you edit wallet limits | A wallet limit of `0` blocks all payments through that link. On the agent detail page, set a positive cap or clear the field to remove the cap                                                                   |
| `DENIED` when you expected `REQUIRES_APPROVAL`      | Policies combine with AND logic. If one policy denies while another requires approval, the denial wins. Check the agent's **Policies** tab for every policy that applies, including company and team policies |
| `REQUIRES_APPROVAL`                                 | Approve or deny it from the owner's email or **Inbox**, then check the original request ID                                                                                                                       |
| Timeout or disconnect during execution              | Check the original request's status before any further write                                                                                                                                                     |
| Insufficient balance (`INSUFFICIENT_BALANCE`)       | Confirm chain and wallet, fund with the testnet faucet, then inspect request state                                                                                                                               |
| `AUTH_FAILED`                                       | The SDK key is invalid or expired. Generate a new one from the agent detail page                                                                                                                                 |
| HTTP `413`                                          | Reduce the payload to the endpoint’s [request-body limit](https://conto.finance/docs/reference/api-conventions#request-body-limits)                                                                                                        |

## Set up in the dashboard instead

Sign in at [conto.finance](https://conto.finance) and select your organization, then open
**Agents > Connect agent**.

    Enter a name, choose your framework (or **Custom**), and describe its purpose.
    Use **Development** for this test, then click **Connect agent**.

    Choose an existing **Tempo Testnet** wallet. If there are no wallets, click
    **Create testnet wallet**, then **Get test tokens** for free `pathUSD`.

    To create another wallet, use **Wallets > Create wallet**: select **Tempo Testnet**
    (`42431`), **Standard Wallet (EOA)**, and **Conto-managed**. Fund it from its wallet
    menu with **Deposit → Request Testnet Tokens**, then return to the agent setup.

    Review the displayed limits and click **Link wallet & continue**. Policies apply
    automatically; use **Policies** to change them. If linking needs approval, have
    the owner approve it before testing a payment.

    For a wallet your agent already signs for, choose **Import agent's wallet** instead.
    Select its network when importing a Solana address. See [wallet custody](https://conto.finance/docs/guides/custody-modes)
    for the available execution paths.

    The **Connect** step creates an SDK key on arrival. Copy it immediately; it is shown
    once. If you return to this step later, use **Generate SDK key** to create one.
    See [keys and scopes](https://conto.finance/docs/sdk/authentication) for access presets.

    ```bash
    export CONTO_API_KEY="conto_agent_your_key_here"
    ```

    Verify the agent, wallet balance, and payment scopes:

    ```bash
    curl https://conto.finance/api/sdk/setup \
      -H "Authorization: Bearer $CONTO_API_KEY"
    ```

    Confirm the wallet is on chain `42431`, has a positive balance, and the key includes
    `payments:request` and `payments:execute` before sending a payment.

To adjust wallet-specific limits later, open the agent's **Wallets** tab and edit its
linked wallet. A limit of `0` blocks spending; clear an editable limit for no cap.
See [defaults](https://conto.finance/docs/reference/defaults) for link limits and time windows.

## Next steps

To write your own rules, see [test allow, review, and deny decisions](https://conto.finance/docs/guides/policy-testing).
To integrate it into application code, [install the SDK](https://conto.finance/docs/sdk/installation). To test an existing
agent and wallet from code, open [Developers](https://conto.finance/developers) and use **Test this
agent's integration**. Before moving real funds, complete
[production readiness](https://conto.finance/docs/guides/production-readiness).
