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

# Quickstart

> Install SELAT Router SDK and send your first paid request.

This quickstart takes you from installation to a working request through `selat-router`.

## Prerequisites

Before you begin, you must have:

* Node.js 18 or newer
* Access to a signer, either a private key, Circle Agent Wallet, or remote signer
* A wallet funded with USDC on your target chain (see the "Fund your wallet" step below)
* A target endpoint that is reachable through SELAT

## Get started

<Steps>
  <Step title="Install">
    Install the SDK.

    ```bash theme={null}
    npm install @selat-ai/router-client
    ```
  </Step>

  <Step title="Create a signer">
    Start with a private key, or switch to a Circle Agent Wallet or remote signer when you are ready to remove secrets from the runtime.

    The signer reads your key from the `X402_CLIENT_PRIVATE_KEY` environment variable. If you don't already have a key, generate one:

    ```bash theme={null}
    # Generate a new private key (requires `npm install viem`)
    node -e "console.log(require('viem/accounts').generatePrivateKey())"

    # Export it so the signer can read it (use a real secret store in production)
    export X402_CLIENT_PRIVATE_KEY=0x...
    ```

    Then create the signer:

    ```ts theme={null}
    import { createViemSigner } from "@selat-ai/router-client";

    const signer = createViemSigner(process.env.X402_CLIENT_PRIVATE_KEY as `0x${string}`);
    ```
  </Step>

  <Step title="Fund your wallet">
    Paid requests draw USDC from your signer's wallet through Circle Gateway. A brand-new key has a zero balance, so fund it before your first paid request — otherwise the request fails with an insufficient-balance error.

    The simplest way to top up is the [SELAT CLI](/docs/selat-cli):

    ```bash theme={null}
    npm install -g @selat-ai/selat-cli
    selat fund --chain base --amount 2
    ```

    Use the same chain you pass to `RouterClient` (here, `base`) — see [signer and chain guidance](/docs/selat-sdk/router-client#select-a-signer-and-chain). You can also deposit USDC into [Circle Gateway](https://developers.circle.com/agent-stack/gateway) directly for the wallet behind your signer.
  </Step>

  <Step title="Send a paid request">
    Create the client and call `fetch` against your target endpoint.

    ```ts theme={null}
    import { RouterClient, createViemSigner } from "@selat-ai/router-client";

    const signer = createViemSigner(process.env.X402_CLIENT_PRIVATE_KEY as `0x${string}`);

    const client = new RouterClient({
      chain: "base",
      signer
    });

    const response = await client.fetch("https://upstream.example.com/v1/data", {
      method: "GET"
    });

    console.log(await response.text());
    ```
  </Step>
</Steps>

<Tip>
  If you want to keep the signer outside the SDK process, use [Circle Agent Wallets](https://developers.circle.com/agent-stack/agent-wallets/quickstart) or a remote signer.
</Tip>
