> ## 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.

# list_portfolios

> List Coinbase portfolios for this user as canonical Portfolio models (id, name, type, deleted).

## coinbase\_list\_portfolios

```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_list_portfolios"],
)
```

**Request**

* Optional `portfolio_type`: filter Coinbase portfolios by type.

**Options**

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


## OpenAPI

````yaml api-reference/openapi.json get /tools/coinbase/list_portfolios
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/list_portfolios:
    get:
      tags:
        - Coinbase
      summary: list_portfolios
      description: >-
        List Coinbase portfolios for this user as canonical Portfolio models
        (id, name, type, deleted).
      operationId: coinbase_list_portfolios
      requestBody:
        required: false
        description: This is a request to obtain information. Your API keys are required.
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                portfolio_type:
                  type: string
                  description: >-
                    Optional portfolio type filter (Coinbase terminology), e.g.
                    'DEFAULT', 'CONSUMER', 'INTX', or 'UNDEFINED'.
            examples:
              all:
                value: {}
              default_only:
                value:
                  portfolio_type: DEFAULT
      responses:
        '200':
          description: List of portfolios (OpenTools trading schema).
          content:
            application/json:
              schema:
                type: array
                items:
                  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
        '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_list_portfolios"],
            )

````