Claude Platform Docs

获取合规设置

beta.organization.compliance_settings.retrieve() -> BetaComplianceSettings
GET/v1/organizations/compliance_settings

检索您组织的合规设置。

合规设置是一个单例资源:每个组织恰好有一个,无需标识符即可访问。state 字段反映 Compliance API 是否已启用。拥有父组织的组织读取的是从父组织配置继承的状态。

Returns
class BetaComplianceSettings: type: "compliance_settings"; state
type: Literal["compliance_settings"]
defaultcompliance_settings

Whether the Compliance API is enabled for this organization.

One of the following:
class BetaComplianceSettingsStateEnabled: type: "enabled"
type: Literal["enabled"]
defaultenabled
class BetaComplianceSettingsStateDisabled: type: "disabled"
type: Literal["disabled"]
defaultdisabled
获取合规设置
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
beta_compliance_settings = client.beta.organization.compliance_settings.retrieve()
print(beta_compliance_settings.state)
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}