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

# Get balance for portfolio/asset

> Retrieves the balance for a given portfolio and asset.

<Tabs groupId="programming-language">
  <Tab value="Java" title="Java">
    ```java theme={null}
    PortfoliosService portfoliosService = IntxServiceFactory.createPortfoliosService(client);
    GetBalanceForPortfolioAssetRequest request = new GetBalanceForPortfolioAssetRequest.Builder()
        .portfolio("portfolio_id")
        .asset("BTC")
        .build();
    GetBalanceForPortfolioAssetResponse response = portfoliosService.getBalanceForPortfolioAsset(request);
    ```

    For more information, please visit the [INTX Java SDK](https://github.com/coinbase-samples/intx-sdk-java).
  </Tab>

  <Tab value=".NET" title=".NET">
    ```cs theme={null}
    var portfoliosService = new PortfoliosService(client);
    var request = new GetBalanceForPortfolioAssetRequest(
        Portfolio: "portfolio_id",
        Asset: "BTC",
    );
    var response = portfoliosService.GetBalanceForPortfolioAsset(request);
    ```

    For more information, please visit the [INTX .NET SDK](https://github.com/coinbase-samples/intx-sdk-dotnet).
  </Tab>

  <Tab value="Go" title="Go">
    ```go theme={null}
    portfoliosSvc := portfolios.NewPortfoliosService(client)
    request := &portfolios.GetAssetBalanceRequest{
        Portfolio: "portfolio_id",
        Asset: "BTC",
    }
    response, err := portfoliosSvc.GetAssetBalance(context.Background(), request)
    ```

    For more information, please visit the [INTX Go SDK](https://github.com/coinbase-samples/intx-sdk-go).
  </Tab>

  <Tab value="Python" title="Python">
    ```python theme={null}
    client = IntxClient()
    request = GetBalanceForPortfolioAssetRequest(
        portfolio="portfolio_id",
        asset="BTC",
    )
    response = client.get_balance_for_portfolio_asset(request)
    ```

    For more information, please visit the [INTX Python SDK](https://github.com/coinbase-samples/intx-sdk-py).
  </Tab>

  <Tab value="Typescript" title="TS/JS">
    ```js theme={null}
    const portfoliosService = new PortfoliosService(client);

    portfoliosService.getAssetBalance({
        portfolio: 'PORTFOLIO_ID_HERE',
        asset: 'ETH',
    }).then(async (response) => {
        console.log('Portfolio Asset Balance: ', response);
    })
    ```

    For more information, please visit the [INTX TS SDK](https://github.com/coinbase-samples/intx-sdk-ts).
  </Tab>

  <Tab value="CLI" title="CLI">
    ```
    intxctl get-balance-for-asset --help
    ```

    For more information, please visit the [INTX CLI](https://github.com/coinbase-samples/intx-cli).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /api/v1/portfolios/{portfolio}/balances/{asset}
openapi: 3.0.3
info:
  title: REST API
  description: >
    # Welcome to Coinbase INTX API

    ## Introduction

    The INTX APIs allow institutions to trade and manage orders on the
    International Exchange. The following API pages detail various REST API
    endpoints we offer.

    ## Getting Started

    To get started, please visit one of the following pages:

    - [Quickstart](/international-exchange/introduction/quickstart)

    -
    [Overview](/api-reference/international-exchange-api/rest-api/introduction)

    -
    [Authentication](/api-reference/international-exchange-api/rest-api/authentication)

    - [Rate Limits](/international-exchange/introduction/rate-limits-overview)

    ## FIX API

    - [FIX API reference](/international-exchange/fix-api/fix-api-overview)

    ## WebSocket API

    - [WebSocket API
    reference](/international-exchange/websocket-feed/websocket-overview)
  version: '1.0'
servers:
  - url: https://api.international.coinbase.com
security: []
paths:
  /api/v1/portfolios/{portfolio}/balances/{asset}:
    get:
      tags:
        - Portfolios
      summary: Get balance for portfolio/asset
      description: Retrieves the balance for a given portfolio and asset.
      operationId: getPortfolioBalance
      parameters:
        - name: portfolio
          in: path
          description: >-
            Identifies the portfolio by UUID (e.g.,
            `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g.,
            `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: >-
            Identifies the asset by name (e.g., `BTC`), UUID (e.g.,
            `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g.,
            `1482439423963469`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Balance information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioBalance_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
components:
  schemas:
    PortfolioBalance_v1:
      type: object
      properties:
        asset_id:
          description: The unique identifier of the asset
          type: string
          example: 14thr7fc-1-1
        asset_name:
          description: Name of the asset
          type: string
          example: BTC
        asset_uuid:
          description: The UUID of the asset
          type: string
          format: uuid
          example: d92669ba-8a04-46d8-9b28-a2bbaeee3b9a
        quantity:
          description: The total amount of the asset in the portfolio
          type: string
          example: 1.75
        hold:
          description: The amount of the balance held from trading activity
          type: string
          example: 0.5
        hold_available_for_collateral:
          description: The amount of the held balance eligible for collateral
          type: string
          example: 0.5
        transfer_hold:
          description: The amount of the balance held from a pending transfer
          type: string
          example: 0.25
        collateral_value:
          description: The collateral value provided by this asset balance
          type: string
          example: 0.9
        max_withdraw_amount:
          description: >-
            The maximum amount of this asset that can be withdrawn on-chain at
            this time given margin requirement constraints
          type: string
          example: 0.9
        loan:
          description: The total quantity of the asset borrowed by the portfolio
          type: string
          example: 1
        loan_collateral_requirement:
          description: The notional collateral requirement to hold the loan
          type: string
          example: 0
        pledged_collateral_quantity:
          description: The amount of the asset pledged as collateral
          type: string
          example: 0.5
        loan_initial_margin_contribution:
          description: >-
            The notional amount this loan contributes to the portfolio initial
            margin notional value
          format: string
          example: 0.07
        collateral_backed_overdraft_loan:
          description: >-
            The quantity of the asset automatically borrowed by the portfolio to
            cover USDC deficits
          type: string
          example: 100.5
        user_requested_loan:
          description: >-
            The quantity of the asset borrowed by the portfolio upon explicit
            request
          type: string
          example: 548.5
        unreconciled_amount:
          description: >-
            The difference between the portfolio's exchange and external balance
            that has not yet been reconciled, for external collateral clients
            only
          type: string
          example: 10.5
        max_undelegate_amount:
          description: >-
            The maximum amount that can be undelegated from the exchange, for
            external collateral clients only
          type: string
          example: 15
  securitySchemes:
    auth_client_id:
      type: apiKey
      name: CB-ACCESS-KEY
      in: header
      description: The Client ID that owns the API Key for the request
    auth_passphrase:
      type: apiKey
      name: CB-ACCESS-PASSPHRASE
      in: header
      description: The pass phrase affiliated with the API Key
    auth_signature:
      type: apiKey
      name: CB-ACCESS-SIGN
      in: header
      description: >-
        A HMAC SHA-256 signature using the API Key secret on the string
        TIMESTAMP, METHOD, REQUEST_PATH, BODY
    auth_timestamp:
      type: apiKey
      name: CB-ACCESS-TIMESTAMP
      in: header
      description: The timestamp of when the request is being made

````