Claude Platform Docs

API Keys

List API Keys
ApiKeyListPage beta().organization().apiKeys().list(ApiKeyListParamsparams = ApiKeyListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/organizations/api_keys
Get API Key
BetaApiKey beta().organization().apiKeys().retrieve(ApiKeyRetrieveParamsparams = ApiKeyRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/organizations/api_keys/{api_key_id}
Update API Key
BetaApiKey beta().organization().apiKeys().update(ApiKeyUpdateParamsparams = ApiKeyUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/organizations/api_keys/{api_key_id}
Models
class BetaApiKey:
class BetaApiKeyCreatedBy:
String id

ID of the actor that created the object.

Type type

Type of the actor that created the object.

One of the following:
SERVICE_ACCOUNT("service_account")
USER("user")
class BetaApiKeyOrganizationScope:
JsonValue type "organization"constant

Scope type. Always "organization": the API key has no Workspace. Only a principal-bound API key can have this scope.

class BetaApiKeyServiceAccountActor:
String serviceAccountId

ID of the Service Account the API key acts as.

JsonValue type "service_account_actor"constant

Principal type. Always "service_account_actor" for a Service Account.

class BetaApiKeyUserActor:
JsonValue type "user_actor"constant

Principal type. Always "user_actor" for a User.

String userId

ID of the User the API key acts as.

class BetaApiKeyWorkspaceScope:
JsonValue type "workspace"constant

Scope type. Always "workspace": the API key belongs to one Workspace.

String workspaceId

ID of the Workspace the API key belongs to. Unlike the deprecated top-level workspace_id, this is the Workspace's real ID even for the organization's default Workspace.