Codex CLI
Run Codex on bInference and connect it to Binance. Works for the Codex and ChatGPT desktop apps too.
Install Codex
Skip this if codex already runs in your terminal.
curl -fsSL https://chatgpt.com/codex/install.sh | shGet a bInference key
On binference.io, press Create key and set a daily spending limit. Keep the key in your environment:
export BINF_API_KEY="binf_..."Point Codex at bInference
Codex speaks the Responses format. Add bInference as a provider:
model_provider = "binference"
model = "openai/gpt-6.1-sol"
[model_providers.binference]
name = "bInference"
base_url = "https://binference.io/api/v1"
env_key = "BINF_API_KEY"
wire_api = "responses"Any model on Models works as model.
Add the Binance MCP Server
Run Binance's command exactly as written, then authenticate when the browser opens:
codex mcp add binance-mcp-server --url https://agent.binance.com/mcp/agentic --oauth-client-id codexGrant the fewest scopes you need: market data, account, trade or transfer. There is no withdrawal scope. The Codex and ChatGPT desktop apps pick up the same connection.
Check it, then fund the sub-account
Ask Codex:
Use the Binance MCP Server to show the current BTCUSDT price and 24-hour change.Then move trading funds in on binance.com: Profile → Dashboard → Sub-account → Asset Management → Transfer. Only you can fund the Agentic sub-account, and it starts empty.
Good to know
- Retries are built in. Codex retries
503answers, so a busy model or a short wait on our side resolves on its own. - Every order waits for you. The agent restates each order, cancel or transfer and waits for your yes.
- Two limits keep it safe: Binance's scopes and sub-account on one side, the key's spending limit here on the other. See Safety and limits.