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

# get_portfolio_breakdown

> Return a portfolio breakdown (balances + positions) for a Coinbase portfolio. Requires a portfolio_uuid. Currency defaults to USD.

## coinbase\_get\_portfolio\_breakdown

```python
import os
from opentools import trading

tools = trading.coinbase(
    api_key=os.environ["COINBASE_KEY"],
    api_secret=os.environ["COINBASE_SECRET"],
    model="openai",
    minimal=True,
    include=["coinbase_get_portfolio_breakdown"],
)
```

**Request**

* `portfolio_uuid` (required)
* `currency` (optional, defaults to `USD`)

**Options**

* `include` / `exclude`: filter which tools are exposed (use full names like `coinbase_get_portfolio_breakdown`).
* `minimal`: omit `provider` and `provider_fields` when `True`.


## OpenAPI

````yaml api-reference/openapi.json get /tools/coinbase/get_portfolio_breakdown
openapi: 3.1.0
info:
  title: OpenTools Trading Tools
  version: 0.1.0
  description: >-
    Reference for OpenTools trading tool calls. These are SDK tools, documented
    as virtual endpoints for clarity.
servers: []
security: []
tags:
  - name: Alpaca
    description: >-
      Read-only account + assets + clock + orders + portfolio history +
      positions.
  - name: Coinbase
    description: >-
      Accounts + portfolios + portfolio breakdown + positions (derived) +
      brokerage products + orders (if available).
paths:
  /tools/coinbase/get_portfolio_breakdown:
    get:
      tags:
        - Coinbase
      summary: get_portfolio_breakdown
      description: >-
        Return a portfolio breakdown (balances + positions) for a Coinbase
        portfolio. Requires a portfolio_uuid. Currency defaults to USD.
      operationId: coinbase_get_portfolio_breakdown
      requestBody:
        required: false
        description: This is a request to obtain information. Your API keys are required.
        content:
          application/json:
            schema:
              type: object
              properties:
                portfolio_uuid:
                  type: string
                  description: Coinbase portfolio UUID (required).
                currency:
                  type: string
                  description: 'Quote currency for valuation (default: USD).'
                  default: USD
              required:
                - portfolio_uuid
              additionalProperties: false
            examples:
              usd:
                value:
                  portfolio_uuid: 78573575-52af-5b49-a657-d8a67bf63fdd
                  currency: USD
      responses:
        '200':
          description: PortfolioBreakdown (OpenTools trading schema).
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  provider:
                    type:
                      - string
                      - 'null'
                  portfolio:
                    type: object
                    additionalProperties: false
                    properties:
                      provider:
                        type:
                          - string
                          - 'null'
                      id:
                        type:
                          - string
                          - 'null'
                      name:
                        type:
                          - string
                          - 'null'
                      type:
                        type:
                          - string
                          - 'null'
                      deleted:
                        type:
                          - boolean
                          - 'null'
                      provider_fields:
                        type: object
                        additionalProperties: true
                  balances:
                    type: object
                    additionalProperties: false
                    properties:
                      total_balance:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      total_futures_balance:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      total_cash_equivalent_balance:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      total_crypto_balance:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      futures_unrealized_pnl:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      perp_unrealized_pnl:
                        type: object
                        additionalProperties: false
                        properties:
                          value:
                            type:
                              - string
                              - 'null'
                          currency:
                            type:
                              - string
                              - 'null'
                      provider_fields:
                        type: object
                        additionalProperties: true
                  spot_positions:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      description: ''
                      properties:
                        provider:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Trading provider identifier. Omitted when
                            minimal=True.
                        symbol:
                          type: string
                          description: Instrument symbol (e.g. "AAPL", "BTCUSD").
                        qty:
                          type:
                            - string
                            - 'null'
                          description: Position size.
                        avg_entry_price:
                          type:
                            - string
                            - 'null'
                          description: Average entry price.
                        current_price:
                          type:
                            - string
                            - 'null'
                          description: Latest price used for valuation.
                        market_value:
                          type:
                            - string
                            - 'null'
                          description: Current position market value.
                        unrealized_pl:
                          type:
                            - string
                            - 'null'
                          description: Unrealized profit/loss.
                        unrealized_plpc:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Unrealized profit/loss percent (factor of 1, not
                            100).
                        side:
                          type:
                            - string
                            - 'null'
                          enum:
                            - long
                            - short
                          description: Position direction.
                        provider_fields:
                          type: object
                          additionalProperties: true
                          description: >-
                            Extra provider-specific fields (omitted when
                            minimal=True).
                  perp_positions:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      description: ''
                      properties:
                        provider:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Trading provider identifier. Omitted when
                            minimal=True.
                        symbol:
                          type: string
                          description: Instrument symbol (e.g. "AAPL", "BTCUSD").
                        qty:
                          type:
                            - string
                            - 'null'
                          description: Position size.
                        avg_entry_price:
                          type:
                            - string
                            - 'null'
                          description: Average entry price.
                        current_price:
                          type:
                            - string
                            - 'null'
                          description: Latest price used for valuation.
                        market_value:
                          type:
                            - string
                            - 'null'
                          description: Current position market value.
                        unrealized_pl:
                          type:
                            - string
                            - 'null'
                          description: Unrealized profit/loss.
                        unrealized_plpc:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Unrealized profit/loss percent (factor of 1, not
                            100).
                        side:
                          type:
                            - string
                            - 'null'
                          enum:
                            - long
                            - short
                          description: Position direction.
                        provider_fields:
                          type: object
                          additionalProperties: true
                          description: >-
                            Extra provider-specific fields (omitted when
                            minimal=True).
                  futures_positions:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      description: ''
                      properties:
                        provider:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Trading provider identifier. Omitted when
                            minimal=True.
                        symbol:
                          type: string
                          description: Instrument symbol (e.g. "AAPL", "BTCUSD").
                        qty:
                          type:
                            - string
                            - 'null'
                          description: Position size.
                        avg_entry_price:
                          type:
                            - string
                            - 'null'
                          description: Average entry price.
                        current_price:
                          type:
                            - string
                            - 'null'
                          description: Latest price used for valuation.
                        market_value:
                          type:
                            - string
                            - 'null'
                          description: Current position market value.
                        unrealized_pl:
                          type:
                            - string
                            - 'null'
                          description: Unrealized profit/loss.
                        unrealized_plpc:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Unrealized profit/loss percent (factor of 1, not
                            100).
                        side:
                          type:
                            - string
                            - 'null'
                          enum:
                            - long
                            - short
                          description: Position direction.
                        provider_fields:
                          type: object
                          additionalProperties: true
                          description: >-
                            Extra provider-specific fields (omitted when
                            minimal=True).
                  provider_fields:
                    type: object
                    additionalProperties: true
        '401':
          description: Unauthorized (missing/invalid credentials).
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  message:
                    type: string
                  domain:
                    type: string
                  provider:
                    type: string
                  details: {}
                required:
                  - message
        '429':
          description: Rate limited by provider or transport.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  message:
                    type: string
                  domain:
                    type: string
                  provider:
                    type: string
                  details: {}
                required:
                  - message
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os
            from opentools import trading

            tools = trading.coinbase(
                api_key=os.environ["COINBASE_KEY"],
                api_secret=os.environ["COINBASE_SECRET"],
                model="openai",
                minimal=True,
                include=["coinbase_get_portfolio_breakdown"],
            )

````