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

# Get aggregated balance

> Fetches the aggregated balance of all supported assets for a given smart account address, with an option to filter by specific assetId`s.



## OpenAPI

````yaml get /v2/balances/aggregated-balance
openapi: 3.1.0
info:
  version: 1.6.2
  title: OneBalance API
  description: >
    # OneBalance API


    The OneBalance API provides a programmatic interface for managing OneBalance
    resources using standard HTTP requests. The API documentation includes a
    design and technology overview, followed by detailed endpoint information.


    ## Features


    OneBalance API provides a complete chain abstraction toolkit:


    - Smart Account Management: Predict addresses and deploy accounts

    - Cross-Chain Balances: View aggregated balances across multiple chains

    - Multichain Transactions: Execute transfers and swaps using aggregated
    balances

    - Transaction Status: Track multichain transaction history and status

    - Token Aggregation: Access unified token lists and pricing information


    Enterprise API Access: Need higher rate limits, dedicated infrastructure, or
    custom SLAs? [Contact our sales](mailto:sales@onebalance.io) team for
    enterprise API solutions.


    ## Base URL


    OneBalance API is built on REST principles and is served over HTTPS. To
    ensure data privacy, unencrypted HTTP is not supported.


    The Base URL for all API endpoints is:


    ```bash

    https://be.onebalance.io/api

    ```


    ## Quickstart


    Try our reference application at
    [app.onebalance.io](https://app.onebalance.io) to see the API in action or
    jump straight into our [API
    Reference](https://docs.onebalance.io/api-reference/account/predict-address)
    to start building.


    ## Authentication


    The OneBalance API uses API keys to authenticate requests. All API requests
    require authentication using an API key passed in the `x-api-key` header:


    ```bash

    curl -X 'GET' \
      'https://be.onebalance.io/api/path-to/endpoint' \
      -H 'x-api-key: 42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11'
    ```


    A public API key is available for testing purposes with limited usage:
    **42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11**


    All API requests must be made over
    [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP
    will fail. API requests without authentication will also fail.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: OneBalance Support
    email: support@onebalance.io
  termsOfService: https://onebalance.io/terms-of-service
servers:
  - url: https://be.onebalance.io/api
    description: Production environment
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    x-displayName: Smart Accounts
    description: >-
      Manage and predict addresses for OneBalance smart accounts. These accounts
      enable features like resource locks and streamlined cross-chain
      interactions.
  - name: Assets
    x-displayName: Aggregated Assets
    description: >-
      Retrieve details about supported aggregated assets. Aggregated assets
      represent a unified view of a token across multiple chains, simplifying
      cross-chain operations.
  - name: Balances
    x-displayName: Aggregated Balances
    description: >-
      Access and track aggregated asset balances for user accounts. These
      balances reflect a user's total holdings of an asset across all supported
      chains, usable for multichain transactions.
  - name: Chains
    x-displayName: Supported Chains
    description: >-
      List and get details about the blockchain networks currently integrated
      with and supported by the OneBalance platform.
  - name: Status
    x-displayName: Transaction Status & History
    description: >-
      Track the real-time status of quote executions and retrieve complete
      transaction histories for user accounts, offering visibility into
      multichain operations.
  - name: Quotes
    x-displayName: Quotes & Execution
    description: >-
      Request, prepare, and execute quotes for various cross-chain operations
      including asset transfers, swaps, and arbitrary contract interactions.
      These endpoints facilitate the core transaction lifecycle on OneBalance.
paths:
  /v2/balances/aggregated-balance:
    get:
      tags:
        - Balances
      summary: Get aggregated balance
      description: >-
        Fetches the aggregated balance of all supported assets for a given smart
        account address, with an option to filter by specific assetId`s.
      operationId: getAggregatedBalance
      parameters:
        - name: assetId
          required: false
          in: query
          description: Additional token assetIds to include, separated by commas
          schema:
            type: string
            example: eip155:1/erc20:0xae7ab96520de3a18e5e111b5eaab095312d7fe84
        - name: address
          required: true
          in: query
          description: The address for which to retrieve the balance (e.g., 0x123...)
          schema:
            type: string
            example: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
            pattern: ^0x[a-fA-F0-9]{40}$
      responses:
        '200':
          description: Successfully retrieved aggregated balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/aggregated-balance-v2-response'
              example:
                balanceByAggregatedAsset:
                  - aggregatedAssetId: ob:eth
                    balance: '26720629499317191152'
                    individualAssetBalances:
                      - assetType: eip155:42161/slip44:60
                        balance: '43872973277400073'
                        fiatValue: 77.727114
                      - assetType: eip155:8453/slip44:60
                        balance: '26488136306212020002'
                        fiatValue: 46927.441806
                      - assetType: eip155:10/slip44:60
                        balance: '188620219827771077'
                        fiatValue: 334.167126
                    fiatValue: 47339.336046
                  - aggregatedAssetId: ob:usdc
                    balance: '843936437'
                    individualAssetBalances:
                      - assetType: >-
                          eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831
                        balance: '62459466'
                        fiatValue: 62.456468
                      - assetType: >-
                          eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
                        balance: '774598041'
                        fiatValue: 774.563184
                      - assetType: >-
                          eip155:10/erc20:0x0b2c639c533813f4aa9d7837caf62653d097ff85
                        balance: '5845251'
                        fiatValue: 5.844988
                      - assetType: >-
                          eip155:43114/erc20:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e
                        balance: '1033679'
                        fiatValue: 1.033632
                    fiatValue: 843.898272
                balanceBySpecificAsset:
                  - assetType: eip155:1/erc20:0xae7ab96520de3a18e5e111b5eaab095312d7fe84
                    balance: '0'
                    fiatValue: 0
                totalBalance:
                  fiatValue: 78138.51832
        '401':
          $ref: '#/components/responses/unauthorized'
