Skip to content
Small team, full backlog, zero orders dropped. Support replies are slower than we’d like. Read our status update → Zero orders dropped. Status → 📬 Check your spam folder — most of our replies land there. We do answer. Status update → 📬 Check your spam folder. Status →

Miner API Command Reference — cgminer/BOSminer on Port 4028

Every ASIC miner exposes a JSON API on TCP port 4028 — the cgminer/BMMiner/BOSminer socket that fleet tools and pyasic use to read your miners and switch pools. This reference is the firmware-family support matrix: which commands work as read or control across Stock Antminer, BraiinsOS-family, LuxOS-family and DCENT_OS.

Quick answer

Almost every ASIC miner exposes a local management API on TCP port 4028 — the cgminer/BMMiner/BOSminer "API socket". You send a one-line JSON object like {"command":"summary"} and get back JSON; it is how fleet tools, pyasic and monitoring dashboards read your miners and (where permitted) switch pools, toggle boards and set tuning. But the SAME command behaves differently across firmware: stock Antminer is largely read-only on 4028 (writes go through its HTTP CGI), BraiinsOS keeps 4028 read-only and moves control to gRPC, and the LuxOS-family implements full read+control on 4028 behind a session token. This reference is that matrix — 50 commands (25 control-class), each mapped across Stock, BraiinsOS-family, LuxOS-family and DCENT_OS, with parameters and a one-line description, every row cited.

How to read it: the "Access" column is what the command DOES (read vs control); the four firmware columns are HOW each family exposes it — Read / Control on the 4028 socket, gRPC (capability lives on BraiinsOS gRPC port 50051, not 4028), HTTP CGI (stock does the write via /cgi-bin), or — (not on that socket). LuxOS-family control commands take a session token as the first parameter (logon to get one). DCENT_OS columns are source capabilities or targets, not blanket artifact-readiness claims aimed at cgminer-compatible detection so existing tools just work — built on the shoulders of cgminer, BOSminer and LuxOS, not a claim to beat them. Free CSV/JSON under CC BY 4.0.

Download CSV Download JSON REST API →

