HTTP Control API and Web Console

[General]
external-http-controller = 127.0.0.1:9090
external-http-secret = your-secret-token
external-http-ui = true
external-http-cors = false

Chute provides an embedded HTTP Control API and Web Console, similar to the dashboards of Clash and other proxy apps. The API exposes engine status, traffic, connections, DNS, policy controls, and configuration management through REST endpoints. An AI agent reaches the same routes through the MCP server, a listener of its own that signs in with the same secret. Both are free, and what needs Chute Pro needs it on both alike.

The one-line form http-api = <secret>@<host>:<port> is read as external-http-controller plus external-http-secret. A profile may also spell the parts separately: http-api-secret, http-api-ui and http-api-cors are read as external-http-secret, external-http-ui and external-http-cors, and http-api-web-dashboard also as external-http-ui; the configuration is saved with the external-http-* keys. http-api-tls is not supported — the controller speaks plain HTTP — and only produces a notice.

external-http-controller (Default: disabled)

external-http-controller = 127.0.0.1:9090

The requests the console keeps resident while serving are capped at 4 MB on macOS and 1 MB on iOS, tvOS and Android.

The address and port for the HTTP control server. Use 127.0.0.1 for local-only access. Binding to any non-loopback address (for example 192.168.1.5:9090) requires an explicit external-http-secret — without one the server refuses to start and logs what is missing.

A wildcard address (0.0.0.0, ::, *) counts as non-loopback for this check, because it listens on every interface — the opposite of local-only. Accepted spellings are 0.0.0.0:9090, *:9090 (the same thing) and, for IPv6, [::]:9090 — a bare :::9090 is bracketed for you; an address that cannot be parsed is reported as a configuration error instead of silently leaving the controller off. The whole of 127.0.0.0/8 counts as loopback, not just 127.0.0.1.

external-http-secret (Default: a generated token)

external-http-secret = your-secret-token

