> ## Documentation Index
> Fetch the complete documentation index at: https://daehan-base.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 결제 퀵스타트

> 10분 안에 Base에서 x402 결제를 처리하는 에이전트 구축

export const PaymentsQuickstartDemo = () => {
  const mono = "ui-monospace,'Cascadia Code','Source Code Pro',Menlo,Monaco,Consolas,monospace";
  const col = {
    dim: "#3f3f46",
    muted: "#52525b",
    active: "#60a5fa",
    success: "#34d399",
    code: "#d4d4d8"
  };
  const steps = [{
    delay: 350,
    left: [{
      t: "> npx skills add coinbase/agentic-wallet-skills",
      c: "active"
    }],
    right: [{
      t: "── Installing skills ───────────────────",
      c: "dim"
    }, {
      t: "authenticate-wallet",
      c: "muted"
    }, {
      t: "pay-for-service",
      c: "muted"
    }, {
      t: "monetize-service",
      c: "muted"
    }]
  }, {
    delay: 700,
    left: [{
      t: "  ✓ skills installed",
      c: "success"
    }],
    right: [{
      t: "search-for-service",
      c: "muted"
    }, {
      t: "send-usdc  trade",
      c: "muted"
    }]
  }, {
    delay: 500,
    left: [{
      t: "> Sign in with you@email.com",
      c: "active"
    }],
    right: []
  }, {
    delay: 650,
    left: [{
      t: "  ✓ wallet authenticated   0x4a3f...b7c1",
      c: "success"
    }],
    right: [{
      t: "",
      c: "dim"
    }, {
      t: "── Wallet ready ────────────────────────",
      c: "dim"
    }, {
      t: "  address: 0x4a3f...b7c1",
      c: "success"
    }, {
      t: "  balance: 10.00 USDC",
      c: "success"
    }]
  }, {
    delay: 500,
    left: [{
      t: "> Find and fetch ETH price from a paid source",
      c: "active"
    }],
    right: [{
      t: "",
      c: "dim"
    }, {
      t: "── HTTP Trace ──────────────────────────",
      c: "dim"
    }, {
      t: "GET /api/v3/simple/price?ids=ethereum",
      c: "code"
    }, {
      t: "Host: api.coingecko.com",
      c: "muted"
    }]
  }, {
    delay: 700,
    left: [{
      t: "  ← 402 Payment Required · 0.001 USDC",
      c: "muted"
    }],
    right: [{
      t: "",
      c: "dim"
    }, {
      t: "HTTP/1.1 402 Payment Required",
      c: "muted"
    }, {
      t: 'X-Payment-Required: {"amount":"0.001"}',
      c: "code"
    }]
  }, {
    delay: 550,
    left: [{
      t: "  paying 0.001 USDC via wallet...",
      c: "muted"
    }],
    right: []
  }, {
    delay: 600,
    left: [{
      t: "  ✓ tx confirmed",
      c: "success"
    }],
    right: [{
      t: "",
      c: "dim"
    }, {
      t: "── Retry with payment ──────────────────",
      c: "dim"
    }, {
      t: "GET /api/v3/simple/price?ids=ethereum",
      c: "code"
    }, {
      t: "X-Payment-Sig: 0x1a9f...c4e2",
      c: "success"
    }]
  }, {
    delay: 600,
    left: [{
      t: "  ← 200 OK  · ETH $2,847.32  ↑ 2.3%",
      c: "success",
      bold: true
    }],
    right: [{
      t: "",
      c: "dim"
    }, {
      t: "HTTP/1.1 200 OK",
      c: "success"
    }, {
      t: '{"ethereum":{"usd":2847.32}}',
      c: "code"
    }]
  }];
  const [leftLines, setLeftLines] = useState([]);
  const [rightLines, setRightLines] = useState([]);
  const [running, setRunning] = useState(false);
  const [done, setDone] = useState(false);
  const [blink, setBlink] = useState(true);
  const leftRef = useRef(null);
  const rightRef = useRef(null);
  useEffect(() => {
    const t = setInterval(() => setBlink(b => !b), 530);
    return () => clearInterval(t);
  }, []);
  useEffect(() => {
    if (leftRef.current) leftRef.current.scrollTop = leftRef.current.scrollHeight;
  }, [leftLines]);
  const play = () => {
    setLeftLines([]);
    setRightLines([]);
    setRunning(true);
    setDone(false);
    let i = 0;
    const next = () => {
      if (i >= steps.length) {
        setRunning(false);
        setDone(true);
        return;
      }
      const s = steps[i];
      setTimeout(() => {
        if (s.left && s.left.length) setLeftLines(prev => [...prev, ...s.left]);
        if (s.right && s.right.length) setRightLines(prev => [...prev, ...s.right]);
        i++;
        next();
      }, s.delay);
    };
    next();
  };
  useEffect(() => {
    setTimeout(play, 350);
  }, []);
  const renderLine = (item, i) => {
    if (!item.t) return <div key={i} style={{
      height: 6
    }} />;
    return <div key={i} style={{
      fontFamily: mono,
      fontSize: 12,
      lineHeight: "20px",
      color: col[item.c] || col.code,
      fontWeight: item.bold ? 600 : 400,
      whiteSpace: "pre"
    }}>{item.t}</div>;
  };
  return <div style={{
    margin: "28px 0",
    borderRadius: 12,
    overflow: "hidden",
    border: "1px solid #27272a",
    background: "#09090b"
  }}>
      <div style={{
    display: "flex",
    alignItems: "center",
    padding: "8px 12px",
    background: "#111113",
    borderBottom: "1px solid #27272a"
  }}>
        <div style={{
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    width: 28,
    height: 24,
    borderRadius: 6,
    background: "#1e1e20",
    border: "1px solid #27272a",
    marginRight: 10,
    flexShrink: 0
  }}>
          <span style={{
    fontFamily: mono,
    fontSize: 11,
    color: "#71717a",
    userSelect: "none"
  }}>{">"}_</span>
        </div>
        <span style={{
    fontFamily: mono,
    fontSize: 12,
    color: "#52525b"
  }}>Payments Quickstart</span>
        <div style={{
    flex: 1
  }} />
        <button onClick={play} title="Reset" style={{
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    width: 28,
    height: 24,
    borderRadius: 6,
    background: "transparent",
    border: "1px solid transparent",
    cursor: "pointer",
    color: "#3f3f46",
    fontSize: 15,
    lineHeight: 1
  }} onMouseEnter={e => {
    e.currentTarget.style.color = "#a1a1aa";
    e.currentTarget.style.background = "#1e1e20";
    e.currentTarget.style.borderColor = "#27272a";
  }} onMouseLeave={e => {
    e.currentTarget.style.color = "#3f3f46";
    e.currentTarget.style.background = "transparent";
    e.currentTarget.style.borderColor = "transparent";
  }}>
          {"\u21ba"}
        </button>
      </div>

      <div style={{
    height: 250,
    borderBottom: "1px solid #27272a",
    overflow: "hidden",
    display: "flex",
    flexDirection: "column"
  }}>
        <div style={{
    padding: "7px 16px 5px",
    borderBottom: "1px solid #1c1c1e"
  }}>
          <span style={{
    fontFamily: mono,
    fontSize: 10,
    fontWeight: 600,
    letterSpacing: "0.1em",
    textTransform: "uppercase",
    color: "#3f3f46"
  }}>Agent</span>
        </div>
        <div ref={leftRef} style={{
    flex: 1,
    overflowY: "hidden",
    padding: "12px 16px"
  }}>
          {leftLines.map(renderLine)}
          {running && <div style={{
    fontFamily: mono,
    fontSize: 12,
    lineHeight: "20px",
    color: "#60a5fa",
    opacity: blink ? 1 : 0
  }}>{"▋"}</div>}
        </div>
      </div>

      <div style={{
    padding: "8px 16px",
    display: "flex",
    justifyContent: "center",
    minHeight: 37,
    alignItems: "center"
  }}>
        {done && <button onClick={play} style={{
    fontFamily: mono,
    fontSize: 11,
    color: "#52525b",
    background: "none",
    border: "none",
    cursor: "pointer",
    padding: "4px 10px",
    borderRadius: 4
  }} onMouseEnter={e => {
    e.currentTarget.style.color = "#a1a1aa";
    e.currentTarget.style.background = "#18181b";
  }} onMouseLeave={e => {
    e.currentTarget.style.color = "#52525b";
    e.currentTarget.style.background = "none";
  }}>
            {"\u21ba"} Play again
          </button>}
      </div>
    </div>;
};

