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

# Get Token Balances for a User or Token

> This endpoint retrieves all token balances for a GM Chain. Results can be optionally filtered by `tokenAddress`, `userAddress`, or both parameters together. If no filters are provided, all balances on the chain will be returned.

For caching details on this endpoint, please see: [Endpoint Caching](https://docs.ondo.finance/api-reference/endpoint-caching).




## OpenAPI

````yaml /gm-be-api-spec.json get /v1/chains/{chainId}/balances
openapi: 3.0.4
info:
  title: GM Backend API
  description: An API spec for the Ondo GM Backend API.
  version: 1.0.0
servers:
  - url: https://api.gm.ondo.finance
    description: GM Backend API
security: []
tags:
  - name: Attestations
    description: Get Mint and Redeem Attestations
  - name: Assets
    description: Get Asset Price Information
  - name: Tickers
    description: Get Ticker Information
  - name: Chains
    description: Get On Chain Data
  - name: Limits
    description: Get Trading Limits
  - name: Status
    description: Get Market and Trading Statuses
paths:
  /v1/chains/{chainId}/balances:
    get:
      tags:
        - Chains
      summary: Get Token Balances for a User or Token
      description: >
        This endpoint retrieves all token balances for a GM Chain. Results can
        be optionally filtered by `tokenAddress`, `userAddress`, or both
        parameters together. If no filters are provided, all balances on the
        chain will be returned.


        For caching details on this endpoint, please see: [Endpoint
        Caching](https://docs.ondo.finance/api-reference/endpoint-caching).
      operationId: getBalances
      parameters:
        - name: chainId
          in: path
          description: The chain's identifier including the chain name and chain id.
          required: true
          schema:
            $ref: '#/components/schemas/GMChains'
        - name: tokenAddress
          in: query
          description: Filter by a token contract address (optional).
          schema:
            type: string
        - name: userAddress
          in: query
          description: Filter by a user wallet address (optional).
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  tokens:
                    type: array
                    items:
                      $ref: '#/components/schemas/ChainToken'
                required:
                  - tokens
              example:
                tokens:
                  - tokenAddress: '0x14c3abf95cb9c93a8b82c1cdcb76d72cb87b2d4c'
                    tokenSymbol: AAPLon
                    balances:
                      - holderAddress:
                          account: '0x13116e8b4ffc8125b859ec60917fba540e59e55e'
                        balance: '0.467583800117038432'
                      - holderAddress:
                          account: '0x1db995cb2b3d9679383f0e597704a41e1521f4e1'
                        balance: '0.641380199330235549'
                  - tokenAddress: '0xf6b1117ec07684d3958cad8beb1b302bfd21103f'
                    tokenSymbol: TSLAon
                    balances:
                      - holderAddress:
                          account: '0x00000688768803bbd44095770895ad27ad6b0d95'
                        balance: '0.030594824589372964'
                      - holderAddress:
                          account: '0x1db995cb2b3d9679383f0e597704a41e1521f4e1'
                        balance: '0.088854297224463519'
                  - ...
        '400':
          description: >-
            One of the request parameters is invalid. Please see the returned
            message and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: One of the request parameters is invalid.
                    documentation: https://docs.ondo.finance/api-reference/error-codes
                    code: INVALID_SYMBOL
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: missing API key
                    code: MISSING_API_KEY
        '500':
          description: >-
            An internal server error occurred. Please see the returned message
            and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: >-
                      An internal server error occurred. Please see the returned
                      message and documentation for details.
                    code: INTERNAL_ERROR
      security:
        - apiKey: []
components:
  schemas:
    GMChains:
      type: string
      description: The chain's identifier including the chain name and chain id.
      enum:
        - ethereum-1
        - bsc-56
        - solana-900
    ChainToken:
      type: object
      properties:
        tokenAddress:
          type: string
          description: The contract address of the token on the specified chain.
        tokenSymbol:
          type: string
          description: The symbol of the token on the specified chain.
        balances:
          type: array
          items:
            $ref: '#/components/schemas/ChainBalance'
      required:
        - tokenAddress
        - tokenSymbol
        - balances
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message providing more details about the error.
        documentation:
          type: string
          description: A URL to the relevant documentation for this error.
        code:
          type: string
          description: >-
            A reason code identifying the specific type of error. See the Error
            Codes reference for a full list of possible values.
      required:
        - code
        - message
    ChainBalance:
      type: object
      properties:
        holderAddress:
          $ref: '#/components/schemas/ChainHolderAddress'
        balance:
          type: string
          description: >-
            The token balanced, represented as a string-encoded decimal with up
            to 18 digits after the decimal point.
      required:
        - holderAddress
        - balance
    ChainHolderAddress:
      type: object
      properties:
        account:
          type: string
          description: The address of the holder account.
      required:
        - account
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header

````