Skip to content

List AI policies

Viewing v1, superseded by v2

GET
/v1/workspaces/{workspace_id}/ai-policies
curl --request GET \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policies \
--header 'Authorization: Bearer <token>'

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.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

kind
Any of:
AIPolicyScopeKind

What an AI policy is attached to, from least to most specific.

string
Allowed values: workspace project group member

Only policies attached to this kind of scope.

limit
Limit

Maximum number of results to return.

integer
default: 20 >= 1 <= 100

Maximum number of results to return.

cursor
Cursor

Cursor from a previous response to fetch the next page.

string
nullable

Cursor from a previous response to fetch the next page.

Successful Response

Media typeapplication/json
ListAIPoliciesOutput
object
policies
required
Policies
Array<object>
AIPolicyRecord

A stored policy: the scope it is attached to, what it sets, and its last write.

object
scope
required
AIPolicyScope

Where a policy is attached: a workspace, or a project, group or member inside one.

object
kind
required
AIPolicyScopeKind

What an AI policy is attached to, from least to most specific.

string
Allowed values: workspace project group member
workspace_id
required
Workspace ID
string format: uuid
project_id
Project ID
string format: uuid
nullable
group_id
Group ID
string format: uuid
nullable
principal_id
Principal ID
string format: uuid
nullable
policy
required
AIPolicy

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
agent_enabled
Any of:
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
agents
Agents
object
key
additional properties
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
agent_confirm_above_cu
Any of:
Setting[Annotated[float, Ge]]
object
value
required
Value
number
locked
Locked
boolean
modalities
Modalities
object
key
additional properties
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
new_models_enabled
Any of:
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
models
Models
object
key
additional properties
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
model_defaults
Model Defaults
object
key
additional properties
object
key
additional properties
Setting[JSONValue]
object
value
required
locked
Locked
boolean
guardrails
Guardrails
object
key
additional properties
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
output_scoring
Output Scoring
object
key
additional properties
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
nsfw_tolerance
Any of:
Setting[Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=6)])]]
object
value
required
Value
integer
>= 1 <= 6
locked
Locked
boolean
reference_set_sharing_enabled
Any of:
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
workflow_sharing_enabled
Any of:
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
invisible_watermark_enabled
Any of:
Setting[bool]
object
value
required
Value
boolean
locked
Locked
boolean
usage_caps
Usage Caps
object
key
additional properties
Setting[Union[UsageCap, NoneType]]
object
value
required
Any of:
UsageCap

A cap on the Creative Units each member may spend in a workspace over one period, as a policy sets it.

object
cu_limit
required
CU Limit
number
mode
required
UsageLimitMode

What a cap does once its member has used all of it.

string
Allowed values: warn block
warn_threshold_pct
required
Warn Threshold Percent
integer
locked
Locked
boolean
updated_at
required
Updated At
string format: date-time
updated_by_id
required
Updated By ID
string format: uuid
nullable
pagination
required
PaginationOutput
object
next_cursor
Next Cursor

Cursor to use to get the next page

string
nullable
has_more_results
required
Has More Results

If there are more results to page through

boolean
total_count
Total Count

Total number of results matching the query

integer
nullable
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}