이 가이드는 처음 시작하는 순간부터 유료 x402 API 요청을 처리하고 자체 유료 엔드포인트를 노출하는 작동하는 에이전트를 만드는 과정을 10분 이내에 안내합니다.

## 모의 데모

<PaymentsQuickstartDemo />

## OpenClaw 설치

<Steps>
  <Step title="CLI 설치">
    **macOS / Linux:**

    ```bash Terminal theme={null}
    curl -fsSL https://openclaw.ai/install.sh | bash
    ```

    **Windows (PowerShell):**

    ```powershell Terminal theme={null}
    iwr -useb https://openclaw.ai/install.ps1 | iex
    ```

    설치 확인:

    ```bash Terminal theme={null}
    openclaw --version
    ```
  </Step>

  <Step title="온보딩 실행">
    ```bash Terminal theme={null}
    openclaw onboard --install-daemon
    ```

    프롬프트에 따라 LLM 공급자를 연결하고 지갑 플러그인을 설정합니다.
  </Step>

  <Step title="게이트웨이 시작">
    ```bash Terminal theme={null}
    openclaw gateway --port 18789
    ```

    `http://127.0.0.1:18789/`를 열어 게이트웨이가 실행 중인지 확인합니다.
  </Step>
</Steps>

<Tip>
  **Claude Code, Codex, OpenCode 사용자** — 아래의 지갑 스킬과 x402 결제 도구는 스킬을 지원하는 모든 AI 코딩 도구와 호환됩니다. 동일한 `npx skills add` 명령을 실행하면 동일하게 작동합니다.
