List AI policies
Viewing v1, superseded by v2
curl --request GET \ --url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policies \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policies"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policies';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/v1/workspaces/:workspace_id/ai-policies"
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/v1/workspaces/:workspace_id/ai-policies", 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/v1/workspaces/:workspace_id/ai-policies") .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/v1/workspaces/:workspace_id/ai-policies")
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/v1/workspaces/:workspace_id/ai-policies");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.
List every AI policy stored in the workspace: the workspace’s own and each project, group and member policy, with what it sets and its last write. A scope that sets nothing has no policy here. 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.
Query Parameters
Section titled “Query Parameters”What an AI policy is attached to, from least to most specific.
Only policies attached to this kind of scope.
Maximum number of results to return.
Maximum number of results to return.
Cursor from a previous response to fetch the next page.
Cursor from a previous response to fetch the next page.
Responses
Section titled “ Responses ”Successful Response
object
A stored policy: the scope it is attached to, what it sets, and its last write.
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.
The AI controls one scope sets. Anything absent is inherited from the less specific scopes.
Every control is a setting, or a map of settings keyed by what it controls, so each value is inherited, overridden and locked on its own: a group that turns one model on leaves every other model to the workspace.
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.
object
Cursor to use to get the next page
If there are more results to page through
Total number of results matching the query
Example
{ "policies": [ { "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": {} } } ]}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"}