Get Balance
curl --request GET \
--url https://api.example.com/v1/balanceimport requests
url = "https://api.example.com/v1/balance"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/balance"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/balance")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"currency": "<string>",
"available": 123,
"pending": 123,
"total_funded": 123,
"total_spent": 123,
"wallet_address": {}
}Agent API
Get Balance
Get the current USDC wallet balance.
GET
/
v1
/
balance
Get Balance
curl --request GET \
--url https://api.example.com/v1/balanceimport requests
url = "https://api.example.com/v1/balance"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/balance"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/balance")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"currency": "<string>",
"available": 123,
"pending": 123,
"total_funded": 123,
"total_spent": 123,
"wallet_address": {}
}Returns the current USDC balance, spending totals, and wallet address for the project linked to the authenticated API token. All monetary values are in micro-USDC (1 USDC = 1,000,000).
Requires a bearer token with the
read permission.Request
This endpoint takes no query parameters or request body.Response
string
required
Unique project identifier.
string
required
Always
"usdc".integer
required
Available USDC balance in micro-USDC.
integer
required
Pending USDC balance in micro-USDC. Funds in transit that are not yet available.
integer
required
Cumulative USDC funded into this project in micro-USDC.
integer
required
Cumulative USDC spent from this project in micro-USDC.
string | null
required
Bridge wallet address on Base for receiving USDC deposits.
null if no wallet has been created yet.Examples
curl https://api.unwall.xyz/v1/balance \
-H "Authorization: Bearer aw_live_xxxxxxxxxxxx"
import requests
resp = requests.get(
"https://api.unwall.xyz/v1/balance",
headers={"Authorization": "Bearer aw_live_xxxxxxxxxxxx"},
)
balance = resp.json()
usdc = balance["available"] / 1_000_000
print(f"Balance: {usdc:.2f} USDC")
const resp = await fetch("https://api.unwall.xyz/v1/balance", {
headers: {
Authorization: "Bearer aw_live_xxxxxxxxxxxx",
},
});
const balance = await resp.json();
console.log(`Balance: ${(balance.available / 1_000_000).toFixed(2)} USDC`);
Response (200 OK)
{
"project_id": "proj_abc123",
"currency": "usdc",
"available": 5000000,
"pending": 0,
"total_funded": 5000000,
"total_spent": 0,
"wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28"
}