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

# Quickstart

> Get up and running with Steward in 5 minutes.

# Quickstart

<Note>
  Using your own instance? Start with [Self-Hosting](/guides/self-hosting), [Docker Deployment](/guides/docker), or the root [deployment guide](https://github.com/Steward-Fi/steward/blob/develop/docs/deployment.md). The project also runs `api.steward.fi` for trusted testers.
</Note>

This guide walks you through creating your first agent with an encrypted wallet, setting policies, and signing a transaction — all using the `@stwd/sdk`.

## 1. Install the SDK

<CodeGroup>
  ```bash npm theme={null}
  npm install @stwd/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @stwd/sdk
  ```

  ```bash yarn theme={null}
  yarn add @stwd/sdk
  ```

  ```bash bun theme={null}
  bun add @stwd/sdk
  ```
</CodeGroup>

## 2. Initialize the Client

```typescript theme={null}
import { StewardClient } from "@stwd/sdk";

const steward = new StewardClient({
  baseUrl: "https://api.steward.fi",
  apiKey: "your-tenant-api-key",
});
```

<Note>
  You'll receive your tenant API key when your tenant is created. This key authenticates all tenant-level operations (agent CRUD, policy management). See [API Overview](/api-reference/overview) for authentication details.
</Note>

## 3. Create an Agent with a Wallet

```typescript theme={null}
const agent = await steward.createWallet("my-first-agent", "My First Agent");

console.log(agent);
// {
//   id: "my-first-agent",
//   name: "My First Agent",
//   tenantId: "your-tenant-id",
//   walletAddresses: {
//     evm: "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
//     solana: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
//   },
//   createdAt: "2026-03-26T12:00:00.000Z"
// }
```

Steward automatically generates encrypted EVM and Solana keypairs. The private keys are encrypted with AES-256-GCM and never leave the vault.

## 4. Set Policies

Before an agent can sign transactions, it needs policies. Steward uses **default deny** — without policies, all operations are rejected.

```typescript theme={null}
await steward.setPolicies("my-first-agent", [
  {
    id: "spending-limit",
    type: "spending-limit",
    enabled: true,
    config: {
      maxPerTransaction: "100000000000000000",  // 0.1 ETH
      maxPerDay: "500000000000000000",          // 0.5 ETH
    },
  },
  {
    id: "approved-addresses",
    type: "approved-addresses",
    enabled: true,
    config: {
      addresses: ["0xDEX_ROUTER_ADDRESS"],
    },
  },
  {
    id: "auto-approve",
    type: "auto-approve-threshold",
    enabled: true,
    config: {
      maxValue: "50000000000000000", // 0.05 ETH — auto-approve below this
    },
  },
]);
```

## 5. Sign a Transaction

```typescript theme={null}
const result = await steward.signTransaction("my-first-agent", {
  to: "0xDEX_ROUTER_ADDRESS",
  value: "10000000000000000", // 0.01 ETH
  chainId: 8453,             // Base mainnet
});

if ("txHash" in result) {
  console.log(`Transaction broadcast! Hash: ${result.txHash}`);
} else if ("status" in result && result.status === "pending_approval") {
  console.log("Transaction requires manual approval:", result.results);
}
```

<Warning>
  If the transaction exceeds the auto-approve threshold but is within spending limits, it enters the **approval queue**. A tenant admin must call `POST /vault/:agentId/approve/:txId` to release it. See [Vault API](/api-reference/vault) for details.
</Warning>

## 6. Check Balance

```typescript theme={null}
const balance = await steward.getBalance("my-first-agent", 8453);

console.log(balance);
// {
//   agentId: "my-first-agent",
//   walletAddress: "0x742d35Cc...",
//   balances: {
//     native: "1000000000000000000",
//     nativeFormatted: "1.0",
//     chainId: 8453,
//     symbol: "ETH"
//   }
// }
```

## What's Next?

<CardGroup cols={2}>
  <Card title="Architecture" icon="sitemap" href="/concepts/architecture">
    Understand Steward's three-pillar design.
  </Card>

  <Card title="Policy Guide" icon="shield-check" href="/guides/policies">
    Learn about all policy types and configurations.
  </Card>

  <Card title="ElizaOS Plugin" icon="robot" href="/guides/eliza-plugin">
    Integrate Steward into an ElizaOS agent.
  </Card>

  <Card title="Self-Hosting" icon="server" href="/guides/self-hosting">
    Deploy your own Steward instance.
  </Card>
</CardGroup>
