Get group AI policy
Viewing v2, the current version
curl --request GET \ --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Get.new(url)request["Authorization"] = 'Bearer <token>'
response = http.request(request)puts response.read_bodyvar client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/groups/:group_id/ai-policy");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);Unchanged from v1. This endpoint’s documented request and response schemas are identical in v1 and v2 — change the
/v1prefix to/v2. Schema equality is not a promise about behavior, so keep your usual smoke tests.
The AI controls the group sets itself, and what it inherits. Requires workspace settings admin.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”ID of the workspace that owns the resource.
ID of the workspace that owns the resource.
ID of the group.
ID of the group.
Responses
Section titled “ Responses ”Successful Response
object
What the policy is attached to.
object
What an AI policy is attached to, from least to most specific.
What the scope sets itself, each value as {value, locked}. Anything absent is inherited.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
A cap on the Creative Units each member may spend in a workspace over one period, as a policy sets it.
object
What a cap does once its member has used all of it.
What the scope inherits from the less specific scopes, each value as {value, source}. A value with no source is the platform default.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
object
object
A cap on the Creative Units each member may spend in a workspace over one period, as a policy sets it.
object
What a cap does once its member has used all of it.
The policy a resolved value comes from.
object
Where a policy is attached: a workspace, or a project, group or member inside one.
object
What an AI policy is attached to, from least to most specific.
When the policy was last written; null if it sets nothing.
Who last wrote the policy, when known.
Example
{ "scope": { "kind": "workspace" }, "policy": { "agent_enabled": { "locked": false }, "agents": {}, "agent_confirm_above_cu": { "locked": false }, "modalities": {}, "new_models_enabled": { "locked": false }, "models": {}, "model_defaults": {}, "guardrails": {}, "output_scoring": {}, "nsfw_tolerance": { "locked": false }, "reference_set_sharing_enabled": { "locked": false }, "workflow_sharing_enabled": { "locked": false }, "invisible_watermark_enabled": { "locked": false }, "usage_caps": {} }, "inherited": { "agent_enabled": { "source": { "scope": { "kind": "workspace" } } }, "agents": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } }, "agent_confirm_above_cu": { "source": { "scope": { "kind": "workspace" } } }, "modalities": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } }, "new_models_enabled": { "source": { "scope": { "kind": "workspace" } } }, "models": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } }, "model_defaults": { "additionalProperty": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } } }, "guardrails": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } }, "output_scoring": { "additionalProperty": { "source": { "scope": { "kind": "workspace" } } } }, "nsfw_tolerance": { "value": 5 }, "reference_set_sharing_enabled": { "value": true }, "workflow_sharing_enabled": { "value": true }, "invisible_watermark_enabled": { "value": false }, "usage_caps": {} }}Unauthenticated — missing or invalid Bearer token.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Resource not found.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Invalid input parameters, or an Idempotency-Key reused for a different request.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Rate limited — retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Internal server error.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}