Skip to main content
GET
/
v2
/
credit
/
balances
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.credit.credit_balances(chain=models.V2CreditBalancesChain.BASE, owner="0x06A9aF046187895AcFc7258450B15397CAc67400")

    # Handle response
    print(res)
import { CompassApiSDK } from "@compass-labs/api-sdk";

const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});

async function run() {
const result = await compassApiSDK.credit.creditBalances({
chain: "base",
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
});

console.log(result);
}

run();
curl --request GET \
--url https://api.compasslabs.ai/v2/credit/balances \
--header 'x-api-key: <api-key>'
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.compasslabs.ai/v2/credit/balances', 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.compasslabs.ai/v2/credit/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$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.compasslabs.ai/v2/credit/balances"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

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.compasslabs.ai/v2/credit/balances")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.compasslabs.ai/v2/credit/balances")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "credit_account_address": "<string>",
  "balances": {
    "USDC": {
      "balance": "70710737",
      "balance_formatted": "70.710737",
      "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "token_decimals": 6,
      "token_symbol": "USDC",
      "transfers": [
        {
          "amount": "70710737",
          "amount_formatted": "70.710737",
          "block_number": 43830869,
          "block_timestamp": "2026-03-25T15:04:45Z",
          "direction": "in",
          "from_address": "0x111111125421cA6dc452d289314280a0f8842A65",
          "to_address": "0x4d4eb02B8d86379C36E887f391a039a17D72d9E0",
          "transaction_hash": "0x949969bf49c100beca5d05bebbc99a57608a6d1f7472c621f3b00a5987bb417a"
        }
      ],
      "usd_value": "70.77"
    },
    "WETH": {
      "balance": "876484654169830",
      "balance_formatted": "0.000876",
      "token_address": "0x4200000000000000000000000000000000000006",
      "token_decimals": 18,
      "token_symbol": "WETH",
      "transfers": [
        {
          "amount": "876484654169830",
          "amount_formatted": "0.000876",
          "block_number": 43482380,
          "block_timestamp": "2026-03-17T13:28:27Z",
          "direction": "in",
          "from_address": "0xd4a0e0b9149bcee3c920d2e00b5de09138fd8bb7",
          "to_address": "0x4d4eb02B8d86379C36E887f391a039a17D72d9E0",
          "transaction_hash": "0x4165f6f2185375050f39413833e7a77f33c9c4afd429acec0d867315d96b2ea4"
        }
      ],
      "usd_value": "1.80"
    }
  },
  "total_usd_value": "72.57"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:base
required
Available options:
arbitrum,
base,
bsc,
ethereum,
tempo
owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The address of the owner of the credit account.

Response

Successful Response

Response containing credit account balances and transfer history.

credit_account_address
string
required

The derived credit account address.

Example:

"0x4d4eb02B8d86379C36E887f391a039a17D72d9E0"

balances
Balances · object

Token balances keyed by token symbol.

Example:
{
"USDC": {
"balance": "70710737",
"balance_formatted": "70.710737",
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"token_decimals": 6,
"token_symbol": "USDC",
"transfers": [
{
"amount": "70710737",
"amount_formatted": "70.710737",
"block_number": 43830869,
"block_timestamp": "2026-03-25T15:04:45Z",
"direction": "in",
"from_address": "0x111111125421cA6dc452d289314280a0f8842A65",
"to_address": "0x4d4eb02B8d86379C36E887f391a039a17D72d9E0",
"transaction_hash": "0x949969bf49c100beca5d05bebbc99a57608a6d1f7472c621f3b00a5987bb417a"
}
],
"usd_value": "70.77"
},
"WETH": {
"balance": "876484654169830",
"balance_formatted": "0.000876",
"token_address": "0x4200000000000000000000000000000000000006",
"token_decimals": 18,
"token_symbol": "WETH",
"transfers": [
{
"amount": "876484654169830",
"amount_formatted": "0.000876",
"block_number": 43482380,
"block_timestamp": "2026-03-17T13:28:27Z",
"direction": "in",
"from_address": "0xd4a0e0b9149bcee3c920d2e00b5de09138fd8bb7",
"to_address": "0x4d4eb02B8d86379C36E887f391a039a17D72d9E0",
"transaction_hash": "0x4165f6f2185375050f39413833e7a77f33c9c4afd429acec0d867315d96b2ea4"
}
],
"usd_value": "1.80"
}
}
total_usd_value
string | null

Total USD value of all balances (sum of available values).

Example:

"72.57"