Organization settings
In the dashboard, open Access → Organization settings. These settings apply to all employees and teams, alongside any settings at those levels. The methods below are the organization-wide counterparts of the employee and team methods. The key identifies the organization, so there is no list of employees or teams to pass.
See concurrent generation limits and model parameter rules for the organization-wide limits on generation.
Who can make changes
Section titled “Who can make changes”Only a key whose creator is an owner or admin can change these settings. A manager can update their own teams and team members. An organization-level request with a manager’s key returns HTTP 403 and code 7. Personal account keys and keys whose creator has the member role receive HTTP 403 for the entire request.
Responses
Section titled “Responses”A successful request returns { "code": 0, "updated": true }. The following errors apply to the entire request.
Errors
| Parameter | Type | Description |
|---|---|---|
400 (code 3) | error | Incorrect entry; for unknown model - details[0].code = model_not_found and unknownModels, nothing applied |
403 (code 7) | error | A key with the manager or member role. |
403 (code 13 / 30) | error | Personal account key/key without permission Full dashboard access |
500 (code 1) | error | Unforeseen Error — Repeat Request |
Feature switches
Section titled “Feature switches”https://gptunnel.ru/api/v1/access/setOrgRestrictionsSupply at least one of the employee settings fields: showBalance, webSearch, imageGeneration, thinkingMode, or useOrgBalance. Each accepts allow, forbid, or default. Omitted settings keep their current values.
Request parameters
| Parameter | Type | Description |
|---|---|---|
settings* | object | Feature switches: { showBalance?, webSearch?, imageGeneration?, thinkingMode?, useOrgBalance? }. Each accepts allow, forbid, or default. |
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 = { "settings": { "thinkingMode": "forbid", "showBalance": "allow" }}request = Request( "https://gptunnel.ru/api/v1/access/setOrgRestrictions", 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/setOrgRestrictions' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "settings": { "thinkingMode": "forbid", "showBalance": "allow" }}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "settings": { "thinkingMode": "forbid", "showBalance": "allow" }}const response = await fetch("https://gptunnel.ru/api/v1/access/setOrgRestrictions", { 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, "updated": true}Access to models
Section titled “Access to models”https://gptunnel.ru/api/v1/access/setOrgModelAccessTo set organization-wide model access, send 1 to 100 { model, permission } entries. Each permission accepts allow, forbid, or default. If any model ID is unknown, none of the changes are applied.
Request parameters
| Parameter | Type | Description |
|---|---|---|
models* | object[] | Array of 1–100 { model, permission } objects. Use a model ID from GET /v1/models. |
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 = { "models": [ { "model": "gpt-6-luna", "permission": "forbid" } ]}request = Request( "https://gptunnel.ru/api/v1/access/setOrgModelAccess", 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/setOrgModelAccess' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "models": [ { "model": "gpt-6-luna", "permission": "forbid" } ]}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "models": [ { "model": "gpt-6-luna", "permission": "forbid" } ]}const response = await fetch("https://gptunnel.ru/api/v1/access/setOrgModelAccess", { 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, "updated": true}{ "code": 3, "message": "Invalid input, check schema issues.", "details": [ { "code": "model_not_found", "message": "Unknown model id(s) — see unknownModels. Nothing was applied. Use ids returned by GET /v1/models.", "unknownModels": ["no-such-model"] } ]}Model limits
Section titled “Model limits”https://gptunnel.ru/api/v1/access/setOrgModelLimitsSet daily or monthly spending limits in whole rubles per model across the organization. Send 1 to 100 { model, dailyLimit?, monthlyLimit? } entries. Use 0 for no limit. Only the supplied fields are updated.
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 = { "models": [ { "model": "claude-5.5-haiku", "dailyLimit": 1000 } ]}request = Request( "https://gptunnel.ru/api/v1/access/setOrgModelLimits", 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/setOrgModelLimits' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "models": [ { "model": "claude-5.5-haiku", "dailyLimit": 1000 } ]}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "models": [ { "model": "claude-5.5-haiku", "dailyLimit": 1000 } ]}const response = await fetch("https://gptunnel.ru/api/v1/access/setOrgModelLimits", { 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())Total limit
Section titled “Total limit”https://gptunnel.ru/api/v1/access/setOrgGlobalLimitSet the organization’s total daily or monthly spending limit across all models. Pass at least one field in { dailyLimit?, monthlyLimit? }. Values are in whole rubles. Use 0 for no limit.
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 = { "monthlyLimit": 100000}request = Request( "https://gptunnel.ru/api/v1/access/setOrgGlobalLimit", 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/setOrgGlobalLimit' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "monthlyLimit": 100000}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "monthlyLimit": 100000}const response = await fetch("https://gptunnel.ru/api/v1/access/setOrgGlobalLimit", { 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, "updated": true}Current values return getOrgSettings.