# Vybe Solana Analytics API – Close Token Accounts Utility

> Vybe Solana Analytics API – Close Token Accounts Utility is a paid API for AI agents from x402-api.vybenetwork.xyz, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-24).

Identifies and closes empty or dust Solana token accounts for a wallet to reclaim rent SOL

## Facts

- Endpoint: POST https://x402-api.vybenetwork.xyz/v4/wallets/util/close-token-accounts?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402, finance
- Canonical page: https://www.zero.xyz/c/vybe-solana-analytics-api-close-token-accounts-utility-4faf5366
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_co7IGcKxkc6hi-YDaH9oN

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability vybe-solana-analytics-api-close-token-accounts-utility-4faf5366 -d '<json body>'
```

Example prompt: Can you close all my empty and dust token accounts on Solana for wallet address 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU and reclaim the rent SOL back into my main wallet?

## When to prefer this

Use this endpoint when an agent needs to help a Solana wallet owner reclaim SOL locked as rent in unused or zero-balance SPL token accounts. Prefer this over generic Solana RPC calls when you want a managed, analytics-enriched approach with per-call micropayment billing via x402 USDC and no API key setup required.

## Known failure modes

- Wallet has no closeable token accounts — returns empty result
- Invalid or malformed wallet public key — 400 bad request
- Token accounts still hold non-zero balances — cannot be closed
- Payment insufficient or x402 payment header missing — 402 Payment Required
- Solana network congestion causing transaction failures — 503 or timeout
- Wallet does not own the specified token accounts — authorization error

## How this service works

Closes zero-balance token accounts to reclaim rent. Supports manual or auto-discovery.

This route is currently in beta and is subject to change.

## Output

Returns a list of token accounts that were closed, the amount of SOL reclaimed from rent exemption deposits, and relevant transaction signatures confirming the on-chain state changes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "ownerAddress"
 ],
 "properties": {
  "gasless": {
   "type": "boolean",
   "nullable": true,
   "description": "Use Vybe fee payer for gas"
  },
  "partner": {
   "type": "string",
   "nullable": true,
   "description": "Partner identifier"
  },
  "rentFee": {
   "type": "number",
   "format": "double",
   "nullable": true,
   "description": "Fee percentage on recovered rent (0-1, e.g., 0.20 for 20%)"
  },
  "ownerAddress": {
   "type": "string",
   "format": "pubkey"
  },
  "accountAddresses": {
   "type": "array",
   "items": {
    "type": "string",
    "format": "pubkey"
   },
   "nullable": true,
   "description": "Specific token account addresses to close (auto-fetches if not provided)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "transactions",
  "errors",
  "summary"
 ],
 "properties": {
  "errors": {
   "type": "array",
   "items": {},
   "description": "Array of error objects for failed accounts"
  },
  "summary": {
   "type": "object",
   "required": [
    "totalAccountsClosed",
    "totalRentRecovered",
    "totalFeeCharged",
    "netRecovered"
   ],
   "properties": {
    "netRecovered": {
     "type": "number",
     "format": "double",
     "description": "Net recovered"
    },
    "totalFeeCharged": {
     "type": "number",
     "format": "double",
     "description": "Total fee deducted (in SOL units)"
    },
    "totalRentRecovered": {
     "type": "number",
     "format": "double",
     "description": "Total SOL recovered from rent (in SOL units)"
    },
    "totalAccountsClosed": {
     "type": "string",
     "description": "Total number of token accounts closed"
    }
   }
  },
  "transactions": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "transaction",
     "accountsClosed",
     "rentRecovered",
     "feeCharged"
    ],
    "properties": {
     "feeCharged": {
      "type": "number",
      "format": "double",
      "description": "Fee deducted (in SOL units)"
     },
     "transaction": {
      "type": "string",
      "description": "Base64-encoded unsigned transaction"
     },
     "rentRecovered": {
      "type": "number",
      "format": "double",
      "description": "SOL recovered from rent (in SOL units)"
     },
     "accountsClosed": {
      "type": "integer",
      "format": "int32",
      "minimum": 0,
      "description": "Number of accounts closed in this transaction"
     }
    }
   },
   "description": "Array of transaction objects"
  }
 },
 "description": "Wallet performance attribution response for API endpoints.\n\nAll fields default to 0.0 when no historical data is available."
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vybe-solana-analytics-api-close-token-accounts-utility-4faf5366/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-api.vybenetwork.xyz](https://www.zero.xyz/host/x402-api.vybenetwork.xyz/llms.txt)