</Tip>

## 지갑 설정

CDP Agentic Wallet 스킬을 설치합니다:

```bash Terminal theme={null}
npx skills add coinbase/agentic-wallet-skills
```

그런 다음 인증합니다:

```text theme={null}
Sign in to my wallet with your@email.com
```

또는 기본 x402 지원이 내장된 [Sponge Wallet](https://www.paysponge.com)을 사용합니다 — 모든 옵션은 [지갑 설정](/ai-agents/setup/wallet-setup)을 참조하세요.

## 첫 번째 x402 결제 처리

에이전트에게 유료 API를 찾아 호출하도록 요청합니다:

```text theme={null}
Find a weather API and get the forecast for New York
```

`search-for-service`와 `pay-for-service` 스킬이 검색, 결제, 재시도를 자동으로 처리합니다. 에이전트는 USDC로 결제하고 데이터를 받아 결과를 반환합니다 — API 키도, 구독도 필요하지 않습니다.

Sponge Wallet으로 직접 x402 요청을 하려면:

```bash Terminal theme={null}
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.example.com/paid-endpoint",
    "method": "GET",
    "preferred_chain": "base"
  }'
```

## 자신의 엔드포인트에 x402 게이팅 설정

에이전트에게 유료 API를 노출하도록 요청합니다:

```text theme={null}
Set up a paid endpoint for my market data at $0.01 per request
```

`monetize-service` 스킬(`npx skills add coinbase/agentic-wallet-skills`)이 x402 게이팅을 설정하고 엔드포인트를 배포합니다. 이제 다른 에이전트가 자동으로 서비스를 검색하고 결제할 수 있습니다.

또는 커스텀 서버에는 `x402-express`를 사용하세요 — [결제 수락](/ai-agents/payments/accepting-payments)을 참조하세요.

## 다음 단계

<CardGroup cols={2}>
  <Card title="x402 프로토콜" icon="bolt" href="/ai-agents/payments/pay-for-services-with-x402">
    x402 작동 방식, 지원 네트워크, 오류 처리에 대한 심층 설명입니다.
  </Card>

  <Card title="결제 수락" icon="money-bill" href="/ai-agents/payments/accepting-payments">
    OpenClaw 스킬 또는 커스텀 미들웨어로 서버 측 x402 게이팅을 설정합니다.
  </Card>

  <Card title="지갑 설정" icon="wallet" href="/ai-agents/setup/wallet-setup">
    에이전트를 위한 Bankr, CDP, 또는 Sponge를 설정합니다.
  </Card>

  <Card title="에이전트 등록" icon="fingerprint" href="/ai-agents/setup/agent-registration">
    검색 가능성과 신원 검증을 위해 에이전트를 등록합니다.
  </Card>
</CardGroup>