The Bearer token used for API authentication. Requests must include the header Authorization: Bearer <secret> — the token is accepted only in this header, never as a query parameter, and is compared in constant time. Authentication failures return 401 with {"ok": false, "error": {"code": "unauthorized", "message": "missing or invalid token"}}. Every data route is guarded: the /api/* paths, the Clash-compatible aliases, and the older routes that only Chute Android still serves (/status, /policies, /dns, /records and the like), which accept the token only in this header as well. Chute Android's own Remote Dashboard now uses the /api/* paths only. The Web Console's page and static assets (/, /assets/…, and on Chute Android also /ui) need no token (with external-http-ui = false they are gone altogether — the page is a 404).

When the key is absent, Chute generates a token instead of serving without authentication. The generated token is written to a control-token file in Chute's share folder — not beside the configuration: the app-group container on iOS and tvOS, the app's private data directory on Android — with owner-only permissions, is reused across restarts, and the apps show it to you — see the console entry points. The control API can hand out the connection database, whose records carry every URL, header and process name the run has seen, so an open controller is not a reasonable default. The MCP server signs in with the same secret, or the same generated token — which is generated, and shown in the apps, even when external-http-controller is off.

To serve without authentication anyway, say so in the configuration:

external-http-secret = none

That is accepted only on a loopback bind. Off loopback, neither none nor an absent key is enough: the controller refuses to start and says what it wants.

Chute tvOS sets it in the configuration editor too, on the MCP Server page under GENERAL, as the MCP Server settings of Chute iOS and Chute Mac do. It is one value: changing it changes how the Web Console, the chute command and the MCP server sign in.

Upgrading: if you relied on an absent external-http-secret meaning "no authentication", local scripts start receiving 401. Either read the generated token out of the app, or write external-http-secret = none to keep the old behaviour deliberately.

external-http-ui (Default: true)

external-http-ui = true

When enabled, Chute serves an embedded Web Console at the controller address. The Web Console provides an overview, connection management, DNS inspection, traffic monitoring, policy controls, and configuration editing. Set to false to keep the API enabled while disabling the UI.

Opening the web console

The console is served at the controller's address, and each app can hand you the address and the token — including the generated one, which you would otherwise have no way to read:

  • Chute Mac: menu bar → Open Web Console, and Copy Web Console Token; the Dashboard window's "⋯" toolbar menu also has Open Web Console.
  • Chute iOS: Control Panel → the Web Console row → Open, Copy Address, or Copy Access Token.
  • Chute tvOS: the control panel has a separate Web Console Address row, showing host and port. Selecting it shows a QR code when the listener is reachable from other devices — the sign-in token travels inside the code, not on the screen — and, when the controller is bound to loopback, an explanation instead, because a loopback console cannot be opened from a phone.
  • Chute Android: Control Panel → Web Console Address → Open or Copy Address, and a Generated access token row that copies on tap. Neither row appears when the token is a secret you configured yourself, which is never displayed.

The address these produce carries the token as a query parameter. The page consumes it on load and removes it from the address bar, so opening the link is a complete sign-in and nobody has to transcribe 32 hex characters.


external-http-cors (Default: false)

external-http-cors = true

Enable CORS (Cross-Origin Resource Sharing) headers on API responses. Useful when the Web Console or third-party tools need to access the API from a different origin.

API Endpoints:

Method Endpoint Description
GET /api/status Runtime status, ports, uptime
GET /api/traffic Global and per-policy traffic counters
GET /api/connections Current active connections
GET /api/connections/:id One connection, open or recorded
DELETE /api/connections/:id Close a connection
GET /api/connections/history Historical connection records
GET /api/connections/processes Per-process connection statistics
GET /api/connections/:id/request Captured request data for a connection
GET /api/connections/:id/response Captured response data for a connection
GET /api/dns DNS cache records
DELETE /api/dns/cache Purge DNS cache
DELETE /api/dns/records/:domain Remove a single DNS record
GET /api/config Current configuration
PUT /api/config Reload configuration
POST /api/config/validate Parse a configuration and report its errors, without loading it
GET /api/config/sections The configuration's sections, each with its revision
GET /api/config/section One section's text
PUT /api/config/section Replace one section, or add it
POST /api/config/revert-runtime Undo the run-time changes made through the API
GET /api/policies Policy groups and current selection; every entry carries hidden, which is true for a group marked hidden=true
PUT /api/policies/:group Change policy group selection
GET /api/policies/providers Proxy providers, policy-path sources included, with the status of each — including why one gave no policies
GET /api/policies/detail One policy: its line and what the engine knows of it now
PUT /api/mode Set outbound mode
GET /api/features Feature switch states
PUT /api/features/mitm Toggle MitM
PUT /api/features/record-traffic Toggle traffic recording
GET /api/rules The rule table the matcher walks, where each rule came from, and which rewrite rules have fired
POST /api/rules/match Where a request would be routed, without making it
GET /api/rules/user Rules added at run time, matched ahead of the modules and the configuration
PUT /api/rules/user Replace the run-time rules
POST /api/rules/user Add rules behind the run-time rules
DELETE /api/rules/user Remove every run-time rule
GET /api/logs Recent log entries
GET /api/loglevel Current log level, and the sections being written
PUT /api/loglevel Change the log level or sections without restarting
GET /api/health Engine health: refusals, generations, footprint, previous exit
GET /api/events Notable moments of this run
GET /api/tailscale Live Tailscale engine state
GET /api/time NTP time-check status and clock offset
POST /api/time/refresh Run an NTP time check now
GET /api/scripts The generic scripts that can be run on demand
POST /api/scripts/run Run one generic script by name
POST /api/diagnostics/ping ICMP or TCP reachability probe
POST /api/diagnostics/dns-query Resolve a domain through the running resolver
POST /api/diagnostics/egress-probe Check the address: this device's own on the Apple engines; on Android, the device's public address on its physical network, not a proxy's exit
POST /api/diagnostics/internet-test The direct Internet test: fetch internet-test-url without a proxy
POST /api/diagnostics/url-test/:policy Run a policy's latency test
POST /api/diagnostics/group-test/:policy Time every member of a group, one HTTPS request each
POST /api/diagnostics/geoip Country and ASN of an address or a name
POST /api/diagnostics/bundle Build a redacted diagnostic archive
GET /api/connections/export Export connections as HAR 1.2
GET /api/rewrites Every rewrite/Mock Response family, plus the MitM host list
GET /api/rewrites/:family One family's rules
POST /api/rewrites/:family Add a rule
DELETE /api/rewrites/:family/:id Remove a rule
DELETE /api/rewrites/:family Clear a family
GET /api/mitm/hosts Hosts currently decrypted
POST /api/mitm/hosts Add a host
DELETE /api/mitm/hosts/:host Remove a host
DELETE /api/mitm/hosts Clear the list
GET /api/rules/providers Rule providers and rule sets, with the status of each — including why one did not load
GET /api/modules Loaded modules
GET /api/modules/item One module, with its text
PUT /api/modules/item Turn a module on or off for this run
GET /api/resources What the configuration fetches from elsewhere: rule sets, rule providers, proxy providers, modules
POST /api/resources/refresh Fetch one of them now

The single-connection, policy-detail, GeoIP, group-test, section, module and resource routes, the paging and filter parameters below, and the configuration's revision are served by the engines of Chute Mac, Chute iOS, Chute tvOS and Chute Android; the MCP server is built on them.

Endpoint notes:

  • GET /api/features reports each switch as it is set — record_traffic, mitm, mitm_h2, mitm_auto_quic_block, rewrite — and licensed. effective says what actually runs, for five items only: record_traffic, mitm, rewrite, scripts and lan_proxy. On the free edition all five are false, so a switch can read on while its effective entry is false. inactive is an object naming what the running configuration asks for that does not run in this edition: the counts scripts, scriptRules, dnsScripts, rewrites and mapLocals, and the flags mitm, bodyCapture, lanProxy and exitNode (Tailscale advertising, which only Chute Mac does). With a license, or while the engine is stopped, every count is 0 and every flag false.
  • GET /api/connections accepts limit (positive integer, default and maximum 1000) and cursor (returns only connections with id greater than the cursor). The response data carries connections, total, page_size, has_more, server_time, and — when more pages exist — next_cursor. since (seconds, the server_time of an earlier answer) returns only the connections that changed after that moment, and adds active_ids, the ids of every connection open now: one that an earlier answer had and that is missing from them has closed. A since later than server_time is taken as 0, so every connection is returned. Four filters narrow the list, checked on each record before it is turned into JSON: host (part of the target host, the TLS name or the address) and process (part of the process name, path or bundle id), both ignoring case; policy, the exact name of a policy the connection went through — the one its rule names, or the policy and node it went out by; and failed=1 (closed by a timeout, a failed dial, a name that did not resolve, or IPv6 while it is off) or failed=0. cursor pages through what passes; total still counts every open connection.
  • GET /api/connections/history accepts limit (default 100, maximum 1000) and cursor/before (synonyms; passing both is rejected). It takes the same four filters. A filtered page reads at most 5000 stored records; when it stops there it says so in message and returns a next_cursor to go on from.
  • GET /api/connections/:id/request and .../response return {"connection_id": <id>, "data": "<base64>"}. Captures larger than 2 MiB return 413. Without Chute Pro both return 403, with request data is not available or response data is not available, for bodies recorded during an earlier licensed run as well.
  • GET /api/connections/:id returns one connection, open or recorded, as {connection, source, service_start_time} — source is active or history. The id is the one the lists and the /request and /response routes use; an id that matches neither an open nor a recorded connection is a 404.
  • GET /api/config returns the running configuration as written, credentials included — http-auth, external-http-secret, ca-p12, ca-passphrase, WireGuard keys and every proxy's password — so access to the control API is access to all of them. Only a diagnostic bundle replaces credentials with <redacted>, and that copy cannot be loaded back: a configuration sent to PUT /api/config that still says <redacted> anywhere is refused with 400 and a message naming the first such line. Submit the original configuration instead.
  • GET and PUT /api/config are also reachable as /api/configs, and as the Clash alias /configs.
  • PUT /api/config accepts either JSON {"configuration": "<full text>"} or the raw configuration text as the request body (1 MB limit). On success the engine reloads — or starts, if it was not running. The reply waits for the reload: {"reloaded": true} once it is applied; 400 with the code reload_rejected when the engine refused the configuration and kept the one that was running, with the reason in the message; 202 with {"reloaded": false, "queued": true} when the engine did not answer within 15 seconds — the reload is still pending and will run, so do not send it again. The text is read as a new version of the running configuration, so an #!include in it resolves against the folder that configuration was loaded from (Including Another File).
  • GET /api/config also returns revision, a hash of the running configuration: reading the same configuration twice gives the same value, and any change to it gives a new one. Send it back as revision in the body (or the query string) of PUT /api/config to replace the configuration only if nobody has changed it since: the check and the reload are made in one step, a stale revision is answered with 409 and {"ok": false, "error": {"code": "revision_conflict", "message": "...", "current_revision": "..."}} and changes nothing, and a reload that is taken answers {"reloaded": true, "revision": "<new revision>"}. Without revision the route behaves as it always has.
  • GET /api/config/sections lists the configuration's sections as {revision, sections: [{name, occurrence, line_count, revision, editable, readonly_reason}]}. A section is named by its header without the brackets (Proxy, WireGuard home; an empty name for the lines before the first header) and by occurrence, counted from 1, for a header that appears more than once. Its revision is computed from that section alone, so a change elsewhere leaves it as it was. A section that holds an #!include line, every section after it, and the one that holds #!MANAGED-CONFIG are not editable, and readonly_reason says include or managed-config. GET /api/config/section?name=<name>&occurrence=<n> returns one section: {name, occurrence, content, revision, editable, line_count, config_revision}, content being its body without the header, as GET /api/config shows it.
  • PUT /api/config/section?name=<name>&occurrence=<n> takes {"content": "<the section's body>", "revision": "<its revision>"}, puts the body in place of the section's and reloads the configuration through the same path as PUT /api/config. content must not contain a section header: one section is written at a time. revision is required for a section that exists; one that changed since it was read answers 409 revision_conflict with the section's current_revision, and a section that is not editable answers 403 section_readonly. With occurrence one more than the sections of that name, the section is added — at the end, or at the top for the lines before the first header; beyond that the answer is 404. The reply is {name, occurrence, revision, config_revision, created, normalized}: the section is read back from the reloaded configuration, where [General] and [MITM] values are written the way Chute writes them and [WireGuard …] keys are reordered, so normalized says when the text differs from what was sent, and revision is the one to send next. For a managed configuration a note says that the next managed update replaces the change. A configuration the engine refuses answers 400 reload_rejected and changes nothing; with the engine stopped the answer is 409 not_running; and, as with PUT /api/config, 202 means the engine did not answer in time and the write is still queued.
  • POST /api/config/revert-runtime undoes what was changed through the API while the engine runs — the rewrite families, the MitM host list and module switches — and answers {"reverted": [...]} with the families it rebuilt: url-rewrite, header-rewrite, body-rewrite, mock, mitm, module. It is not a reload: the log level, the app's LAN switch, the outbound mode and the policy selections stay as they are, and the rules of /api/rules/user are kept. 202 with {"queued": true} when the engine did not answer in time.
  • On Chute Mac, PUT /api/mode, PUT /api/policies/:group, PUT /api/features/mitm, PUT /api/features/record-traffic, PUT /api/config and PUT /api/config/section are kept by the app and survive a restart; their answers add persisted, and the app can refuse them with 409 or 503 — see Writes that Chute Mac keeps.
  • PUT /api/policies/:group takes the selection from the first of the body keys policy, name, selected, select; the value may be a policy name or a numeric index as a string. The special group name GLOBAL sets the global selected policy. GLOBAL is matched in any case, and select_policy_factory means the same; but a group of the configuration's own whose name is exactly the one given comes first, so a group called Global is changed like any other group.
  • In GET /api/policies, every policy, group and group member carries endpoint, the policy it leads to now — followed through groups, and through the built-in PROXY to the policy selected for Global mode — and endpoint_ping, that policy's latency. A group's own ping is 0, not measured, so endpoint_ping is the figure to read for a group or for PROXY.
  • GET /api/policies/providers lists every proxy provider, including the one a policy-path group fetches from (named <group>-policy-path). Each entry has name, type, url or path, interval, last_updated, last_error, policy_count and warnings. last_updated is when the nodes in use were fetched — the modification time of the file or cached copy they were read from, or of the last refresh — and 0 if none ever loaded; policy_count is how many policies the provider yields after its filters, so 0 with a last_error names a provider that gives nothing.
  • GET /api/policies?summary=1 lists every entry without its members: name, type, endpoint, endpoint_ping and hidden, plus selected and member_count for a group and ping for a node. ?group=<name> lists only the entry of that exact name — in full, or summarized when summary=1 is given too — and answers 404 when there is none. Names are case-sensitive: Home and home are two policies.
  • GET /api/policies/detail?name=<policy> describes one policy or group: name, type, line (its configuration line as GET /api/config shows it; a proxy provider's node, which has none, written as a line), the run-time server, port, udp, ping, endpoint and endpoint_ping, and provider for a node a proxy provider gave. 400 without a name, 404 for a name that is not a policy.
  • PUT /api/mode requires a JSON number: {"mode": 0} — 0 rule, 1 direct, 2 proxy.
  • PUT /api/features/mitm and PUT /api/features/record-traffic take {"enabled": true}.
  • GET /api/logs accepts since (Unix seconds); the in-memory buffer keeps the most recent 1000 entries, each {timestamp, wall_time, level, section, message} — timestamp and wall_time carry the same Unix-seconds value, nudged forward when the clock does not advance so entries stay strictly ordered. With level (that level and every more severe one, by name — warning — or by the tag a line carries — WRN), keyword (part of the message or the section, ignoring case), offset or limit (default 200, at most 1000), the entries are filtered first and then paged, oldest first, and the answer adds total and next_offset.
  • GET /api/health reports what the engine is holding and why it last refused something, plus how the previous run ended (clean, unclean, or suspected_memory — see Troubleshooting). addressFamily says how Chute judges the IPv6 way out — ipv6 is healthy, confirming or degraded — with counts of what it has done about it; on the Apple engines selfLoop reports the self-loop guard. Neither carries an address.
  • GET /api/status carries network: kind (wifi, cellular, wired or unknown), ssid, bssid and router_ip when the system gives them, on_wifi, and suspend_active — whether an [SSID Setting] entry suspends Chute on this network. On Apple TV kind is always unknown.
  • GET /api/events serves the in-memory ring; ?persisted=1 reads this run's stored history instead, and answers available: false when record keeping is off. Every event carries seq, a number that only grows during the run, and every reply carries latest_seq; ?after=<seq> returns only the events after that one. To follow the events, poll with after set to the last latest_seq you received: since filters on each event's wall-clock time and can skip events that share a time or come after the clock is changed.
  • GET /api/tailscale answers state: "idle" when no [Tailscale] section is configured — that is a normal answer, not an error.
  • The POST /api/diagnostics/* probes take their arguments from the query string or a JSON body, are bounded to ten seconds, and answer exactly once. url-test/:policy rejects a policy name that is not defined rather than measuring REJECT.
  • POST /api/diagnostics/geoip takes address, an IP address or a name, and answers {address, ip, country_code, country_name, asn, organization} from the GeoIP and ASN databases, leaving out what a database does not know; country_name is in English. A name is first resolved through the engine's own resolver, [Host] included, preferring an IPv4 answer; 404 when it does not resolve.
  • POST /api/diagnostics/group-test/:policy times every member of a group with one HTTPS request each — the request url-test/:policy sends for a single policy — at most 8 at a time on iOS and tvOS and 16 on macOS (concurrency asks for fewer). url must be https; without it each member is fetched at its own HTTPS test URL or a default one. The whole sweep answers at once, within timeout seconds (25 at most, and by default): members lists every member in the group's order with success, duration_ms, status_code, error and url — one that had not finished is marked timed_out — and tested, succeeded, failed, timed_out and complete sum it up. These are HTTPS round trips, while a group's own test usually fetches a plain-HTTP URL, so the figures are not the ones the group chooses by; the group's own test is started afterwards (group_test_triggered) and chooses as it always does. 404 for an unknown name, 400 for a policy that is not a group or a URL that is not https.
  • GET /api/scripts lists the enabled generic scripts as {name, type}; POST /api/scripts/run takes name from the body or the query string, is bounded like the diagnostics probes, and answers {name, timedOut, result} — timedOut tells a script that never called $done apart from one that ran to completion. A name that is not an enabled generic script is a 404. Without Chute Pro it answers 403, script is not available.
  • POST /api/rules/match answers where a request would go, without opening a connection. It takes host (or a url to take the host and port from; a URL-REGEX rule is tested against that url exactly as written, although in real traffic it only ever sees plain http:// requests), port (default 443), and optional ip, protocol, process, process_path, src_ip, src_port, in_port, in_type, in_user, in_name, network, ssid, bssid, from_tun, user_agent — an unknown field is refused with the accepted list rather than ignored. The reply carries the matched rule (its line, type, the policy it names and the resolved_policy a group currently points at), the policy, need_resolve, and the rule_count and match_generation the answer was computed against. Because a domain is matched twice — once on the name and again once an address is known — passes holds one entry per pass; without an ip only the pre-resolution pass exists and the reply says so in note. Add explain=true for the candidate rules that could also have matched, up to 50, with a count of the rule sets that were not expanded.
  • POST /api/config/validate parses a configuration and throws it away: the running engine adopts nothing. Send it as {"configuration": "<full text>"} or as the raw text. The reply is valid, error_count, advisory_count, rule_count, policy_count and an errors list of {line, severity, content, error} — severity separates a line that was refused from one accepted with a caveat, and content is the offending line as written — credentials included, since a bad [Proxy] line is often bad in the very field that holds its password — cut at 4096 characters. Use it before PUT /api/config, which restarts the run you are debugging.
  • GET /api/loglevel reports the current level, the nslog_level, the sections being written to file, and the available_levels / available_sections you may set. PUT (or PATCH) takes level, sections, or both: sections is an array of section names or the string "all", and an empty array is refused — to stop logging use level none. Changing the level this way does not restart the run, which is the point: loglevel = verbose in the file needs a reload, and a reload loses the thing you were trying to see.
  • GET /api/rules also reports rewrite_hits — every rewrite or Mock Response rule that has fired this run, with a count. A rule that does not appear there has never matched, which is the usual explanation for a rewrite that seems to do nothing. The table tracks up to 512 distinct rules and reports rewrite_hit_dropped_rules for any beyond that. rules lists every rule the matcher walks, in order: the automatic Tailscale rules, then the rules added through /api/rules/user, then module rules, then the configuration's [Rule] section, ending with FINAL; rule_regions names each line's origin, index for index (front, user, module, configuration).
  • GET /api/rules accepts offset, limit (default 500, at most 5000) and filter (part of the rule line, ignoring case); without a filter the table is cut before a line is written, and rule_regions stays index for index. Like the other paged routes, GET /api/logs and GET /api/dns, it then adds total, the length of the list after its filter, and next_offset, which is absent on the last page. An offset, limit or filter that is not valid is refused with 400 rather than read as 0, and a larger limit is cut to the maximum. Without any of these parameters, each of these routes answers as it always has.
  • GET /api/dns accepts filter (part of a name or an address, ignoring case), which narrows all three lists, and offset and limit (default 500, at most 5000), which page records, then ordered by name.
  • /api/rules/user holds rules added while the engine runs, without a reload and without touching the configuration file. They are matched after the automatic Tailscale rules and ahead of module rules and the configuration's [Rule] section, in the order given. GET lists them; PUT replaces them and POST adds behind the ones there, both taking {"rules": ["<rule line>", ...]} or a single {"rule": "<rule line>"}, written as in the file; DELETE removes them all. A write is all or nothing: a line that does not parse, or a FINAL, is refused with 400 and the rules stay as they were. A rule whose policy the running configuration does not define is taken — it fails closed with REJECT — and named in warnings. close_rerouted, true by default, closes the connections the changed rules route elsewhere, and only those; false leaves every connection open — on DELETE pass it as ?close_rerouted=false. Every method answers with the current rules. The rules are kept through a reload and are gone when the engine stops. PATCH is not accepted on this path.
  • GET /api/modules lists the loaded modules as {modules: [{id, name, source_url, enabled}]}. id is what identifies a module — its name may be empty or shared — and source_url is there for a module loaded from a URL. GET /api/modules/item?id=<id> adds content, the text the module was loaded from. PUT /api/modules/item?id=<id> with {"enabled": false} turns a module off for this run, and true turns it back on; it answers with the module as listed, or 202 with {"queued": true} when the engine did not answer in time. Like the other run-time changes, a reload or POST /api/config/revert-runtime brings back what the configuration says.
  • GET /api/resources lists what the configuration fetches from elsewhere as {resources: [{kind, name, url, path, last_updated, last_error, count, refreshable}]}: kind is rule-provider, rule-set (named by its URL), proxy-provider (policy-path groups included) or module, and url and path appear when there is one. A module is read once, when the configuration loads, and keeps no record, so its entry says 0 and no error and cannot be refreshed. POST /api/resources/refresh with {"kind": "...", "name": "..."} fetches one now — a rule set or rule provider even while its copy is still fresh — and answers {"started": true}; the download runs afterwards, so read GET /api/resources again for its outcome. module and geoip are refused with 400, and a name the running configuration does not load is a 404.
  • POST /api/rewrites/:family takes {"rule": "<configuration line>"} — the same text you would write in the file. A line that does not parse is refused with 400 rather than stored as a rule that can never match. :family is one of url-rewrite, header-rewrite, body-rewrite, mock. Rules added this way live in the running engine and are not written back to the configuration file.
  • GET /api/connections/export?format=har returns a HAR 1.2 document, and POST /api/diagnostics/bundle returns a zip — both are files, so unlike every other endpoint they are not wrapped in the {"ok": ..., "data": ...} envelope. export accepts source (current, the default, or history), limit (default 100, maximum 300), ids, and bodies=1 to include the captured payloads. Each entry carries a _kl object with what HAR has no field for: the chosen policy, the matched rule, and the rewrites that fired.
  • A chained connection's record in GET /api/connections and GET /api/connections/history carries chainPath, the path from this device to the exit, as in Airport/Edge-01 → Landing; it is empty for a connection that used a single policy, and the HAR export carries it as _kl.chain. In the per-policy counters of GET /api/traffic, an upstream also counts the bytes it carried for chained connections; the global totals count them once.

Example — read the status, then switch a policy group:

curl -H "Authorization: Bearer your-secret-token" http://127.0.0.1:9090/api/status
{"ok":true,"data":{"running":true,"outbound_mode":0,"mitm":false, ...}}

curl -X PUT -H "Authorization: Bearer your-secret-token" \
     -d '{"policy": "ProxyB"}' http://127.0.0.1:9090/api/policies/MainGroup
{"ok":true,"data":{"outbound_mode":0,"selectable_groups":[...], ...}}

Example — ask where a request would go, before making it:

curl -X POST -H "Authorization: Bearer your-secret-token" \
     -d '{"url": "https://api.example.com/v1/orders", "explain": true}' \
     http://127.0.0.1:9090/api/rules/match
{"ok":true,"data":{"policy":"MainGroup","matched":{"rule":"DOMAIN-SUFFIX,example.com,MainGroup", ...}, ...}}

Narrow the log to one subsystem while reproducing, without restarting the run:

curl -X PUT -H "Authorization: Bearer your-secret-token" \
     -d '{"level": "verbose", "sections": ["MitM", "DNS"]}' \
     http://127.0.0.1:9090/api/loglevel

Note: This feature is disabled by default. Every response uses the envelope {"ok": true, "data": {...}} on success and {"ok": false, "error": {"code": "...", "message": "..."}} on errors; request bodies are limited to 1 MB.

PUT endpoints also accept PATCH. Clash-compatible alias paths are available for third-party dashboards: /version, /traffic, /connections, /configs, /proxies, /rules — the paths are reachable, but responses use Chute's envelope and field names rather than Clash's schema (/version returns {"name", "run_id", "egress_probe"}, where egress_probe is network_address on the Apple engines and egress_ip on Android), so Clash dashboards will not work out of the box.

Writes that Chute Mac keeps

On Chute Mac the engine hands these writes to the app, which applies them the way its own menus do and keeps them, so they survive a restart. This holds for the Web Console, the chute command, any other client of the API and the MCP server:

Route What the app does
PUT /api/mode Remembers the outbound mode
PUT /api/policies/:group and /proxies/:name Remembers the selection, the global one included
PUT /api/features/mitm and /api/features/record-traffic Writes the switch into the current configuration file
PUT /api/config (and its aliases) and /api/config/section Writes the configuration into the current configuration file, then reloads it the way the main window's Save & Apply does

The engine checks each write first, as it does everywhere — a selection against the groups, a configuration parsed and its revision compared — and answers once the app has finished. A successful answer adds persisted: true: PUT /api/config, for example, answers {"reloaded": true, "revision": "<new revision>", "persisted": true}, with the revision the engine now runs. A configuration the engine refuses answers 400 reload_rejected as elsewhere, and the file is left as it was.

The app refuses a configuration write with 409 and one of these codes, and writes nothing; the MitM and traffic-recording switches can be refused only with profile_missing:

Code When What to do
user_editing The main window has unsaved changes Save or discard them in the app first
file_changed The configuration file was changed outside Chute since Chute loaded it Reload it in Chute first
profile_missing The current configuration is not a local file —
needs_user_action The app is showing a dialog Answer it, then try again

When the app has not finished within 10 seconds the answer is 503 host_busy, which on these routes takes the place of 202. The write may still take effect: read the state again before sending it again.

Switching MitM or traffic recording takes effect at once and is written into the file, but the configuration is not reloaded, so GET /api/config keeps showing the text and the revision the engine runs until the next reload. A configuration written afterwards keeps the file's value for the switch, unless its text changes the switch itself.

What stays as it was:

  • Writes a script makes through $httpAPI last for this run only.
  • On every platform, rewrites, the MitM host list, the run-time rules of /api/rules/user, module switches and the log level last for this run only.
  • On Chute iOS, Chute tvOS and Chute Android every write lasts for this run only, and no answer carries persisted.
S. Smart Rabbit LLC © All Rights Reserved            updated 2026-12-01 22:53:42

results matching ""

    No results matching ""