Claude Platform Docs

获取当前组织

client.organization.retrieve(options?): OrganizationInfo
GET/v1/organizations/me

检索与经过身份验证的 API 密钥关联的组织的信息。

Returns
interface OrganizationInfo { type: "organization"; id; name }
type: "organization"

Object type.

For Organizations, this is always "organization".

defaultorganization
id: string

ID of the Organization.

formatuuid
name: string

Name of the Organization.

获取当前组织
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

const organizationInfo = await client.organization.retrieve();

console.log(organizationInfo.id);
Returns Examples
Response 200
{
  "id": "12345678-1234-5678-1234-567812345678",
  "name": "Organization Name",
  "type": "organization"
}