Claude Platform Docs

获取合规设置

client.Organization.ComplianceSettings.Get(ctx) (*OrganizationComplianceSettings, error)
GET/v1/organizations/compliance_settings

检索您组织的合规设置。

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

Returns
type OrganizationComplianceSettings struct { Type: "compliance_settings"; State }
Type ComplianceSettings
defaultcompliance_settings

Whether the Compliance API is enabled for this organization.

One of the following:
type ComplianceSettingsStateEnabled struct { Type: "enabled" }
Type Enabled
defaultenabled
type ComplianceSettingsStateDisabled struct { Type: "disabled" }
Type Disabled
defaultdisabled
获取合规设置
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	organizationComplianceSettings, err := client.Organization.ComplianceSettings.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", organizationComplianceSettings.State)
}
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}