# Update workspace AI policy

PATCH

/v1/workspaces/{workspace\_id}/ai-policy

```bash
curl --request PATCH \
  --url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model_defaults": {
    "flux-2-dev": {
      "inference_steps": {
        "value": 30
      }
    }
  },
  "models": {
    "flux-2-pro": {
      "value": false
    }
  }
}'
```

```python
import requests


url = "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy"


payload = {
    "model_defaults": { "flux-2-dev": { "inference_steps": { "value": 30 } } },
    "models": { "flux-2-pro": { "value": False } }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}


response = requests.patch(url, json=payload, headers=headers)


print(response.json())
```

```js
const url = 'https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model_defaults":{"flux-2-dev":{"inference_steps":{"value":30}}},"models":{"flux-2-pro":{"value":false}}}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main


import (
  "fmt"
  "strings"
  "net/http"
  "io"
)


func main() {


  url := "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy"


  payload := strings.NewReader("{\n  \"model_defaults\": {\n    \"flux-2-dev\": {\n      \"inference_steps\": {\n        \"value\": 30\n      }\n    }\n  },\n  \"models\": {\n    \"flux-2-pro\": {\n      \"value\": false\n    }\n  }\n}")


  req, _ := http.NewRequest("PATCH", url, payload)


  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")


  res, _ := http.DefaultClient.Do(req)


  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)


  fmt.Println(res)
  fmt.Println(string(body))


}
```

```php
<?php


$curl = curl_init();


curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'model_defaults' => [
        'flux-2-dev' => [
                'inference_steps' => [
                                'value' => 30
                ]
        ]
    ],
    'models' => [
        'flux-2-pro' => [
                'value' => null
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);


$response = curl_exec($curl);
$err = curl_error($curl);


curl_close($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```java
OkHttpClient client = new OkHttpClient();


MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"model_defaults\": {\n    \"flux-2-dev\": {\n      \"inference_steps\": {\n        \"value\": 30\n      }\n    }\n  },\n  \"models\": {\n    \"flux-2-pro\": {\n      \"value\": false\n    }\n  }\n}");
Request request = new Request.Builder()
  .url("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy")
  .patch(body)
  .addHeader("Authorization", "Bearer <token>")
  .addHeader("Content-Type", "application/json")
  .build();


Response response = client.newCall(request).execute();
```

```ruby
require 'uri'
require 'net/http'


url = URI("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy")


http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true


request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model_defaults\": {\n    \"flux-2-dev\": {\n      \"inference_steps\": {\n        \"value\": 30\n      }\n    }\n  },\n  \"models\": {\n    \"flux-2-pro\": {\n      \"value\": false\n    }\n  }\n}"


