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

# API Reference Overview

The Zyfai Vault API provides methods for depositing, withdrawing, and managing shares in the Zyfai Vault on Base. The vault is a shared yield-generating pool where users deposit USDC and receive vault shares.  The vault is redirecting the deposited assets to one globally shared safe subaccount for automated yield optimization. [Full architecture documentation](https://docs.zyf.ai/docs/product/infra/agent-vault.md)

## Quick Links

* [Getting Started](https://docs.zyf.ai/docs/sdk/getting-started.md) - Full integration guide with Vault vs Smart Wallet comparison
* [Smart Wallet API](https://docs.zyf.ai/docs/sdk/api/overview.md) - API reference for Smart Wallet methods

## API Organization

The Vault API methods are organized by operation type.

### Deposits

Deposit assets into the vault.

| Method | Description |
| :- | :- |
| [vaultDeposit](https://docs.zyf.ai/docs/sdk/vault/vault-deposit) | Deposit USDC into the vault, receive shares |

### Withdrawals

Request and claim withdrawals from the vault.

| Method | Description |
| :- | :- |
| [vaultWithdraw](https://docs.zyf.ai/docs/sdk/vault/vault-withdraw) | Request withdrawal of shares |
| [vaultClaim](https://docs.zyf.ai/docs/sdk/vault/vault-claim) | Claim completed withdrawal |

### Shares

Check your vault share balance.

| Method | Description |
| :- | :- |
| [getVaultShares](https://docs.zyf.ai/docs/sdk/vault/get-vault-shares) | Get share balance and symbol |

***

## Common Patterns

### Authentication Required

Vault methods require wallet connection via `connectAccount()`:

```typescript theme={null}
await sdk.connectAccount(walletClient, 8453); // Base only

// Now vault methods work
const deposit = await sdk.vaultDeposit("100", "USDC");
```

### Chain Support

The Vault is currently only available on **Base (chain ID 8453)**.

```typescript theme={null}
// Vault only works on Base
await sdk.connectAccount(walletClient, 8453);
```

### Amount Formatting

Unlike Smart Wallet methods, vault deposit amounts are in **human readable format**:

```typescript theme={null}
// Vault: human readable (100 USDC)
await sdk.vaultDeposit("100", "USDC");

// Smart Wallet: least decimal units (100 * 10^6)
const sent = await sdk.sendDeposit(userAddress, chainId, "100000000", "USDC");
await sdk.waitForDepositCredit(sent.registration.id, chainId);
```

### Withdrawal Flow

Vault withdrawals are asynchronous and require two steps:

```typescript theme={null}
// Step 1: Request withdrawal
const withdraw = await sdk.vaultWithdraw();
console.log("Withdraw key:", withdraw.withdrawKey);

// Step 2: Claim when ready
if (withdraw.status === "claimable") {
  const claim = await sdk.vaultClaim(withdraw.withdrawKey);
  console.log("Claimed:", claim.txHash);
}
```

***

## Type Safety

The SDK is fully typed with TypeScript. Import types as needed:

```typescript theme={null}
import type {
  VaultDepositResponse,
  VaultWithdrawResponse,
  VaultClaimResponse,
  VaultSharesResponse,
} from "@zyfai/sdk";
```

## Response Format

All Vault methods return consistent response objects:

```typescript theme={null}
{
  success: boolean; // Operation success status
  // ... method-specific data
}
```

## Support

* [GitHub Issues](https://github.com/ondefy/zyfai-sdk/issues)
* [Discord](https://discord.gg/rQbEZ4UZw5)
* [Telegram](https://t.me/zkzyfi)
* [Zyfai Website](https://zyf.ai)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.