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

> List Coinbase brokerage accounts.

## coinbase\_list\_accounts

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

**Request**

* `limit`: max number of accounts per page (Coinbase caps apply).
* `cursor`: pagination cursor from a previous response.
* `retail_portfolio_id`: legacy portfolio filter (usually not needed).

**Options**

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


## OpenAPI

````yaml api-reference/openapi.json get /tools/coinbase/list_accounts
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_accounts:
    get:
      tags:
        - Coinbase
      summary: list_accounts
      description: List Coinbase brokerage accounts.
      operationId: coinbase_list_accounts
      requestBody:
        required: false
        description: This is a request to obtain information. Your API keys are required.
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Max number of accounts per page.
                cursor:
                  type: string
                  description: Pagination cursor from a previous response.
                retail_portfolio_id:
                  type: string
                  description: Legacy portfolio filter (usually not needed).
              additionalProperties: false
            examples:
              basic:
                value:
                  limit: 5
              with_cursor:
                value:
                  limit: 50
                  cursor: ...
              legacy_filter:
                value:
                  limit: 50
                  retail_portfolio_id: 78573575-52af-5b49-a657-d8a67bf63fdd
      responses:
        '200':
          description: Accounts (OpenTools trading schema).
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: false
                  description: ''
                  properties:
                    provider:
                      type:
                        - string
                        - 'null'
                      description: Trading provider identifier. Omitted when minimal=True.
                    id:
                      type:
                        - string
                        - 'null'
                      description: Account ID.
                    status:
                      type:
                        - string
                        - 'null'
                      description: Account status.
                    currency:
                      type:
                        - string
                        - 'null'
                      description: Account currency (e.g. USD).
                    cash:
                      type:
                        - string
                        - 'null'
                      description: Cash balance.
                    buying_power:
                      type:
                        - string
                        - 'null'
                      description: Buying power.
                    equity:
                      type:
                        - string
                        - 'null'
                      description: Equity.
                    portfolio_value:
                      type:
                        - string
                        - 'null'
                      description: Portfolio value.
                    created_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: Created timestamp.
                    provider_fields:
                      type: object
                      additionalProperties: true
                      description: >-
                        Extra provider-specific fields (omitted when
                        minimal=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_accounts"],
            )

````