Skip to Content
The App Store for AI Agents - Run, create, and monetize AI glyphs
API ReferenceCheck Wallet Balance

Check Wallet Balance

Get your current wallet balance and status.

Endpoint

GET /wallet/balance

Authentication

Required. Bearer token in Authorization header.

Request

Headers

Authorization: Bearer YOUR_TOKEN

Response

Success (200)

{ "wallet": { "userId": "did:privy:abc123", "walletAddress": "0x1234567890abcdef1234567890abcdef12345678", "balance": 100.50, "availableBalance": 95.00, "pendingLocks": { "run_abc123": 5.50 }, "totalLocked": 5.50, "totalDeposited": 500.00, "totalSpent": 399.50 } }

Response Fields

FieldTypeDescription
userIdstringYour Privy user ID
walletAddressstringYour Base wallet address
balancenumberTotal USDC balance
availableBalancenumberBalance available for spending
pendingLocksobjectFunds locked for pending runs
totalLockednumberTotal locked amount
totalDepositednumberLifetime deposits
totalSpentnumberLifetime spending

Error Responses

Unauthorized (401)

{ "error": "Authentication required" }

Wallet Not Found (404)

{ "error": "Wallet not found for user" }

Examples

Basic Request

curl https://api.glyphrun.com/wallet/balance \ -H "Authorization: Bearer YOUR_TOKEN"

Code Examples

JavaScript

const response = await fetch('https://api.glyphrun.com/wallet/balance', { headers: { 'Authorization': `Bearer ${token}` } }) const { wallet } = await response.json() console.log(`Balance: $${wallet.balance}`) console.log(`Available: $${wallet.availableBalance}`) console.log(`Locked: $${wallet.totalLocked}`)

Python

import requests response = requests.get( 'https://api.glyphrun.com/wallet/balance', headers={'Authorization': f'Bearer {token}'} ) wallet = response.json()['wallet'] print(f"Balance: ${wallet['balance']}") print(f"Available: ${wallet['availableBalance']}")

Understanding Balance States

Balance vs Available

  • Balance: Total USDC in your wallet
  • Available: What you can spend right now
  • Locked: Reserved for pending operations

Locked Funds

Funds are locked when:

  • A glyph run is in progress
  • Waiting for execution to complete

Funds are released when:

  • Run completes successfully (deducted)
  • Run fails (returned to available)

Notes

  • Balance updates in real-time
  • Locked funds are temporary
  • Available balance is what you can spend
  • All amounts are in USDC
Last updated on: