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

# Paying Meterlane Routes with Coinbase Agentic Wallet

> Use the Coinbase awal CLI or payments-mcp to pay Meterlane x402 gateway routes without writing code — ideal for AI assistants and terminal workflows.

Coinbase Agentic Wallet gives AI agents a managed wallet they can use to pay x402 APIs without you building wallet infrastructure from scratch. Meterlane's public sandbox demo route is a ready-made target you can use to validate the buyer side of your integration — no account or signup required to test.

<Note>
  All examples on this page target **Base Sepolia** (`eip155:84532`). The public `x402.org` facilitator does not support Base mainnet. Use sandbox keys and test USDC only.
</Note>

## Public sandbox demo URL

```
https://gateway.meterlane.app/gateway/demo/demo
```

An unpaid request returns **HTTP 402** with an `X-Payment-Requirements` header. A funded agent wallet receives **HTTP 200** and the response body from the upstream demo API.

Confirm the route is live before testing your wallet integration:

```bash theme={null}
curl -i https://gateway.meterlane.app/gateway/demo/demo
```

***

## Option A — awal CLI

The `awal` CLI is the fastest way to pay a Meterlane route from a terminal or an agent workflow that calls shell commands.

<Steps>
  <Step title="Add Agentic Wallet skills">
    Run this once to install the Coinbase Agentic Wallet skill set:

    ```bash theme={null}
    npx skills add coinbase/agentic-wallet-skills
    ```
  </Step>

  <Step title="Sign in and fund your wallet">
    Open the Agentic Wallet UI after sign-in and deposit test USDC on **Base Sepolia** via Coinbase Onramp or the Circle faucet at [faucet.circle.com](https://faucet.circle.com).

    Set spending limits in the wallet UI before running any autonomous agent loops.
  </Step>

  <Step title="Inspect payment requirements (no charge)">
    Check the price and payment details for the demo route without spending any USDC:

    ```bash theme={null}
    npx awal@latest x402 details https://gateway.meterlane.app/gateway/demo/demo
    ```
  </Step>

  <Step title="Pay and fetch the route">
    Execute the paid request:

    ```bash theme={null}
    npx awal@latest x402 pay https://gateway.meterlane.app/gateway/demo/demo
    ```

    A successful payment prints the **200** response body to stdout.
  </Step>
</Steps>

***

## Option B — payments-mcp (AI assistants)

`@coinbase/payments-mcp` runs a local MCP server that exposes a `make_x402_request` tool. Any MCP-compatible AI assistant — Claude Desktop, Claude Code, Codex, Gemini CLI, and others — can call it to pay x402 routes without custom code.

<Steps>
  <Step title="Start the MCP server">
    ```bash theme={null}
    npx @coinbase/payments-mcp
    ```
  </Step>

  <Step title="Add it to your MCP client config">
    For Claude Desktop, add the following to your `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "coinbase-payments": {
          "command": "npx",
          "args": ["-y", "@coinbase/payments-mcp"]
        }
      }
    }
    ```

    Restart the client after editing the config.
  </Step>

  <Step title="Sign in and fund your wallet">
    Complete the wallet sign-in flow that appears after restart, then deposit test USDC on Base Sepolia.
  </Step>

  <Step title="Ask your assistant to pay the demo route">
    Prompt your assistant naturally:

    ```text theme={null}
    Pay for this x402 API and return the response body:
    GET https://gateway.meterlane.app/gateway/demo/demo
    ```

    The MCP `make_x402_request` tool handles **402 → pay → retry** automatically and returns the **200** body to the assistant.
  </Step>
</Steps>

***

## Option C — `@meterlane/x402` createAgentClient (scripted / CI)

If you are writing TypeScript or running automated tests, use `createAgentClient` from `@meterlane/x402/client` directly. This gives you full programmatic control and is the right choice for CI pipelines and custom agent frameworks.

<Warning>
  Never commit private keys to version control. Load them from environment variables and use a dedicated hot wallet with a limited USDC balance.
</Warning>

```typescript theme={null}
import type { Hex } from "viem";
import { createAgentClient } from "@meterlane/x402/client";

const privateKey = process.env.AGENT_PRIVATE_KEY as Hex;
const paidFetch = createAgentClient(privateKey, "eip155:84532");

const res = await paidFetch(
  "https://gateway.meterlane.app/gateway/demo/demo",
  { method: "GET" }
);

console.log(res.status);       // 200 after successful payment
console.log(await res.text()); // upstream response body
```

See the [SDK reference](/integrations/sdk) for full `createAgentClient` documentation, including the `onSettled` callback and network options.

***

## Choosing the right tool

| Tool                                              | Best for                                               | Requires code? |
| ------------------------------------------------- | ------------------------------------------------------ | -------------- |
| `npx awal@latest x402 pay`                        | Terminal commands, agent skills workflows              | No             |
| `npx @coinbase/payments-mcp`                      | Claude Desktop, Claude Code, Codex, Gemini CLI         | No             |
| `createAgentClient` from `@meterlane/x402/client` | TypeScript apps, CI pipelines, custom agent frameworks | Yes            |

All three options use the same x402 payment protocol and settle on **Base Sepolia** for sandbox demos. For production routes on Base mainnet, configure a private mainnet-capable facilitator in your Meterlane dashboard under **Settings → Developer**.

<CardGroup cols={2}>
  <Card title="SDK Reference" icon="code" href="/integrations/sdk">
    Full createAgentClient and createCKMiddleware API docs
  </Card>

  <Card title="LangChain Integration" icon="link" href="/integrations/langchain">
    Wrap a gateway route as a DynamicStructuredTool
  </Card>
</CardGroup>