CommandAccessStock AntminerBraiinsOS-familyLuxOS-familyDCENT_OS
version
Returns miner/API version (CGMiner version, API version string e.g. '3.7', Miner type, compile time). Primary tool-fingerprint call. Identity
readReadReadReadBeta
summary
Top-level mining summary: Elapsed, GHS 5s / GHS av (or MHS av/5s), Accepted, Rejected, Hardware Errors, Utility, Found Blocks, Best Share, Device Hardware%/Rejected%. Status
readReadReadReadBeta
stats
Detailed per-board statistics: per-chain chip counts (chain_acn*), per-chain hashrate (chain_rate*), chip status maps (chain_acs*), temps (temp*, temp2_*), fan RPM (fan1-4), total_rateideal, uptime. Status
readReadReadReadBeta
pools
Lists configured pools with per-pool metrics: URL, Status (Alive/Dead), Priority, Quota, Accepted/Rejected, User, Stratum Active, Last Share Time/Difficulty, Pool Rejected%/Stale%. Pools
readReadReadReadBeta
devs
Per-device (hashboard/ASC) report: status, temperature, hashrate, accepted/rejected, hardware errors per board. Devices
readReadReadReadBeta
devdetails
Static hardware details per board: Model, Chips, Cores, Frequency, Voltage, Profile, Serial. Used for model identification. Devices
readReadReadReadBeta
config
Basic configuration info: ASC count, pool count, active strategy, log interval, device code, OS. Config
readReadReadReadBeta
edevs (none (legacy '[old]' arg accepted))
Same as devs but excludes blacklisted/zombie devices. Cleaner board list for monitoring. Devices
readReadReadReadBeta
estats (none (legacy '[old]' arg accepted))
Same as stats but excludes zombie devices. Variety of model-specific miner stats. Status
readReadReadReadBeta
coin
Current coin/algorithm info (hash method, current block diff, network diff). Placeholder/compatibility on many ASIC builds. Status
readReadReadReadBeta
lcd
Compact one-shot general summary (originally for LCD displays). Compatibility placeholder on most ASIC firmware. Status
readReadReadTBD
check (command_name)
Reports whether a given command exists and the caller's access level for it. Used for capability discovery. Meta
readReadReadReadBeta
asc (board_id (n))
Detailed report for a single ASC (hashboard) by index. Devices
readReadReadReadBeta
asccount
Returns the quantity of ASC devices (hashboards) detected. Devices
readReadReadReadBeta
notify
Returns the device notification/error history (last share, temps, comms errors per device). Status
readReadReadReadBeta
privileged
Reports whether the calling connection has privileged (write) access under the api-allow policy. Meta
readReadReadReadBeta
pga (n)
Legacy: data for FPGA device n. Placeholder/empty on ASIC-only miners. Devices
readReadReadTBD
debug (setting)
Get/set the daemon debug verbosity flags (e.g. quiet, verbose, debug, rpc). Meta
readReadReadTBD
lockstats
Writes internal lock statistics to the log (build-dependent debug aid). Meta
readReadTBD
switchpool (n (pool index))
Switch the active pool to index n (raise to top priority). Pools
controlHTTP CGIgRPCControlTBD
enablepool (n)
Enable (activate) pool n. Pools
controlHTTP CGIgRPCControlTBD
disablepool (n)
Disable (deactivate) pool n. Pools
controlHTTP CGIgRPCControlTBD
addpool (url,user,password)
Add a new pool (to the first group). On LuxOS the leading session_id is required. Pools
controlHTTP CGIgRPCControlTBD
removepool (n)
Remove pool n. Pools
controlHTTP CGIgRPCControlTBD
poolpriority (n,n,n,... (priority order))
Set the priority order of all pools. Pools
controlHTTP CGIgRPCControlTBD
poolquota (n,q (pool,quota))
Set the load-balancing quota for pool n. Pools
controlHTTP CGIgRPCControlTBD
save ([file])
Persist the current configuration to disk (optionally to a named file). Config
controlHTTP CGIgRPCControlTBD
restart
Restart the mining daemon (cgminer/bmminer/bosminer/luxminer) without rebooting the device. System
controlHTTP CGIgRPCControlTBD
quit
Terminate the mining daemon process. System
controlHTTP CGIgRPCControlTBD
ascenable (n)
Enable hashboard (ASC) n. Devices
controlHTTP CGIgRPCControlTBD
ascdisable (n)
Disable hashboard (ASC) n. Devices
controlHTTP CGIgRPCControlTBD
ascset (n,opt[,val] (vendor-specific opcodes))
Set a vendor-specific ASC option. On Avalon/Canaan this carries the model-specific ascset opcodes (e.g. frequency, voltage, LED). Parameters are not portable across vendors. Devices
controlHTTP CGIgRPCControlTBD
pgaenable (n)
Legacy: enable FPGA device n (placeholder on ASIC miners). Devices
controlHTTP CGITBD
pgadisable (n)
Legacy: disable FPGA device n (placeholder on ASIC miners). Devices
controlHTTP CGITBD
pgaidentify (n)
Legacy: blink the identify LED on FPGA device n. Devices
controlHTTP CGITBD
setconfig (name,value)
Set a global cgminer config value (e.g. queue, scantime, expiry). Config
controlHTTP CGIgRPCControlTBD
zero (which,summary (true/false))
Zero the named statistics counters; optional summary printout. Stats
controlHTTP CGIgRPCControlTBD
hotplug (n (seconds))
Set the hotplug device-scan interval (0 disables). System
controlHTTP CGIControlTBD
failover-only (true|false)
Restrict work to the primary pool unless it is dead (failover-only mode). Pools
controlHTTP CGIgRPCControlTBD
logon
Open a control session; returns SessionID. Single-session mutex: fails if a session already exists. SessionID is the FIRST parameter of every mutating command. (LuxOS-family model; BraiinsOS uses gRPC bearer token instead.) Session
controlgRPCControlTBD
logoff (session_id)
Close the active control session. Session
controlgRPCControlTBD
session
Report whether a control session is currently active. Session
readReadTBD
kill
Force-terminate any active session (recover a stuck mutex). Session
controlControlTBD
fans
Fan statistics: per-fan RPM, speed %, target %. Cooling
readReadReadReadBeta
temps
Per-chain board and chip temperatures. Cooling
readReadReadReadBeta
tempctrl
Temperature-control thresholds (target / hot / dangerous). Cooling
readReadTBD
power
Get power consumption in watts (measured or estimated). Power
readgRPCReadBeta
profiles
List available tuning profiles (frequency/voltage operating points). Note: profile values are runtime operating points, not factory presets. Tuning
readgRPCReadBeta
profileset (session_id,profile_name[,frequency_step,voltage_step,update_atm])
Set the active tuning profile for the miner/board. (BraiinsOS equivalent is a gRPC tuner call; stock has no socket equivalent.) Tuning
controlgRPCControlTBD
curtail (session_id,sleep|wakeup[,voltage_step,frequency_step,mode])
Demand-response sleep/wake control (curtailment). LuxOS exposes sleep/wakeup; an operator can pause hashing for grid events. (BraiinsOS pause/resume is gRPC.) Power
controlgRPCControlTBD

Legend: Read read-only on 4028 · Control write/control on 4028 · gRPC / HTTP CGI control via a different surface (BraiinsOS gRPC 50051 / stock /cgi-bin) · Beta‡ DCENT_OS beta target · — / TBD not on that socket. LuxOS-family control commands need a session token (logon).

Source: D-Central Mining Bible (PYASIC_COMPATIBILITY, BraiinsOS & LuxOS reverse-engineering) — per-command citations in the CSV/JSON. See also the firmware feature matrix, the Stratum V2 pool protocol (distinct from this local socket), and the web flasher.

Transports, ports and authentication, firmware by firmware

