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-secretmeaning "no authentication", local scripts start receiving401. Either read the generated token out of the app, or writeexternal-http-secret = noneto 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/featuresreports each switch as it is set —record_traffic,mitm,mitm_h2,mitm_auto_quic_block,rewrite— andlicensed.effectivesays what actually runs, for five items only:record_traffic,mitm,rewrite,scriptsandlan_proxy. On the free edition all five are false, so a switch can read on while itseffectiveentry is false.inactiveis an object naming what the running configuration asks for that does not run in this edition: the countsscripts,scriptRules,dnsScripts,rewritesandmapLocals, and the flagsmitm,bodyCapture,lanProxyandexitNode(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/connectionsacceptslimit(positive integer, default and maximum 1000) andcursor(returns only connections withidgreater than the cursor). The responsedatacarriesconnections,total,page_size,has_more,server_time, and — when more pages exist —next_cursor.since(seconds, theserver_timeof an earlier answer) returns only the connections that changed after that moment, and addsactive_ids, the ids of every connection open now: one that an earlier answer had and that is missing from them has closed. Asincelater thanserver_timeis taken as0, 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) andprocess(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; andfailed=1(closed by a timeout, a failed dial, a name that did not resolve, or IPv6 while it is off) orfailed=0.cursorpages through what passes;totalstill counts every open connection.GET /api/connections/historyacceptslimit(default 100, maximum 1000) andcursor/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 inmessageand returns anext_cursorto go on from.GET /api/connections/:id/requestand.../responsereturn{"connection_id": <id>, "data": "<base64>"}. Captures larger than 2 MiB return413. Without Chute Pro both return403, withrequest data is not availableorresponse data is not available, for bodies recorded during an earlier licensed run as well.GET /api/connections/:idreturns one connection, open or recorded, as{connection, source, service_start_time}—sourceisactiveorhistory. The id is the one the lists and the/requestand/responseroutes use; an id that matches neither an open nor a recorded connection is a404.GET /api/configreturns 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 toPUT /api/configthat still says<redacted>anywhere is refused with400and a message naming the first such line. Submit the original configuration instead.GETandPUT /api/configare also reachable as/api/configs, and as the Clash alias/configs.PUT /api/configaccepts 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;400with the codereload_rejectedwhen the engine refused the configuration and kept the one that was running, with the reason in the message;202with{"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#!includein it resolves against the folder that configuration was loaded from (Including Another File).GET /api/configalso returnsrevision, 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 asrevisionin the body (or the query string) ofPUT /api/configto 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 with409and{"ok": false, "error": {"code": "revision_conflict", "message": "...", "current_revision": "..."}}and changes nothing, and a reload that is taken answers{"reloaded": true, "revision": "<new revision>"}. Withoutrevisionthe route behaves as it always has.GET /api/config/sectionslists 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 byoccurrence, counted from 1, for a header that appears more than once. Itsrevisionis computed from that section alone, so a change elsewhere leaves it as it was. A section that holds an#!includeline, every section after it, and the one that holds#!MANAGED-CONFIGare noteditable, andreadonly_reasonsaysincludeormanaged-config.GET /api/config/section?name=<name>&occurrence=<n>returns one section:{name, occurrence, content, revision, editable, line_count, config_revision},contentbeing its body without the header, asGET /api/configshows 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 asPUT /api/config.contentmust not contain a section header: one section is written at a time.revisionis required for a section that exists; one that changed since it was read answers409revision_conflictwith the section'scurrent_revision, and a section that is not editable answers403section_readonly. Withoccurrenceone 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 is404. 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, sonormalizedsays when the text differs from what was sent, andrevisionis the one to send next. For a managed configuration anotesays that the next managed update replaces the change. A configuration the engine refuses answers400reload_rejectedand changes nothing; with the engine stopped the answer is409not_running; and, as withPUT /api/config,202means the engine did not answer in time and the write is still queued.POST /api/config/revert-runtimeundoes 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/userare kept.202with{"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/configandPUT /api/config/sectionare kept by the app and survive a restart; their answers addpersisted, and the app can refuse them with409or503— see Writes that Chute Mac keeps. PUT /api/policies/:grouptakes the selection from the first of the body keyspolicy,name,selected,select; the value may be a policy name or a numeric index as a string. The special group nameGLOBALsets the global selected policy.GLOBALis matched in any case, andselect_policy_factorymeans the same; but a group of the configuration's own whose name is exactly the one given comes first, so a group calledGlobalis changed like any other group.- In
GET /api/policies, every policy, group and group member carriesendpoint, the policy it leads to now — followed through groups, and through the built-inPROXYto the policy selected for Global mode — andendpoint_ping, that policy's latency. A group's ownpingis0, not measured, soendpoint_pingis the figure to read for a group or forPROXY. GET /api/policies/providerslists every proxy provider, including the one apolicy-pathgroup fetches from (named<group>-policy-path). Each entry hasname,type,urlorpath,interval,last_updated,last_error,policy_countandwarnings.last_updatedis 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 — and0if none ever loaded;policy_countis how many policies the provider yields after its filters, so0with alast_errornames a provider that gives nothing.GET /api/policies?summary=1lists every entry without its members:name,type,endpoint,endpoint_pingandhidden, plusselectedandmember_countfor a group andpingfor a node.?group=<name>lists only the entry of that exact name — in full, or summarized whensummary=1is given too — and answers404when there is none. Names are case-sensitive:Homeandhomeare two policies.GET /api/policies/detail?name=<policy>describes one policy or group:name,type,line(its configuration line asGET /api/configshows it; a proxy provider's node, which has none, written as a line), the run-timeserver,port,udp,ping,endpointandendpoint_ping, andproviderfor a node a proxy provider gave.400without a name,404for a name that is not a policy.PUT /api/moderequires a JSON number:{"mode": 0}—0rule,1direct,2proxy.PUT /api/features/mitmandPUT /api/features/record-traffictake{"enabled": true}.GET /api/logsacceptssince(Unix seconds); the in-memory buffer keeps the most recent 1000 entries, each{timestamp, wall_time, level, section, message}—timestampandwall_timecarry the same Unix-seconds value, nudged forward when the clock does not advance so entries stay strictly ordered. Withlevel(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),offsetorlimit(default 200, at most 1000), the entries are filtered first and then paged, oldest first, and the answer addstotalandnext_offset.GET /api/healthreports what the engine is holding and why it last refused something, plus how the previous run ended (clean,unclean, orsuspected_memory— see Troubleshooting).addressFamilysays how Chute judges the IPv6 way out —ipv6ishealthy,confirmingordegraded— with counts of what it has done about it; on the Apple enginesselfLoopreports the self-loop guard. Neither carries an address.GET /api/statuscarriesnetwork:kind(wifi,cellular,wiredorunknown),ssid,bssidandrouter_ipwhen the system gives them,on_wifi, andsuspend_active— whether an[SSID Setting]entry suspends Chute on this network. On Apple TVkindis alwaysunknown.GET /api/eventsserves the in-memory ring;?persisted=1reads this run's stored history instead, and answersavailable: falsewhen record keeping is off. Every event carriesseq, a number that only grows during the run, and every reply carrieslatest_seq;?after=<seq>returns only the events after that one. To follow the events, poll withafterset to the lastlatest_seqyou received:sincefilters on each event's wall-clocktimeand can skip events that share a time or come after the clock is changed.GET /api/tailscaleanswersstate: "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/:policyrejects a policy name that is not defined rather than measuringREJECT. POST /api/diagnostics/geoiptakesaddress, 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_nameis in English. A name is first resolved through the engine's own resolver,[Host]included, preferring an IPv4 answer;404when it does not resolve.POST /api/diagnostics/group-test/:policytimes every member of a group with one HTTPS request each — the requesturl-test/:policysends for a single policy — at most 8 at a time on iOS and tvOS and 16 on macOS (concurrencyasks for fewer).urlmust behttps; without it each member is fetched at its own HTTPS test URL or a default one. The whole sweep answers at once, withintimeoutseconds (25 at most, and by default):memberslists every member in the group's order withsuccess,duration_ms,status_code,errorandurl— one that had not finished is markedtimed_out— andtested,succeeded,failed,timed_outandcompletesum 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.404for an unknown name,400for a policy that is not a group or a URL that is nothttps.GET /api/scriptslists the enabled generic scripts as{name, type};POST /api/scripts/runtakesnamefrom the body or the query string, is bounded like the diagnostics probes, and answers{name, timedOut, result}—timedOuttells a script that never called$doneapart from one that ran to completion. A name that is not an enabled generic script is a404. Without Chute Pro it answers403,script is not available.POST /api/rules/matchanswers where a request would go, without opening a connection. It takeshost(or aurlto take the host and port from; aURL-REGEXrule is tested against thaturlexactly as written, although in real traffic it only ever sees plainhttp://requests),port(default 443), and optionalip,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 thematchedrule (its line, type, the policy it names and theresolved_policya group currently points at), thepolicy,need_resolve, and therule_countandmatch_generationthe answer was computed against. Because a domain is matched twice — once on the name and again once an address is known —passesholds one entry per pass; without aniponly the pre-resolution pass exists and the reply says so innote. Addexplain=truefor 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/validateparses a configuration and throws it away: the running engine adopts nothing. Send it as{"configuration": "<full text>"}or as the raw text. The reply isvalid,error_count,advisory_count,rule_count,policy_countand anerrorslist of{line, severity, content, error}—severityseparates a line that was refused from one accepted with a caveat, andcontentis 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 beforePUT /api/config, which restarts the run you are debugging.GET /api/loglevelreports the currentlevel, thenslog_level, thesectionsbeing written to file, and theavailable_levels/available_sectionsyou may set.PUT(orPATCH) takeslevel,sections, or both:sectionsis an array of section names or the string"all", and an empty array is refused — to stop logging uselevelnone. Changing the level this way does not restart the run, which is the point:loglevel = verbosein the file needs a reload, and a reload loses the thing you were trying to see.GET /api/rulesalso reportsrewrite_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 reportsrewrite_hit_dropped_rulesfor any beyond that.ruleslists 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 withFINAL;rule_regionsnames each line's origin, index for index (front,user,module,configuration).GET /api/rulesacceptsoffset,limit(default 500, at most 5000) andfilter(part of the rule line, ignoring case); without a filter the table is cut before a line is written, andrule_regionsstays index for index. Like the other paged routes,GET /api/logsandGET /api/dns, it then addstotal, the length of the list after its filter, andnext_offset, which is absent on the last page. Anoffset,limitor filter that is not valid is refused with400rather than read as0, and a largerlimitis cut to the maximum. Without any of these parameters, each of these routes answers as it always has.GET /api/dnsacceptsfilter(part of a name or an address, ignoring case), which narrows all three lists, andoffsetandlimit(default 500, at most 5000), which pagerecords, then ordered by name./api/rules/userholds 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.GETlists them;PUTreplaces them andPOSTadds behind the ones there, both taking{"rules": ["<rule line>", ...]}or a single{"rule": "<rule line>"}, written as in the file;DELETEremoves them all. A write is all or nothing: a line that does not parse, or aFINAL, is refused with400and the rules stay as they were. A rule whose policy the running configuration does not define is taken — it fails closed withREJECT— and named inwarnings.close_rerouted,trueby default, closes the connections the changed rules route elsewhere, and only those;falseleaves every connection open — onDELETEpass it as?close_rerouted=false. Every method answers with the currentrules. The rules are kept through a reload and are gone when the engine stops.PATCHis not accepted on this path.GET /api/moduleslists the loaded modules as{modules: [{id, name, source_url, enabled}]}.idis what identifies a module — its name may be empty or shared — andsource_urlis there for a module loaded from a URL.GET /api/modules/item?id=<id>addscontent, the text the module was loaded from.PUT /api/modules/item?id=<id>with{"enabled": false}turns a module off for this run, andtrueturns it back on; it answers with the module as listed, or202with{"queued": true}when the engine did not answer in time. Like the other run-time changes, a reload orPOST /api/config/revert-runtimebrings back what the configuration says.GET /api/resourceslists what the configuration fetches from elsewhere as{resources: [{kind, name, url, path, last_updated, last_error, count, refreshable}]}:kindisrule-provider,rule-set(named by its URL),proxy-provider(policy-pathgroups included) ormodule, andurlandpathappear when there is one. A module is read once, when the configuration loads, and keeps no record, so its entry says0and no error and cannot be refreshed.POST /api/resources/refreshwith{"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 readGET /api/resourcesagain for its outcome.moduleandgeoipare refused with400, and a name the running configuration does not load is a404.POST /api/rewrites/:familytakes{"rule": "<configuration line>"}— the same text you would write in the file. A line that does not parse is refused with400rather than stored as a rule that can never match.:familyis one ofurl-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=harreturns a HAR 1.2 document, andPOST /api/diagnostics/bundlereturns a zip — both are files, so unlike every other endpoint they are not wrapped in the{"ok": ..., "data": ...}envelope.exportacceptssource(current, the default, orhistory),limit(default 100, maximum 300),ids, andbodies=1to include the captured payloads. Each entry carries a_klobject 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/connectionsandGET /api/connections/historycarrieschainPath, the path from this device to the exit, as inAirport/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 ofGET /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.
PUTendpoints also acceptPATCH. 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 (/versionreturns{"name", "run_id", "egress_probe"}, whereegress_probeisnetwork_addresson the Apple engines andegress_ipon 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
$httpAPIlast 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.