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 →
| Command | Access | Stock Antminer | BraiinsOS-family | LuxOS-family | DCENT_OS |
|---|---|---|---|---|---|
versionReturns miner/API version (CGMiner version, API version string e.g. '3.7', Miner type, compile time). Primary tool-fingerprint call. Identity | read | Read | Read | Read | Beta |
summaryTop-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 | read | Read | Read | Read | Beta |
statsDetailed 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 | read | Read | Read | Read | Beta |
poolsLists 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 | read | Read | Read | Read | Beta |
devsPer-device (hashboard/ASC) report: status, temperature, hashrate, accepted/rejected, hardware errors per board. Devices | read | Read | Read | Read | Beta |
devdetailsStatic hardware details per board: Model, Chips, Cores, Frequency, Voltage, Profile, Serial. Used for model identification. Devices | read | Read | Read | Read | Beta |
configBasic configuration info: ASC count, pool count, active strategy, log interval, device code, OS. Config | read | Read | Read | Read | Beta |
edevs (none (legacy '[old]' arg accepted))Same as devs but excludes blacklisted/zombie devices. Cleaner board list for monitoring. Devices | read | Read | Read | Read | Beta |
estats (none (legacy '[old]' arg accepted))Same as stats but excludes zombie devices. Variety of model-specific miner stats. Status | read | Read | Read | Read | Beta |
coinCurrent coin/algorithm info (hash method, current block diff, network diff). Placeholder/compatibility on many ASIC builds. Status | read | Read | Read | Read | Beta |
lcdCompact one-shot general summary (originally for LCD displays). Compatibility placeholder on most ASIC firmware. Status | read | Read | — | Read | TBD |
check (command_name)Reports whether a given command exists and the caller's access level for it. Used for capability discovery. Meta | read | Read | Read | Read | Beta |
asc (board_id (n))Detailed report for a single ASC (hashboard) by index. Devices | read | Read | Read | Read | Beta |
asccountReturns the quantity of ASC devices (hashboards) detected. Devices | read | Read | Read | Read | Beta |
notifyReturns the device notification/error history (last share, temps, comms errors per device). Status | read | Read | Read | Read | Beta |
privilegedReports whether the calling connection has privileged (write) access under the api-allow policy. Meta | read | Read | Read | Read | Beta |
pga (n)Legacy: data for FPGA device n. Placeholder/empty on ASIC-only miners. Devices | read | Read | — | Read | TBD |
debug (setting)Get/set the daemon debug verbosity flags (e.g. quiet, verbose, debug, rpc). Meta | read | Read | — | Read | TBD |
lockstatsWrites internal lock statistics to the log (build-dependent debug aid). Meta | read | Read | — | — | TBD |
switchpool (n (pool index))Switch the active pool to index n (raise to top priority). Pools | control | HTTP CGI | gRPC | Control | TBD |
enablepool (n)Enable (activate) pool n. Pools | control | HTTP CGI | gRPC | Control | TBD |
disablepool (n)Disable (deactivate) pool n. Pools | control | HTTP CGI | gRPC | Control | TBD |
addpool (url,user,password)Add a new pool (to the first group). On LuxOS the leading session_id is required. Pools | control | HTTP CGI | gRPC | Control | TBD |
removepool (n)Remove pool n. Pools | control | HTTP CGI | gRPC | Control | TBD |
poolpriority (n,n,n,... (priority order))Set the priority order of all pools. Pools | control | HTTP CGI | gRPC | Control | TBD |
poolquota (n,q (pool,quota))Set the load-balancing quota for pool n. Pools | control | HTTP CGI | gRPC | Control | TBD |
save ([file])Persist the current configuration to disk (optionally to a named file). Config | control | HTTP CGI | gRPC | Control | TBD |
restartRestart the mining daemon (cgminer/bmminer/bosminer/luxminer) without rebooting the device. System | control | HTTP CGI | gRPC | Control | TBD |
quitTerminate the mining daemon process. System | control | HTTP CGI | gRPC | Control | TBD |
ascenable (n)Enable hashboard (ASC) n. Devices | control | HTTP CGI | gRPC | Control | TBD |
ascdisable (n)Disable hashboard (ASC) n. Devices | control | HTTP CGI | gRPC | Control | TBD |
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 | control | HTTP CGI | gRPC | Control | TBD |
pgaenable (n)Legacy: enable FPGA device n (placeholder on ASIC miners). Devices | control | HTTP CGI | — | — | TBD |
pgadisable (n)Legacy: disable FPGA device n (placeholder on ASIC miners). Devices | control | HTTP CGI | — | — | TBD |
pgaidentify (n)Legacy: blink the identify LED on FPGA device n. Devices | control | HTTP CGI | — | — | TBD |
setconfig (name,value)Set a global cgminer config value (e.g. queue, scantime, expiry). Config | control | HTTP CGI | gRPC | Control | TBD |
zero (which,summary (true/false))Zero the named statistics counters; optional summary printout. Stats | control | HTTP CGI | gRPC | Control | TBD |
hotplug (n (seconds))Set the hotplug device-scan interval (0 disables). System | control | HTTP CGI | — | Control | TBD |
failover-only (true|false)Restrict work to the primary pool unless it is dead (failover-only mode). Pools | control | HTTP CGI | gRPC | Control | TBD |
logonOpen 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 | control | — | gRPC | Control | TBD |
logoff (session_id)Close the active control session. Session | control | — | gRPC | Control | TBD |
sessionReport whether a control session is currently active. Session | read | — | — | Read | TBD |
killForce-terminate any active session (recover a stuck mutex). Session | control | — | — | Control | TBD |
fansFan statistics: per-fan RPM, speed %, target %. Cooling | read | Read | Read | Read | Beta |
tempsPer-chain board and chip temperatures. Cooling | read | Read | Read | Read | Beta |
tempctrlTemperature-control thresholds (target / hot / dangerous). Cooling | read | — | — | Read | TBD |
powerGet power consumption in watts (measured or estimated). Power | read | — | gRPC | Read | Beta |
profilesList available tuning profiles (frequency/voltage operating points). Note: profile values are runtime operating points, not factory presets. Tuning | read | — | gRPC | Read | Beta |
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 | control | — | gRPC | Control | TBD |
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 | control | — | gRPC | Control | TBD |
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.
| Firmware | Transport | Port | Auth | Write access | Machine-readable spec |
|---|---|---|---|---|---|
| cgminer / bmminer (stock Antminer) | raw TCP, plain text or JSON | 4028 | none; IP allow-list | read-only by default; --api-allow with a W: prefix grants privileged commands | GPL source drop bitmaintech/bmminer-mix (S9/C5-era only) |
| Braiins OS+ | gRPC | 50051 | token via AuthenticationService.Login, Authorization header, 3600 s inactivity expiry; server reflection on | yes | 16 .proto files, braiins/bos-plus-api under proto/bos/v1/ |
| Braiins OS+ (REST, since 25.07) | HTTP/REST | 80 | POST /api/v1/auth/login | yes | OpenAPI v1.7.0, live at GET /api/v1/docs/openapi.json |
| Braiins OS+ (legacy socket) | raw TCP, CGMiner-compatible | 4028 | none | partial — Braiins states switchpool/enablepool/disablepool/addpool/removepool are not fully implemented and reset after restart | — |
| LuxOS | raw TCP | 4028 | session (logon → SessionID → logoff) | yes, session required; the session expires after one minute | — |
| LuxOS (HTTP) | HTTP | 8080 | session | yes, same session model | — |
| AxeOS / ESP-Miner (Bitaxe) | HTTP/REST + WebSocket (/api/ws, /api/ws/live) | 80 | none at all | yes | OpenAPI 3.1.0, main/http_server/openapi.yaml |
| MicroBT Whatsminer | raw TCP, 4-byte length-prefixed JSON, max 10 clients | 4433 — not 4028 (API v3.0.0; older v2.0.5 revisions on mirrors say 4028) | per-device salt → token | get.* enabled by default; set.* disabled by default | — |
| VNish | HTTP; the documentation is served by the miner itself at http://<miner_IP>/docs/ | Unknown | Unknown | Unknown | none published off-device |
| Hiveon ASIC | not documented | Unknown — the common assumption that it serves 4028 is not vendor-confirmed | Unknown | Unknown | none published |
| Awesome Miner (the platform, not its firmware) | HTTP | 17790 | optional API key, per-user scoping | yes | OpenAPI 3.0.2, awesomeminer.com/assets/apidoc.yaml |
| DCENT_OS (ours, GPL-3.0) | CGMiner-compatible TCP · REST · WebSocket | 4028 · 80 · /ws (same port as HTTP) | — | 13 cgminer-compatible commands in source: summary, stats, pools, devs, version, coin, config, switchpool, enablepool, disablepool, addpool, restart, quit | GPL-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 4433Read 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.
Related products, repair, and setup paths
- how D-Central diagnoses ASIC repairs
- ASIC troubleshooting library
- ASIC manuals and repair guides
- replacement hashboards
- ASIC control boards
- ASIC power supplies
- compare specs in the ASIC miner database
- compare ASIC miner specs
- ASIC miner database
- ASIC repair services
- Antminer S19 specs and profitability
- buy a tested Antminer S19
- Antminer S19 maintenance guide
- Antminer S19 repair service
- Antminer S21 specs
- Bitmain Antminer S21
- Antminer S21 maintenance guide
- BM1370BC S21 Pro chip
- Antminer S9 specs
- Bitmain Antminer S9
- Antminer S9 maintenance guide
- S9 hashboard repair parts bundle
- Whatsminer M30S specs
- Whatsminer repair guide
- MicroBT Whatsminer M30S++
- Whatsminer M3x exhaust shroud
- Avalon (Canaan) hashboard repair
- start a repair request
- ASIC repair parts
Last reviewed June 21, 2026.
