Repository navigation
API Methods
The reference for every method of API version 1. Concepts, the settings syntax and errors are explained in the API overview.
| Method | Shortcut | Argument | Changes settings |
|---|---|---|---|
state.get |
state |
— | |
tuning.get |
tuning |
— | |
tuning.set |
settings | yes | |
profile.list |
profile |
— | |
profile.apply |
profile name or ID | yes | |
app.list |
app |
— | |
app.set |
package, then a profile, settings or autotune=FPS
|
yes | |
app.clear |
package | yes | |
device.get |
device |
— | |
api.info |
api |
— |
-
ct …is the command line, withalias ct='adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune'. - Kotlin examples use
val uri = Uri.parse("content://com.aure.clustertune.api")and run off the main thread; the Java library page has a complete helper. - Every method also works as
adb shell content call --uri content://com.aure.clustertune.api --method METHOD [--arg ARG], througham broadcast(see Raw ADB commands), and, for the ones the plugin offers, from Tasker. - Replies below show the
dataobject. Example values come from an AYN Odin 3 (CPU policies 0 and 6, Adreno GPU); your device's will differ. - Any method can fail with
access_denied,access_pendingorinvalid_argument(bad extras or argument). Methods that read or change CPU/GPU values fail withunavailablewhile ClusterTune's privileged host can't be used;profile.list,device.getandapi.infostill answer.
What is applied right now, and who applied it.
ct statecontentResolver.call(uri, "state.get", null, null)| Field | Meaning |
|---|---|
profile |
{id, name} when the live values match a profile; null for custom values or while Auto Tune is active |
execution_method |
pserver, root or null |
cpu[] |
Per policy: id, the effective min_khz, max_khz and governor, plus requested_min_khz and requested_governor (the overrides this ClusterTune process last applied; null after ClusterTune restarts, so use tuning.get for what is saved) |
gpu |
max_hz, governor, requested_governor; null without GPU tuning |
effective |
Who applied the settings: source (normal, app, combined, sleep, manual or stock), id, name and the contributing packages; null until ClusterTune records one |
auto_tune |
enabled (the experimental setting), active, target_fps, the tuned package while active, and diagnostics from the latest session: status, reason, measured_fps, frame_backend, message
|
app_detection |
connected, and the last connection error. App assignments and Auto Tune only act while connected |
These are frequency limits, not instantaneous clock speeds. Firmware boosts can hold the effective minimum above the one requested. Values that can't be read are null.
{
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"},
"execution_method": "pserver",
"cpu": [
{"id": 0, "min_khz": 1996800, "max_khz": 2227200, "governor": "walt", "requested_min_khz": null, "requested_governor": null},
{"id": 6, "min_khz": 1017600, "max_khz": 2246400, "governor": "walt", "requested_min_khz": null, "requested_governor": null}
],
"gpu": {"max_hz": 1100000000, "governor": "msm-adreno-tz", "requested_governor": null},
"effective": {"source": "normal", "id": "bundled_cq8725s_medium", "name": "Medium Underclock", "packages": []},
"auto_tune": {"enabled": false, "active": false, "target_fps": null, "package": null, "status": null,
"reason": null, "measured_fps": null, "frame_backend": null, "message": null},
"app_detection": {"connected": true, "error": null}
}Include auto_tune when reporting an Auto Tune problem: status (for example waiting_for_frames, optimizing, monitoring, stopped) and reason (for example frame_data_stale, efficiency_trim) say what it was doing.
The saved settings ClusterTune keeps applied, and their revision.
ct tuningcontentResolver.call(uri, "tuning.get", null, null)| Field | Meaning |
|---|---|
revision |
Identifies these settings; pass it as if_revision for a conditional write
|
profile |
{id, name} when the tuning came from a profile; null for custom values |
cpu[] |
Per policy: id, min_khz (null: Stock minimum), max_khz, governor (null: default) |
gpu |
max_hz and governor; null without GPU tuning |
Values are resolved the way ClusterTune's own restores resolve them: missing or invalid saved values read as Stock, and an unset GPU limit as the GPU's Stock maximum.
{
"revision": "7e5f24cdc5c80ef4",
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"},
"cpu": [
{"id": 0, "min_khz": null, "max_khz": 2227200, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 2246400, "governor": null}
],
"gpu": {"max_hz": 1100000000, "governor": null}
}Changes part of the tuning and applies it. Anything you don't mention keeps its saved value. The argument uses the short settings syntax or its JSON form. Accepts if_revision.
ct tuning set cpu6.max=2.4GHz gpu.max=600
ct tuning set cpu.gov=schedutil
ct tuning set cpu0.min=1GHz cpu0.max=stock
ct tuning set cpu6.max=2438.4 --if-revision 7e5f24cdc5c80ef4contentResolver.call(uri, "tuning.set", "cpu6.max=2.4GHz gpu.max=600", null)
contentResolver.call(uri, "tuning.set", """{"cpu":[{"id":6,"max_khz":2246400}]}""", null)It builds on the saved tuning, never on whatever is live at the moment, so a temporary Auto Tune ceiling or app override can't end up saved by accident. A change stops an active Auto Tune session and is restored like any tuning; it doesn't create a profile or turn off app or sleep automation.
| Field | Meaning |
|---|---|
applied |
true |
profile |
null (the tuning now holds custom values) |
cpu[] |
{id, max_khz} per policy, read back and verified by the host |
gpu |
{max_hz} read back, or null |
revision |
The new revision |
adjusted |
Present when a short-form value was snapped: setting, requested, and applied_khz or applied_hz
|
{
"applied": true,
"profile": null,
"cpu": [{"id": 0, "max_khz": 2227200}, {"id": 6, "max_khz": 2246400}],
"gpu": {"max_hz": 525000000},
"revision": "0ef8bb99a0bc1aca",
"adjusted": [
{"setting": "cpu6.max", "requested": "2.4GHz", "applied_khz": 2246400},
{"setting": "gpu.max", "requested": "600", "applied_hz": 525000000}
]
}Errors: invalid_argument (syntax, unknown policy or governor, minimum above maximum…), unsupported (GPU settings without GPU tuning), conflict, apply_failed, superseded, persistence_failed.
All profiles, in the app's order. Stock is included once ClusterTune knows the device's CPU policies.
ct profilecontentResolver.call(uri, "profile.list", null, null)| Field | Meaning |
|---|---|
available, unavailable_reason, execution_method
|
Whether tuning works right now, and if not, why |
profiles[] |
id, name, source (user, bundled, or virtual for Stock), cpu[] with id/min_khz/max_khz/governor, and gpu with max_hz/governor
|
In a profile, a null minimum means Stock, a null governor the default, and a null GPU limit leaves the GPU limit alone.
{
"available": true,
"unavailable_reason": null,
"execution_method": "pserver",
"profiles": [
{"id": "bundled_cq8725s_medium", "name": "Medium Underclock", "source": "bundled",
"cpu": [{"id": 0, "min_khz": null, "max_khz": 2227200, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 2246400, "governor": null}],
"gpu": {"max_hz": 1100000000, "governor": null}},
{"id": "virtual_stock", "name": "Stock", "source": "virtual",
"cpu": [{"id": 0, "min_khz": null, "max_khz": 3532800, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 4320000, "governor": null}],
"gpu": {"max_hz": 1100000000, "governor": null}}
]
}Applies a profile and saves it as the tuning. The argument is a profile ID or name. Accepts if_revision.
ct profile apply medium
ct profile apply Large Underclock
ct profile apply stock
ct profile apply bundled_cq8725s_small --if-revision 7e5f24cdc5c80ef4contentResolver.call(uri, "profile.apply", "medium", null)The reply has the same fields as tuning.set, with profile set to {id, name} and no adjusted. Everything the profile defines is applied; minimums and governors it leaves unset return to Stock and the default.
Errors: profile_not_found, ambiguous_profile (with data.matches), unsupported (the profile holds values this device doesn't support), conflict, apply_failed, superseded, persistence_failed.
Per-app assignments.
ct appcontentResolver.call(uri, "app.list", null, null)| Field | Meaning |
|---|---|
auto_tune_enabled |
Whether the experimental Auto Tune setting is on |
app_detection |
connected and error, as in state.get
|
assignments[] |
package, label, type (profile, custom or auto_tune), profile ({id, name}), custom (cpu[] and gpu, as in a profile), auto_tune ({target_fps}), and active (false for Auto Tune assignments while that setting is off) |
{
"auto_tune_enabled": false,
"app_detection": {"connected": true, "error": null},
"assignments": [
{"package": "dev.kitcatkode.totk", "label": "Tears of the Kingdom", "type": "profile",
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"},
"custom": null, "auto_tune": null, "active": true}
]
}Makes ClusterTune apply settings while an app is visible, exactly like the app-profile dialog in the app. Each package has one assignment at most, and app.set replaces it, so repeating a call is safe.
The argument is the package name followed by one of:
| After the package | Assigns |
|---|---|
| A profile name or ID | That profile |
| Short settings | Custom values |
autotune=FPS |
An Auto Tune target from 1 to 1000 FPS |
ct app set com.example.game medium
ct app set com.example.game cpu6.max=2.4GHz gpu.max=607 cpu6.gov=schedutil
ct app set com.example.game autotune=60contentResolver.call(uri, "app.set", "com.example.game medium", null)The JSON form takes package and exactly one of profile_id (an ID or name), custom (JSON settings) or auto_tune:
{"package": "com.example.game", "custom": {"cpu": [{"id": 6, "max_khz": 2246400}], "gpu": {"max_hz": 607000000}}}Good to know:
- The package must be installed and visible to ClusterTune, and ClusterTune itself can't be assigned. The label comes from Android.
- While the app is visible, anything the assignment doesn't set keeps the saved tuning, minimums and governors included. An inherited minimum above the app's maximum is dropped.
- Custom values snap like
tuning.set, but maximums only snap to real firmware steps.stockanddefaultare rejected here: leave the setting out instead. - Auto Tune targets need Enable autotune settings (experimental) in ClusterTune's Settings (otherwise
unsupported), and never exceed the display's refresh rate. - Assignments only act while app detection is connected.
app.setasks Android to start it if needed, but Android 12+ may refuse while ClusterTune is in the background; the assignment is saved anyway and takes effect once ClusterTune is opened or the device restarts.
Reply: the stored assignment (as in app.list), app_detection, and adjusted when a value was snapped.
{
"assignment": {"package": "com.example.game", "label": "Example Game", "type": "custom", "profile": null,
"custom": {"cpu": [{"id": 6, "min_khz": null, "max_khz": 2246400, "governor": null}],
"gpu": {"max_hz": 607000000, "governor": null}},
"auto_tune": null, "active": true},
"app_detection": {"connected": true, "error": null},
"adjusted": [{"setting": "cpu6.max", "requested": "2.4GHz", "applied_khz": 2246400}]
}Errors: invalid_argument (unknown or invisible package, bad settings), profile_not_found, ambiguous_profile, unsupported (Auto Tune is off, or GPU settings without GPU tuning).
Removes an app's assignment. The argument is the package name. Clearing an app that has no assignment is not an error.
ct app clear com.example.gamecontentResolver.call(uri, "app.clear", "com.example.game", null)Reply: {"removed": true}, or false when there was nothing to remove.
The device's CPU policies, frequency steps, governors and GPU.
ct devicecontentResolver.call(uri, "device.get", null, null)| Field | Meaning |
|---|---|
available, unavailable_reason, execution_method
|
As in profile.list
|
cpu[] |
id (the policy ID used in settings), cores, min_khz[] and max_khz[] (supported steps, ascending), stock_min_khz, stock_max_khz, governors[]
|
gpu |
max_hz[], stock_max_hz, governors[]; null without GPU tuning |
An empty governor list means the governor can't be changed through the API. The Stock maximum may lie above the highest selectable step; settings reach it with stock.
Shortened (each array lists every step):
ct device prints every step in MHz, which is the easiest way to pick values for the short syntax.
The API version, method names, shortcuts, units, extras and notification URIs. It doesn't touch the device, but like every method it needs access.
ct apicontentResolver.call(uri, "api.info", null, null){
"api_version": 1,
"methods": ["api.info", "state.get", "tuning.get", "tuning.set", "profile.list", "profile.apply",
"app.list", "app.set", "app.clear", "device.get"],
"shortcuts": {"state": "state.get", "tuning": "tuning.get", "profile": "profile.list",
"app": "app.list", "device": "device.get", "api": "api.info"},
"cpu_frequency_unit": "kHz",
"gpu_frequency_unit": "Hz",
"extras": ["api_version", "if_revision"],
"notification_uris": ["content://com.aure.clustertune.api/state", "content://com.aure.clustertune.api/tuning",
"content://com.aure.clustertune.api/profile", "content://com.aure.clustertune.api/app"]
}External API
Project
{ "available": true, "unavailable_reason": null, "execution_method": "pserver", "cpu": [ {"id": 0, "cores": [0], "min_khz": [384000, 556800, /* … */ 3532800], "max_khz": [384000, 556800, /* … */ 3532800], "stock_min_khz": 384000, "stock_max_khz": 3532800, "governors": ["walt", "conservative", "powersave", "performance", "schedutil"]}, {"id": 6, "cores": [6], "min_khz": [1017600, /* … */ 4320000], "max_khz": [1017600, /* … */ 4320000], "stock_min_khz": 1017600, "stock_max_khz": 4320000, "governors": ["walt", "conservative", "powersave", "performance", "schedutil"]} ], "gpu": {"max_hz": [160000000, 222000000, /* … */ 1100000000], "stock_max_hz": 1100000000, "governors": ["msm-adreno-tz"]} }