Read access settings
Each method returns settings explicitly set at the requested level (employee, team, or organization). For example, a model can have permission default for an employee and forbid for the organization. The most restrictive setting across all levels takes effect.
Who can read settings?
Section titled “Who can read settings?”- An owner or admin can read settings for any employee, any team, and the organization.
- A manager can read their own settings, their teams’ settings, the settings of members of those teams, and the organization’s settings. A team or employee outside their scope returns
forbidden. - A key whose creator has the member role, or a personal account key, receives HTTP
403for the whole request.
Reading settings leaves them unchanged and creates no entry in the organization’s audit log.
Settings Format
Section titled “Settings Format”Selected level settings
| Parameter | Type | Description |
|---|---|---|
settings* | object | For showBalance, webSearch, imageGeneration, thinkingMode, and useOrgBalance, the accepted values are allow, forbid, and default |
globalLimit* | object | {dailyLimit, monthlyLimit} is the total limit for all models, rubles; 0 = no limit |
inflight* | object | { inflightCountLimit, inflightRubLimit, maxCostLimit } sets concurrent generation limits. Use 0 for no limit |
models* | object[] | Models with settings at this level: { model, permission, dailyLimit, monthlyLimit, paramRules } |
models[].paramRules* | object | null | Limitations on model parameters in rules format (see "Restrictions by parameters"); null - not specified |
To update a setting, copy the relevant fields into the body of the update request. For example, pass the login and settings.globalLimit.dailyLimit as items[0].login and items[0].dailyLimit to update the overall spending limit. Omit monthlyLimit to keep the current monthly limit. Updates accept whole rubles. If the current limit is fractional, supply a new whole number only when you intend to change it.
https://gptunnel.ru/api/v1/access/getSettingsRequest parameters
| Parameter | Type | Description |
|---|---|---|
logins* | string[] | Array of 1 to 25 employee logins. Matching is case-insensitive. |
The response lists matching employees in items as { login, settings }. Failures appear in failed and failedLogins with the reason not_found (outside the organization), forbidden (outside the manager’s teams), or error.
Set GPTUNNEL_API_KEY and replace the placeholders with values for your organization.
import jsonimport osfrom urllib.request import Request, urlopen
key = os.environ.get("GPTUNNEL_API_KEY")if not key: raise SystemExit("Set GPTUNNEL_API_KEY")
body = { "logins": [ "ivanov@company.com", "nobody@company.com" ]}request = Request( "https://gptunnel.ru/api/v1/access/getSettings", method="POST", headers={ "Authorization": key, "Content-Type": "application/json", }, data=json.dumps(body).encode("utf-8"),)with urlopen(request, timeout=30) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/api/v1/access/getSettings' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "logins": [ "ivanov@company.com", "nobody@company.com" ]}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "logins": [ "ivanov@company.com", "nobody@company.com" ]}const response = await fetch("https://gptunnel.ru/api/v1/access/getSettings", { method: "POST", headers: { Authorization: key, "Content-Type": "application/json", }, body: JSON.stringify(body),})if (!response.ok) throw new Error(await response.text())console.log(await response.json()){ "code": 0, "items": [ { "login": "ivanov@company.com", "settings": { "settings": { "showBalance": "default", "webSearch": "forbid", "imageGeneration": "default", "thinkingMode": "default", "useOrgBalance": "default" }, "globalLimit": { "dailyLimit": 0, "monthlyLimit": 5000 }, "inflight": { "inflightCountLimit": 2, "inflightRubLimit": 500, "maxCostLimit": 150 }, "models": [ { "model": "seedance-2-5", "permission": "default", "dailyLimit": 0, "monthlyLimit": 0, "paramRules": { "by": "resolution", "any": { "max": { "duration": 5 } }, "values": { "480p": { "deny": true } } } } ] } } ], "failed": 1, "failedLogins": [ { "login": "nobody@company.com", "reason": "not_found", "message": "Employee not found in the organization." } ]}https://gptunnel.ru/api/v1/access/getTeamSettingsPass 1 to 25 team IDs in teamIds. An owner or admin with permission to manage employees can get the IDs from the team list. In the business dashboard, a manager can open Analytics → Teams, open the menu for their team, and select Copy ID to copy its teamId. An admin can also share the ID.
Each entry in items contains { teamId, settings }. Failures appear in failed and failedTeams with the reason not_found, forbidden (the team is outside the manager’s scope), or error.
import jsonimport osfrom urllib.request import Request, urlopen
key = os.environ.get("GPTUNNEL_API_KEY")if not key: raise SystemExit("Set GPTUNNEL_API_KEY")
body = { "teamIds": [ "664f0a1b2c3d4e5f60718293" ]}request = Request( "https://gptunnel.ru/api/v1/access/getTeamSettings", method="POST", headers={ "Authorization": key, "Content-Type": "application/json", }, data=json.dumps(body).encode("utf-8"),)with urlopen(request, timeout=30) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/api/v1/access/getTeamSettings' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "teamIds": [ "664f0a1b2c3d4e5f60718293" ]}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "teamIds": [ "664f0a1b2c3d4e5f60718293" ]}const response = await fetch("https://gptunnel.ru/api/v1/access/getTeamSettings", { method: "POST", headers: { Authorization: key, "Content-Type": "application/json", }, body: JSON.stringify(body),})if (!response.ok) throw new Error(await response.text())console.log(await response.json())Organization
Section titled “Organization”https://gptunnel.ru/api/v1/access/getOrgSettingsThis method takes no parameters. Send an empty JSON object {}. The response is { "code": 0, "settings": { ... } } in the format above.
import jsonimport osfrom urllib.request import Request, urlopen
key = os.environ.get("GPTUNNEL_API_KEY")if not key: raise SystemExit("Set GPTUNNEL_API_KEY")
body = {}request = Request( "https://gptunnel.ru/api/v1/access/getOrgSettings", method="POST", headers={ "Authorization": key, "Content-Type": "application/json", }, data=json.dumps(body).encode("utf-8"),)with urlopen(request, timeout=30) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/api/v1/access/getOrgSettings' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = {}const response = await fetch("https://gptunnel.ru/api/v1/access/getOrgSettings", { method: "POST", headers: { Authorization: key, "Content-Type": "application/json", }, body: JSON.stringify(body),})if (!response.ok) throw new Error(await response.text())console.log(await response.json()){ "code": 0, "settings": { "settings": { "showBalance": "default", "webSearch": "default", "imageGeneration": "default", "thinkingMode": "forbid", "useOrgBalance": "default" }, "globalLimit": { "dailyLimit": 0, "monthlyLimit": 100000 }, "inflight": { "inflightCountLimit": 0, "inflightRubLimit": 0, "maxCostLimit": 5000 }, "models": [ { "model": "gpt-6-luna", "permission": "forbid", "dailyLimit": 0, "monthlyLimit": 0, "paramRules": null } ] }}{ "code": 7, "message": "Not allowed to perform this action for the organization."}{ "error": { "message": "Unauthorized", "type": "unauthorized_request_error", "param": null, "code": null }}