The matrix above says what each command does. This table says how to reach it. Cells marked Unknown stay Unknown: the vendor does not publish the answer and we are not going to guess it.

FirmwareTransportPortAuthWrite accessMachine-readable spec
cgminer / bmminer (stock Antminer)raw TCP, plain text or JSON4028none; IP allow-listread-only by default; --api-allow with a W: prefix grants privileged commandsGPL source drop bitmaintech/bmminer-mix (S9/C5-era only)
Braiins OS+gRPC50051token via AuthenticationService.Login, Authorization header, 3600 s inactivity expiry; server reflection onyes16 .proto files, braiins/bos-plus-api under proto/bos/v1/
Braiins OS+ (REST, since 25.07)HTTP/REST80POST /api/v1/auth/loginyesOpenAPI v1.7.0, live at GET /api/v1/docs/openapi.json
Braiins OS+ (legacy socket)raw TCP, CGMiner-compatible4028nonepartial — Braiins states switchpool/enablepool/disablepool/addpool/removepool are not fully implemented and reset after restart
LuxOSraw TCP4028session (logon → SessionID → logoff)yes, session required; the session expires after one minute
LuxOS (HTTP)HTTP8080sessionyes, same session model
AxeOS / ESP-Miner (Bitaxe)HTTP/REST + WebSocket (/api/ws, /api/ws/live)80none at allyesOpenAPI 3.1.0, main/http_server/openapi.yaml
MicroBT Whatsminerraw TCP, 4-byte length-prefixed JSON, max 10 clients4433 — not 4028 (API v3.0.0; older v2.0.5 revisions on mirrors say 4028)per-device salt → tokenget.* enabled by default; set.* disabled by default
VNishHTTP; the documentation is served by the miner itself at http://<miner_IP>/docs/UnknownUnknownUnknownnone published off-device
Hiveon ASICnot documentedUnknown — the common assumption that it serves 4028 is not vendor-confirmedUnknownUnknownnone published
Awesome Miner (the platform, not its firmware)HTTP17790optional API key, per-user scopingyesOpenAPI 3.0.2, awesomeminer.com/assets/apidoc.yaml
DCENT_OS (ours, GPL-3.0)CGMiner-compatible TCP · REST · WebSocket4028 · 80 · /ws (same port as HTTP)13 cgminer-compatible commands in source: summary, stats, pools, devs, version, coin, config, switchpool, enablepool, disablepool, addpool, restart, quitGPL-3.0 source

Copy-paste examples

Every address below is in the RFC 5737 documentation range (192.0.2.0/24) — substitute your own miner's IP.

# cgminer / bmminer / LuxOS — raw TCP, plain text or JSON, port 4028
echo '{"command":"summary"}' | nc 192.0.2.10 4028

# Braiins OS+ legacy CGMiner-compatible socket (still served; Braiins says it will be deprecated)
echo '{"command":"pools"}' | nc 192.0.2.10 4028

# LuxOS HTTP API — port 8080
curl -X POST -d '{"command":"version"}' -H 'Content-Type: application/json' http://192.0.2.10:8080/api

# AxeOS — plain HTTP on port 80, no authentication
curl http://192.0.2.10/api/system/info

# Braiins OS+ REST (since 25.07) — log in, then read the live OpenAPI document
curl -X POST http://192.0.2.10/api/v1/auth/login -d '{"username":"root","password":"..."}'
curl http://192.0.2.10/api/v1/docs/openapi.json

# MicroBT Whatsminer — 4433, NOT 4028, on API v3.0.0
nc 192.0.2.10 4433

Read versus control: the API is off, local-only and read-only until you change that

The canonical document for the 4028 socket is cgminer's own API-README, and it is worth reading before you open anything up. Verbatim: “By default, you cannot access any privileged command that affects the miner — you will receive an access denied status message.” The two flags that govern it are --api-listen, documented as “Enable API, default: disabled”, and --api-network, whose default is “only 127.0.0.1”. That is three separate answers in one place: the API is off, it is local-only, and it is read-only until an operator deliberately changes all three. Credit: Con Kolivas and the cgminer contributors, whose API-README is still the reference document the whole category is built on.

What stock Antminer firmware actually implements

Bitmain's own GPL source drop bitmaintech/bmminer-mix carries an api.c whose cmds[] table has an explicit iswritemode flag, so the split is not inferred — it is read off the table.

  • Write-mode: switchpool addpool poolpriority poolquota enablepool disablepool removepool save quit privileged restart failover-only debug setconfig zero hotplug ascenable ascdisable ascidentify ascset lockstats
  • Read-only: version config devs edevs pools summary noncenum pgacount notify devdetails stats estats check coin usbstats asccount lcd
  • That is upstream cgminer's set plus a Bitmain-specific noncenum.
  • Braiins-only additions on its legacy 4028 socket: fans tempctrl temps tunerstatus pause resume

The caveat that matters. bmminer-mix is the S9/C5-era drop. No S19 or S21 bmminer source drop is available to read, so the current stock command set is Unknown and the list above should be treated as the S9-generation answer, not a present-day one.