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

# Coinbase, OKX, Binance and Bybit agent SDK

> Trade spot pairs on a connected Coinbase, OKX, Binance or Bybit account.

`agent.coinbase`, `agent.okx`, `agent.binance` and `agent.bybit` share one shape and trade spot only, from the exchange account the session was started with. They exclude margin, derivatives, trigger orders and withdrawals. Orders and order reads require a hosted target or a paper session; local `circuit run` rejects them.

`markets.list({ base?, quote? })` returns the exchange's spot pairs with `tradable` and order rules (`minimumSize`, `minimumNotional`, `sizeStep`, `priceTick`); `markets.list({ base: "BTC", quote: "USDT" })` finds one pair. A pair's `asset` is `<VENUE>:<base>/<quote>` in the exchange's own asset codes, such as `BINANCE:BTC/USDT` or `COINBASE:ETH/USD`; pass it unchanged.

`orders.create(order, options?)` takes the [order shape every venue shares](https://docs.circuit.org/agent-developers/sdk-reference/hyperliquid.md): `{ kind: "spotBuy" | "spotSell", asset, amount, execution? }`, with `amount` `{ size }` in the base asset or `{ value }` in the quote asset, rounded down to the pair's `sizeStep`. Circuit refuses an order below the pair's `minimumSize` or `minimumNotional` with `BELOW_MINIMUM` before anything is sent. Omit `execution` for a market order within 1% of the mid; `{ kind: "limit", price, timeInForce }` rests per timeInForce ("gtc" rests, "ioc" fills what crosses now, "alo" is post-only). Its result is the venue order every venue returns. `orders.listOpen()` returns the session's resting orders, and `orders.cancel({ orderId, asset }, options?)` cancels one the session placed. options take a [`once` name](./error-handling).

Circuit signs each order once and submits it once. An order the exchange never reports by the end of its signed request's validity window settles as not executed. Size from the allocation balance; fills record net amounts and fee currencies.

## Connect a credential

`circuit exchange connect --venue coinbase|okx|binance|bybit --credentials-prompt` connects an account (OKX also asks for its passphrase). Circuit reads the key's permissions from the exchange: a key that can trade spot gets trade access, any other key read access.

| Exchange | Trade permission |
| - | - |
| Coinbase | Secret API key with the Ed25519 signature algorithm, View and Trade |
| OKX | Read and Trade |
| Binance | Enable Reading and Enable Spot & Margin Trading |
| Bybit | Read-Write with Spot Trade |

Declare the venue under [`exchangeCredentials`](../getting-started/circuit-toml-reference#exchangecredentials-section), then pass the account ID from `circuit exchange list` as `--exchange-credential <id>` with a hosted target.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.