components:
  schemas:
    aggregated-balance-v2-response:
      type: object
      properties:
        balanceByAggregatedAsset:
          type: array
          description: List of aggregated asset balances for the account
          items:
            $ref: '#/components/schemas/asset-balance'
          example:
            - aggregatedAssetId: ob:eth
              balance: '26720629499317191152'
              individualAssetBalances:
                - assetType: eip155:42161/slip44:60
                  balance: '43872973277400073'
                  fiatValue: 77.727114
              fiatValue: 47339.336046
        balanceBySpecificAsset:
          type: array
          description: >-
            List of specific asset balances that were queried by assetId
            parameter
          items:
            $ref: '#/components/schemas/specific-asset-balance'
          example:
            - assetType: eip155:1/erc20:0xae7ab96520de3a18e5e111b5eaab095312d7fe84
              balance: '0'
              fiatValue: 0
        totalBalance:
          $ref: '#/components/schemas/total-balance'
      required:
        - balanceByAggregatedAsset
        - balanceBySpecificAsset
        - totalBalance
    asset-balance:
      type: object
      properties:
        aggregatedAssetId:
          type: string
          description: The aggregated asset ID (e.g., ob:eth, ob:usdc)
          example: ob:eth
        balance:
          type: string
          description: The total balance of this asset across all chains
          example: '26720629499317191152'
        individualAssetBalances:
          type: array
          description: Balances of individual assets that make up this aggregated asset
          items:
            $ref: '#/components/schemas/individual-asset-balance'
          example:
            - assetType: eip155:42161/slip44:60
              balance: '43872973277400073'
              fiatValue: 77.727114
        fiatValue:
          type: number
          description: The total fiat value of this asset
          example: 47166.608328
      required:
        - aggregatedAssetId
        - balance
        - individualAssetBalances
        - fiatValue
    specific-asset-balance:
      type: object
      properties:
        assetType:
          type: string
          description: The CAIP-19 asset type identifier
          example: eip155:1/erc20:0xae7ab96520de3a18e5e111b5eaab095312d7fe84
        balance:
          type: string
          description: The balance of this specific asset
          example: '0'
        fiatValue:
          type: number
          description: The fiat value of this specific asset
          example: 0
      required:
        - assetType
        - balance
        - fiatValue
    total-balance:
      type: object
      properties:
        fiatValue:
          type: number
          description: The total fiat value of all assets
          example: 77871.483693
      required:
        - fiatValue
    HttpUnauthorizedException:
      type: object
      properties:
        error:
          type: string
          description: Error name
          example: UnauthorizedException
        message:
          type: string
          description: Error message
          example: Invalid or missing API key
        statusCode:
          type: number
          description: Error status code
          example: 401
        timestamp:
          type: string
          description: Error timestamp
          example: '2024-12-18T14:38:24.793Z'
        path:
          type: string
          description: Error path
          example: /api/account/predict-address
      required:
        - error
        - message
        - statusCode
        - timestamp
        - path
    individual-asset-balance:
      type: object
      properties:
        assetType:
          type: string
          description: The CAIP-19 asset type identifier
          example: eip155:42161/slip44:60
        balance:
          type: string
          description: The balance of this asset
          example: '43872973277400073'
        fiatValue:
          type: number
          description: The fiat value of this asset
          example: 77.435798
      required:
        - assetType
        - balance
        - fiatValue
  responses:
    unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpUnauthorizedException'
          example:
            error: UnauthorizedException
            message: Invalid or missing API key
            statusCode: 401
            timestamp: '2024-12-18T14:38:24.793Z'
            path: /api/xxx/xxx
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        The OneBalance API uses API keys to authenticate requests. All API
        requests require authentication using an API key passed in the
        `x-api-key` header:


        ```bash

        curl -X 'GET' \
          'https://be.onebalance.io/api/path-to/endpoint' \
          -H 'x-api-key: ${ONEBALANCE_API_KEY}' \
          ...
        ```


        A public API key is available for testing purposes with limited usage:
        `42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11`.


        All API requests must be made over HTTPS. Calls made over plain HTTP
        will fail. API requests without authentication will also fail.


        Learn how to generate API access tokens at [OneBalance
        Docs](https://docs.onebalance.io).

````