Skip to main content
Coinbase for Agents gives your AI apps access to Coinbase Advanced Trade to trade crypto, preview orders, and manage portfolios from any AI harness or the terminal.

Get started

Portfolio isolation: Create a separate Advanced portfolio, fund it with only what you’re willing to risk, and scope your agent’s access to that portfolio. This limits the blast radius if the agent makes an unexpected trade.
To disconnect Coinbase from an app, go to Coinbase Account > Security > Connections and revoke the connection.

What’s supported today

Coinbase for Agents currently supports:
  • Spot crypto trading: buy and sell 900+ trading pairs on Coinbase Advanced Trade
  • Isolated agent portfolios: spot crypto only, scoped to a specific portfolio selected when logging in or creating an API key
  • Portfolio management: Check balances and positions across your account
  • USDC/USD conversions: instant zero-fee conversions between USDC and USD
Coming soon: x402 payments for agent-consumed services (paywalled research, data APIs, compute), equities, prediction markets, and additional asset classes. If it’s on Coinbase, your agent will be able to trade it.

Guiding agents to place orders

Based on order-creation testing across Claude and ChatGPT clients and models connected to the Coinbase for Agents remote MCP server:
  • Web clients for Claude and ChatGPT reliably create orders from clear, well-specified instructions, across models. The exception is GPT-5.5 Pro, which doesn’t appear to automatically discover the connected MCP.
  • Claude previews and requests confirmation in the chat to create the order, whereas ChatGPT creates the order in one turn.
  • Claude Desktop refuses most orders that the web client creates; Sonnet 4.6 is the exception, creating orders when the request includes an explicit authorization (e.g. I authorize you to buy…).
  • Lower-tier models may create orders with the wrong product, for example, ETH-USD instead of ETH-USDC. Prompt for approval to confirm before creating the order.
For reliable order creation, specify the order type, the amount and asset or currency, and the portfolio in one instruction, for example, Buy 1 USDC of ETH in my agent portfolio. Vague or partial requests require the model to infer and resolve additional details.

Best practices

  • Scope the agent’s access to the portfolio(s) you want it to use — a focused set gives the agent a clear, unambiguous target.
  • Higher-reasoning models translate more complex intent and recover from underspecified orders; use one for multi-step or vague requests, e.g. check my balance, then put 5% of my USDC into BTC.

Tools

Market data

CLI commandMCP toolDescription
coinbase products get <product_id>products_getPrice, 24-hour volume/change, and size limits
coinbase products listproducts_listAll tradable products (900+ results, filter with symbol or --jq)
coinbase products list symbol==USDproducts_listProducts with USD as the base or quote currency
coinbase products ticker <product_id>products_tickerRecent trades with best bid/ask
coinbase products book <product_id>products_bookFull order book (bids + asks)
coinbase products candles <product_id> granularity==1hproducts_candlesOHLCV price history
coinbase products best-bid-ask product_ids=BTC-USDCurrent best bid and ask

Orders

CLI commandMCP toolDescription
coinbase orders preview ...orders_previewDry-run: returns fill estimate, fees, and slippage
coinbase orders create ...orders_createExecute an order
coinbase orders listorders_listAll orders with status, fill percentage, and fees
coinbase orders get <order_id>orders_getSingle order detail
coinbase orders fillsorders_fillsAll trade fills with price, size, and commission
coinbase orders edit <order_id>orders_editModify an existing order
coinbase orders cancel order_ids:='["<id>"]'orders_cancelBatch cancel orders
coinbase orders close-position product_id=<id> size=<n>orders_close_positionClose an open position
Market order: executes immediately at the best available price.
# Buy $100 of BTC (quote_size = USD amount to spend)
coinbase orders create product_id=BTC-USD side=BUY type=market quote_size=100

# Sell 0.5 ETH (base_size = amount of the asset to sell)
coinbase orders create product_id=ETH-USD side=SELL type=market base_size=0.5
Limit order: executes at the specified price or better.
coinbase orders create product_id=BTC-USD side=BUY type=limit \
  base_size=0.001 limit_price=50000
Market buys use quote_size (the amount to spend in USD). Market sells use base_size (the amount of the asset to sell). When switching between buy and sell, explicitly clear the other field (e.g., add quote_size= to clear a stale value).

Portfolios and balances

CLI commandMCP toolDescription
coinbase balancebalanceAll account balances (crypto + fiat)
coinbase portfolios listportfolios_listAll portfolios with UUID, name, and type
coinbase portfolios get <portfolio_id>portfolios_getBreakdown: balances, positions, allocation %, unrealized PnL
coinbase portfolios create name=<name>portfolios_createCreate a new portfolio
coinbase portfolios edit <portfolio_id> name=<n>portfolios_editRename a portfolio
coinbase portfolios delete <portfolio_id>portfolios_deleteDelete a portfolio (must be empty)
coinbase transfer amount=<n> currency=<c> from=<uuid> to=<uuid>transferMove funds between portfolios

Conversions

CLI commandMCP toolDescription
coinbase convert quote from=<c> to=<c> amount=<n>convert_quoteGet a conversion quote (rate + fee)
coinbase convert execute <quote_id> from=<c> to=<c>convert_executeExecute a quoted conversion
coinbase convert get <quote_id>convert_getCheck conversion status

Info and session

CLI commandMCP toolDescription
coinbase feesfeesFee tier (maker/taker rates) and 30-day volume
coinbase envView and manage credential environments
coinbase mcpStart the local MCP server (stdio)

Global flags

These flags work on any CLI command:
FlagWhat it doesWhen to use
--watchLive-stream updates over WebSocket (local CLI + CDP API key; not OAuth)Only on orders list, products ticker, products book — e.g. watch a price live, or add --until "price > 70k" to exit on a condition
--templatePrint the expected request body without sendingBefore your first call to any command. Discover field names instead of guessing.
--dry-runAssemble the full request and print it without sendingBefore any write operation to verify what will be sent
--jq <expr>Filter the JSON response with a jq expressionExtract specific fields: --jq '.price', --jq '.accounts[].currency'
-e <env>Override the active environmentSwitch between configured environments

Field syntax

CLI commands use the following field syntax:
SyntaxMeaningExample
key=valueString body fieldproduct_id=BTC-USD
key:=valueRaw JSON (arrays, numbers, Boolean values)order_ids:='["abc","def"]'
key==valueQuery parameterproduct_type==SPOT
@file.jsonLoad body from a JSON file@order.json

Troubleshooting

ErrorCauseFix
HTTP 401Expired credentialsCreate a new key in the CDP Portal
HTTP 403 Missing required scopesAPI key missing Trade or Transfer permissionCheck key permissions in the Portal
insufficient fundAccount balance too lowRun coinbase balance to check available funds
coinbase: command not foundCLI not on PATHRun npm install -g @coinbase/coinbase-cli; on Windows, add %APPDATA%\npm to PATH
MISSING_FIELDSRequired fields not providedRun coinbase <command> --template to see expected fields
INVALID_VALUEUnrecognized enum valueCheck the error message for accepted values
INVALID_FORMATWrong date/time formatUse RFC 3339 with timezone (e.g., 2024-01-01T00:00:00Z)

Disclaimer

AI agents can make errors, misinterpret instructions, or produce inaccurate output. Coinbase does not guarantee the accuracy of any action taken by an AI agent using this product. You are solely responsible for reviewing and authorizing any trades, transfers, or account changes made through agentic workflows.