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

# Quick Start

> Give an AI agent spending power with limits, visibility, and payment proof.

4Mica lets you give an AI agent money without giving it unlimited trust. You fund a wallet, define what the agent is allowed to pay for, and keep a record of every paid request so spending stays visible, bounded, and auditable.

## What you control

When an agent can spend, the important question is not just "can it pay?" It is "can it pay within the rules I set?"

You should control:

* which wallet funds the agent;
* which networks and assets it can use;
* which sellers, agents, or domains it can pay;
* how much it can spend per request, task, route, or time window;
* whether larger payments require approval;
* when the agent should stop, ask for help, or choose a cheaper option;
* how payments connect to task logs and delivered results.

4Mica provides the payment path. Your agent policy decides when a payment is allowed.

## Set up your agent

<Steps>
  <Step title="Create a dedicated wallet">
    Use a wallet for the agent or application, not your main wallet. Keep automated signing separate from personal funds.
  </Step>

  <Step title="Deposit collateral">
    Deposit ETH or a supported <Tooltip headline="ERC-20" tip="Ethereum's standard interface for fungible tokens. It defines common functions for balances, transfers, approvals, and allowances so wallets and applications can interact with tokens consistently.">ERC-20</Tooltip> into 4Mica on the network your target sellers accept.
  </Step>

  <Step title="Register the client scheme">
    Configure the 4Mica client for each network the agent may use.
  </Step>

  <Step title="Define spending policy">
    Set limits for amount, seller, route, network, task, time window, and approval requirements.
  </Step>

  <Step title="Make paid requests">
    Use a wrapped HTTP client so the agent can handle paid resources while Your policy decides which payments to sign.
  </Step>

  <Step title="Audit the task">
    Record each payment with the seller, route, amount, reason, guarantee ID, request ID, and task result.
  </Step>
</Steps>

When you are ready to create the wallet and policy, continue in the [dashboard](https://app.4mica.io).

## Make a Paid Request

```ts theme={null}
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { FourMicaEvmScheme } from "@4mica/x402/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const scheme = await FourMicaEvmScheme.create(account);

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:84532", client: scheme }],
});

const response = await fetchWithPayment("https://api.example.com/data");
const data = await response.json();
```

<Warning>
  Start on Base Sepolia (`eip155:84532`) with small amounts. Move to production only after limits, logs, and withdrawal checks are routine.
</Warning>

## Before the agent pays

Your agent should inspect the seller's payment requirements and decide:

* is this seller or domain allowed?
* is the price within budget?
* is the network and asset allowed?
* does the payment match the task?
* does the agent need human approval first?
* should the agent continue, stop, or choose another seller?

For cost controls, see [Budgets and Spending Limits](/buyer/budgets-and-spending-limits).

If a payment requirement looks suspicious or hard to classify, send the details to [support](mailto:support@4mica.io) before allowing the agent to sign.

## After the agent pays

Every paid request should produce a record that explains what happened:

* which agent paid;
* which seller received the payment;
* how much was authorized;
* why the payment happened;
* which task or request it belongs to;
* what result came back;
* whether the guarantee or settlement obligation is still open.

For audit trails, see [Payment Proof and Audit](/buyer/payment-proof-and-audit).

Use the activity view in [4mica app](https://app.4mica.io) to compare the payment trail with your task logs.
