# Wallet APIs SDK Quickstart

> Get started with Alchemy Wallet APIs using the SDK. Install the @alchemy/wallet-apis package, create a client, and send your first sponsored transaction in minutes.

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

<Note>
  [`@alchemy/wallet-apis`](https://github.com/alchemyplatform/aa-sdk/tree/v5.x.x/packages/wallet-apis) (v5.x.x) is the recommended SDK and is currently in beta. If you're still on v4.x.x, see the [migration guide](/docs/wallets/resources/migration-v5).
</Note>

### 1. Install

You're going to need `@alchemy/wallet-apis` and `viem`.

<CodeGroup>
```shell npm
npm install @alchemy/wallet-apis viem
```

```shell bun
bun add @alchemy/wallet-apis viem
```

```shell yarn
yarn add @alchemy/wallet-apis viem
```

```shell pnpm
pnpm add @alchemy/wallet-apis viem
```

</CodeGroup>

### 2. Create a client

This quickstart uses a local private key as an example. You can use any [viem-compatible signer](/docs/wallets/third-party/signers/custom-integration), including providers like [Privy](/docs/wallets/third-party/signers/privy).

```ts
import { createSmartWalletClient, alchemyWalletTransport } from "@alchemy/wallet-apis";
import { arbitrumSepolia } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";

const client = createSmartWalletClient({
  transport: alchemyWalletTransport({
    apiKey: "YOUR_API_KEY",
  }),
  chain: arbitrumSepolia,
  signer: privateKeyToAccount("0xYOUR_PRIVATE_KEY" as const),
  paymaster: {
    policyId: "YOUR_POLICY_ID",
  },
});
```

### 3. Send a sponsored transaction

The client defaults to [EIP-7702](/docs/wallets/transactions/using-eip-7702), so your EOA will be delegated to a smart wallet to enable gas sponsorship, batching, and more. The SDK handles delegation automatically on the first transaction.

```ts
import { zeroAddress } from "viem";

const { id } = await client.sendCalls({
  calls: [{ to: zeroAddress, value: BigInt(0) }],
});
```

### 4. Wait for the transaction to be confirmed

```ts
const status = await client.waitForCallsStatus({ id });
const txHash = status.receipts?.[0]?.transactionHash;
console.log(`Explorer: https://sepolia.arbiscan.io/tx/${txHash}`);
```

<Accordion title="Using @account-kit/wallet-client (v4.x.x)?">
The examples on this page use `@alchemy/wallet-apis` (v5.x.x). If you're using `@account-kit/wallet-client` (v4.x.x), the client setup looks like this:

```ts title="client.ts (v4.x.x)"
import { LocalAccountSigner } from "@aa-sdk/core";
import { createSmartWalletClient } from "@account-kit/wallet-client";
import { alchemy, sepolia } from "@account-kit/infra";

const signer = LocalAccountSigner.privateKeyToAccountSigner("0xYOUR_PRIVATE_KEY" as const);

export const client = createSmartWalletClient({
  transport: alchemy({ apiKey: "YOUR_API_KEY" }),
  chain: sepolia,
  signer,
  account: signer.address, // can also be passed per action as `from` or `account`
  // Optional: sponsor gas for your users (see "Sponsor gas" guide)
  policyId: "YOUR_POLICY_ID", 
});
```

Key v4.x.x differences:
* **Account address** must be specified on the client or per action (`from` or `account`). In v5.x.x, the client automatically uses the owner's address as the account address via [EIP-7702](/docs/wallets/transactions/using-eip-7702).
* **Chain imports** come directly from `@account-kit/infra` instead of `viem/chains`.
* **Numeric values** use hex strings: `value: "0x0"` instead of `value: BigInt(0)`.
* In v4.x.x, the **paymaster capability** on `prepareCalls` or `sendCalls` is called `paymasterService` instead of `paymaster`, or you can set the `policyId` directly on the client.
* **Owners** use `LocalAccountSigner` / `WalletClientSigner` from `@aa-sdk/core`. In v5.x.x, a viem `LocalAccount` or `WalletClient` is used directly.

See the [full migration guide](/docs/wallets/resources/migration-v5) for a complete cheat sheet.
</Accordion>


### Next steps

* [Bring your own signer](/docs/wallets/third-party/signers/custom-integration)
* [Refine your gas sponsorship rules](/docs/wallets/transactions/sponsor-gas/conditional-sponsorship-rules)
* [Sign messages](/docs/wallets/transactions/signing/sign-messages)
* [Sign typed data](/docs/wallets/transactions/signing/sign-typed-data)
* [Batch transactions](/docs/wallets/transactions/send-batch-transactions)