response = http.request(request)
puts response.read_body
```

```csharp
var client = new RestClient("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/ai-policy");
var request = new RestRequest("", Method.Patch);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model_defaults\": {\n    \"flux-2-dev\": {\n      \"inference_steps\": {\n        \"value\": 30\n      }\n    }\n  },\n  \"models\": {\n    \"flux-2-pro\": {\n      \"value\": false\n    }\n  }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
```

* Layer API

> **v1 is superseded.** v1 was superseded by [v2](/docs/v2/rest-api/operations/updateworkspaceaipolicyv2) 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](/docs/migration).

Change the controls the workspace sets itself as a JSON merge patch: a control or key you name is set, one you name as null is removed so it is inherited again, and anything you leave out stays as it is. A setting is replaced whole, value and lock. Requires workspace settings admin. Usage caps take workspace billing admin as well.

## Authorizations

* **[bearerAuth](/docs/v1/rest-api#bearerauth)**
* **[oauth2](/docs/v1/rest-api#oauth2)**
* **[serviceAccount](/docs/v1/rest-api#serviceaccount)**  
workspace:write

## Parameters 

### Path Parameters

**workspace\_id**

required

_Workspace ID_

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

### Header Parameters

**Idempotency-Key**

string

<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with `Idempotent-Replayed: true`. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422\. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409\. See the Idempotency section of the API description.

## Request Bodyrequired

_AIPolicyPatch_

A change to the AI controls one scope sets, as a JSON merge patch (RFC 7396) of its policy.

A control or key the patch names is set; one it names as null is removed, so the scope inherits it again; anything it leaves out stays as it is. A setting is one value: naming it replaces both its value and its lock. Guardrails and output scoring belong to the services that own them, and naming one is refused. Usage caps take workspace billing admin as well.

object

**agent\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**agents**

_Agents_object

**_key_**

additional properties

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**agent\_confirm\_above\_cu**

Any of:

**Setting\[Annotated\[float, Ge\]\]**

_Setting\[Annotated\[float, Ge\]\]_object

**value**

required

_Value_

number

**locked**

_Locked_

boolean

**null**

null

**modalities**

_Modalities_object

**_key_**

additional properties

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**new\_models\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**models**

_Models_object

**_key_**

additional properties

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**model\_defaults**

_Model Defaults_object

**_key_**

additional properties

object

**_key_**

additional properties

Any of:

**Setting\[JSONValue\]**

_Setting\[JSONValue\]_object

**value**

required

**locked**

_Locked_

boolean

**null**

null

**nsfw\_tolerance**

Any of:

**Setting\[Annotated\[int, FieldInfo(annotation=NoneType, required=True, metadata=\[Ge(ge=1), Le(le=6)\])\]\]**

_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

**null**

null

**reference\_set\_sharing\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**workflow\_sharing\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**invisible\_watermark\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**usage\_caps**

_Usage Caps_object

**_key_**

additional properties

Any of:

**Setting\[Union\[UsageCap, NoneType\]\]**

_Setting\[Union\[UsageCap, NoneType\]\]_object

**value**

required

Any of:

**null**

_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

**UsageCap**

null

**locked**

_Locked_

boolean

**null**

null

##### Example

```json
{
  "model_defaults": {
    "flux-2-dev": {
      "inference_steps": {
        "value": 30
      }
    }
  },
  "models": {
    "flux-2-pro": {
      "value": false
    }
  }
}
```

## Responses 

### 200

Successful Response

_AIPolicyOutput_object

**scope**

required

_AIPolicyScope_

What the policy is attached to.

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_

What the scope sets itself, each value as {value, locked}. Anything absent is inherited.

object

**agent\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**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\]\]**

_Setting\[Annotated\[float, Ge\]\]_object

**value**

required

_Value_

number

**locked**

_Locked_

boolean

**null**

null

**modalities**

_Modalities_object

**_key_**

additional properties

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**new\_models\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**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)\])\]\]**

_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

**null**

null

**reference\_set\_sharing\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**workflow\_sharing\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**invisible\_watermark\_enabled**

Any of:

**Setting\[bool\]**

_Setting\[bool\]_object

**value**

required

_Value_

boolean

**locked**

_Locked_

boolean

**null**

null

**usage\_caps**

_Usage Caps_object

**_key_**

additional properties

_Setting\[Union\[UsageCap, NoneType\]\]_object

**value**

required

Any of:

**UsageCap**

_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

**null**

null

**locked**

_Locked_

boolean

**inherited**

required

_EffectiveAIPolicy_

What the scope inherits from the less specific scopes, each value as {value, source}. A value with no source is the platform default.

object

**agent\_enabled**

required

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**agents**

required

_Agents_object

**_key_**

additional properties

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**agent\_confirm\_above\_cu**

required

_Resolved\[float\]_object

**value**

required

_Value_

number

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**modalities**

required

_Modalities_object

**_key_**

additional properties

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**new\_models\_enabled**

required

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**models**

required

_Models_object

**_key_**

additional properties

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**model\_defaults**

required

_Model Defaults_object

**_key_**

additional properties

object

**_key_**

additional properties

_Resolved\[JSONValue\]_object

**value**

required

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**guardrails**

required

_Guardrails_object

**_key_**

additional properties

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**output\_scoring**

required

_Output Scoring_object

**_key_**

additional properties

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**nsfw\_tolerance**

_Resolved\[int\]_object

**value**

required

_Value_

integer

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**reference\_set\_sharing\_enabled**

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**workflow\_sharing\_enabled**

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**invisible\_watermark\_enabled**

_Resolved\[bool\]_object

**value**

required

_Value_

boolean

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**usage\_caps**

_Usage Caps_object

**_key_**

additional properties

_Resolved\[Union\[UsageCap, NoneType\]\]_object

**value**

required

Any of:

**UsageCap**

_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

**null**

null

**source**

Any of:

**AIPolicySource**

_AIPolicySource_

The policy a resolved value comes from.

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

**locked**

required

_Locked_

boolean

**null**

null

**updated\_at**

required

_Updated At_

When the policy was last written; null if it sets nothing.

string format: date-time

nullable

**updated\_by\_id**

required

_Updated By ID_

Who last wrote the policy, when known.

string format: uuid

nullable

##### Example

```json
{
  "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": {}
  }
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

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

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

### 403

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

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

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

### 404

Resource not found.

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

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

### 409

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

**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

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

### 422

Invalid input parameters, or an `Idempotency-Key` reused for a different request.

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

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

### 429

Rate limited — retry after the number of seconds in `Retry-After`.

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

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

### 500

Internal server error.

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

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