Skip to main content
OpenTools cleanly integrates with Coinbase, covering a range of tooling from handling multiple portfolios and accounts to identifying a single order. This provider is designed for agentic flows - using framework or model adapater - so that consumers alike are able to find their information quickly and accurately. It provides additional capabilites such as get_portfolio_breakdown that is unique to Coinbase, given the response structure of Coinbase Advanced API.
Coinbase support is read-only for now. Order placement and trade execution are not yet exposed but are currently on the roadmap

What are the exposed tools?

The following tools are available when using the Coinbase provider:
ToolDescription
coinbase_get_accountA single brokerage account (primary by default, or by UUID)
coinbase_list_accountsAll brokerage accounts for this user
coinbase_list_portfoliosAvailable portfolios (id, name, type, deleted)
coinbase_get_portfolio_breakdownSnapshot of balances + positions for a portfolio UUID
coinbase_list_positionsFlattened positions derived from portfolio breakdown
coinbase_list_assetsBrokerage products (e.g. BTC-USD) mapped to Asset
coinbase_get_assetA single product by product_id (e.g. BTC-USD)
coinbase_list_ordersOrders with optional filters (status, time window, symbols, side)
coinbase_get_orderA single order by order_id
Coinbase positions are derived from portfolio breakdown and flattened across spot/perp/futures positions where available. It is also important to note that a Clock is not supported since trading hours are 24/7 for crypto.

Quick example

Below is a quick way to construct a Coinbase trading service which exposes all available tools:
import os
from opentools import trading

tools = trading.coinbase(
    api_key=os.environ["COINBASE_SECRET_KEY"],
    api_secret=os.environ["COINBASE_PEM"],
    model="openai",
    paper=False,
    minimal=True,
)
Once constructed, tools can be passed into a tool loop, like with run_with_tools, or bound to a framework adapter.
Coinbase only uses the live option so paper has to be False otherwise it will be redirected each time.

What are the authentication options?

Our Coinbase integrations supports multiple auth patterns:
  • API key + PEM private key (recommended)
  • Bearer token (pre-built token)
  • Authorization header mapping (custom)
If you provide both API credentials and a bearer token, OpenTools will raise an AuthError to avoid ambiguous configuration. The simplest option is to provide an API key name and PEM private key. OpenTools will generate a short-lived JWT per request (signed with your PEM key) and attach it as a Bearer token automatically.

What are all the configuration options?

Coinbase supports all shared Trading features:
  • Paper/live
    Use paper=True to target Coinbase’s sandbox environment.
  • Minimal
    Set minimal=True to omit provider metadata and reduce token usage.
  • Include/Exclude
    Control which tools are exposed to the model using include and exclude.
  • Framework binding
    Optionally pass framework=langgraph or framework=pydanticai to expose tools in a framework-native format.
These options behave consistently across all trading providers.

Next steps