Skip to content
Primary navigation

Projects

List projects
client.Admin.Organization.Projects.List(ctx, query) (*ConversationCursorPage[Project], error)
GET/organization/projects
Create project
client.Admin.Organization.Projects.New(ctx, body) (*Project, error)
POST/organization/projects
Retrieve project
client.Admin.Organization.Projects.Get(ctx, projectID) (*Project, error)
GET/organization/projects/{project_id}
Modify project
client.Admin.Organization.Projects.Update(ctx, projectID, body) (*Project, error)
POST/organization/projects/{project_id}
Archive project
client.Admin.Organization.Projects.Archive(ctx, projectID) (*Project, error)
POST/organization/projects/{project_id}/archive
ModelsExpand Collapse
type Project struct{…}

Represents an individual project.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the project was created.

formatunixtime
Object OrganizationProject

The object type, which is always organization.project

ArchivedAt int64Optional

The Unix timestamp (in seconds) of when the project was archived or null.

formatunixtime
ExternalKeyID stringOptional

The external key associated with the project.

Name stringOptional

The name of the project. This appears in reporting.

Status stringOptional

active or archived

ProjectsUsers

List project users
client.Admin.Organization.Projects.Users.List(ctx, projectID, query) (*ConversationCursorPage[ProjectUser], error)
GET/organization/projects/{project_id}/users
Create project user
client.Admin.Organization.Projects.Users.New(ctx, projectID, body) (*ProjectUser, error)
POST/organization/projects/{project_id}/users
Retrieve project user
client.Admin.Organization.Projects.Users.Get(ctx, projectID, userID) (*ProjectUser, error)
GET/organization/projects/{project_id}/users/{user_id}
Modify project user
client.Admin.Organization.Projects.Users.Update(ctx, projectID, userID, body) (*ProjectUser, error)
POST/organization/projects/{project_id}/users/{user_id}
Delete project user
client.Admin.Organization.Projects.Users.Delete(ctx, projectID, userID) (*AdminOrganizationProjectUserDeleteResponse, error)
DELETE/organization/projects/{project_id}/users/{user_id}
ModelsExpand Collapse
type ProjectUser struct{…}

Represents an individual user in a project.

ID string

The identifier, which can be referenced in API endpoints

AddedAt int64

The Unix timestamp (in seconds) of when the project was added.

formatunixtime
Object OrganizationProjectUser

The object type, which is always organization.project.user

Role string

owner or member

Email stringOptional

The email address of the user

Name stringOptional

The name of the user

ProjectsUsersRoles

List project user role assignments
client.Admin.Organization.Projects.Users.Roles.List(ctx, projectID, userID, query) (*NextCursorPage[AdminOrganizationProjectUserRoleListResponse], error)
GET/projects/{project_id}/users/{user_id}/roles
Assign project role to user
client.Admin.Organization.Projects.Users.Roles.New(ctx, projectID, userID, body) (*AdminOrganizationProjectUserRoleNewResponse, error)
POST/projects/{project_id}/users/{user_id}/roles
Retrieve project user role
client.Admin.Organization.Projects.Users.Roles.Get(ctx, projectID, userID, roleID) (*AdminOrganizationProjectUserRoleGetResponse, error)
GET/projects/{project_id}/users/{user_id}/roles/{role_id}
Unassign project role from user
client.Admin.Organization.Projects.Users.Roles.Delete(ctx, projectID, userID, roleID) (*AdminOrganizationProjectUserRoleDeleteResponse, error)
DELETE/projects/{project_id}/users/{user_id}/roles/{role_id}

ProjectsService Accounts

List project service accounts
client.Admin.Organization.Projects.ServiceAccounts.List(ctx, projectID, query) (*ConversationCursorPage[ProjectServiceAccount], error)
GET/organization/projects/{project_id}/service_accounts
Create project service account
client.Admin.Organization.Projects.ServiceAccounts.New(ctx, projectID, body) (*AdminOrganizationProjectServiceAccountNewResponse, error)
POST/organization/projects/{project_id}/service_accounts
Retrieve project service account
client.Admin.Organization.Projects.ServiceAccounts.Get(ctx, projectID, serviceAccountID) (*ProjectServiceAccount, error)
GET/organization/projects/{project_id}/service_accounts/{service_account_id}
Update project service account
client.Admin.Organization.Projects.ServiceAccounts.Update(ctx, projectID, serviceAccountID, body) (*ProjectServiceAccount, error)
POST/organization/projects/{project_id}/service_accounts/{service_account_id}
Delete project service account
client.Admin.Organization.Projects.ServiceAccounts.Delete(ctx, projectID, serviceAccountID) (*AdminOrganizationProjectServiceAccountDeleteResponse, error)
DELETE/organization/projects/{project_id}/service_accounts/{service_account_id}
ModelsExpand Collapse
type ProjectServiceAccount struct{…}

Represents an individual service account in a project.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the service account was created

formatunixtime
Name string

The name of the service account

Object OrganizationProjectServiceAccount

The object type, which is always organization.project.service_account

Role ProjectServiceAccountRole

owner or member

One of the following:
const ProjectServiceAccountRoleOwner ProjectServiceAccountRole = "owner"
const ProjectServiceAccountRoleMember ProjectServiceAccountRole = "member"

ProjectsAPI Keys

List project API keys
client.Admin.Organization.Projects.APIKeys.List(ctx, projectID, query) (*ConversationCursorPage[ProjectAPIKey], error)
GET/organization/projects/{project_id}/api_keys
Retrieve project API key
client.Admin.Organization.Projects.APIKeys.Get(ctx, projectID, apiKeyID) (*ProjectAPIKey, error)
GET/organization/projects/{project_id}/api_keys/{api_key_id}
Delete project API key
client.Admin.Organization.Projects.APIKeys.Delete(ctx, projectID, apiKeyID) (*AdminOrganizationProjectAPIKeyDeleteResponse, error)
DELETE/organization/projects/{project_id}/api_keys/{api_key_id}
ModelsExpand Collapse
type ProjectAPIKey struct{…}

Represents an individual API key in a project.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the API key was created

formatunixtime
LastUsedAt int64

The Unix timestamp (in seconds) of when the API key was last used.

formatunixtime
Name string

The name of the API key

Object OrganizationProjectAPIKey

The object type, which is always organization.project.api_key

Owner ProjectAPIKeyOwner
ServiceAccount ProjectAPIKeyOwnerServiceAccountOptional

The service account that owns a project API key.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the service account was created.

formatunixtime
Name string

The name of the service account.

Role string

The service account’s project role.

Type stringOptional

user or service_account

One of the following:
const ProjectAPIKeyOwnerTypeUser ProjectAPIKeyOwnerType = "user"
const ProjectAPIKeyOwnerTypeServiceAccount ProjectAPIKeyOwnerType = "service_account"
User ProjectAPIKeyOwnerUserOptional

The user that owns a project API key.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the user was created.

formatunixtime
Email string

The email address of the user.

Name string

The name of the user.

Role string

The user’s project role.

RedactedValue string

The redacted value of the API key

ProjectsRate Limits

List project rate limits
client.Admin.Organization.Projects.RateLimits.ListRateLimits(ctx, projectID, query) (*ConversationCursorPage[ProjectRateLimit], error)
GET/organization/projects/{project_id}/rate_limits
Modify project rate limit
client.Admin.Organization.Projects.RateLimits.UpdateRateLimit(ctx, projectID, rateLimitID, body) (*ProjectRateLimit, error)
POST/organization/projects/{project_id}/rate_limits/{rate_limit_id}
ModelsExpand Collapse
type ProjectRateLimit struct{…}

Represents a project rate limit config.

ID string

The identifier, which can be referenced in API endpoints.

MaxRequestsPer1Minute int64

The maximum requests per minute.

MaxTokensPer1Minute int64

The maximum tokens per minute.

Model string

The model this rate limit applies to.

Object ProjectRateLimit

The object type, which is always project.rate_limit

Batch1DayMaxInputTokens int64Optional

The maximum batch input tokens per day. Only present for relevant models.

MaxAudioMegabytesPer1Minute int64Optional

The maximum audio megabytes per minute. Only present for relevant models.

MaxImagesPer1Minute int64Optional

The maximum images per minute. Only present for relevant models.

MaxRequestsPer1Day int64Optional

The maximum requests per day. Only present for relevant models.

ProjectsModel Permissions

Retrieve project model permissions
client.Admin.Organization.Projects.ModelPermissions.Get(ctx, projectID) (*ProjectModelPermissions, error)
GET/organization/projects/{project_id}/model_permissions
Modify project model permissions
client.Admin.Organization.Projects.ModelPermissions.Update(ctx, projectID, body) (*ProjectModelPermissions, error)
POST/organization/projects/{project_id}/model_permissions
Delete project model permissions
client.Admin.Organization.Projects.ModelPermissions.Delete(ctx, projectID) (*ProjectModelPermissionsDeleted, error)
DELETE/organization/projects/{project_id}/model_permissions
ModelsExpand Collapse
type ProjectModelPermissions struct{…}

Represents the model allowlist or denylist policy for a project.

Mode ProjectModelPermissionsMode

Whether the project uses an allowlist or a denylist.

One of the following:
const ProjectModelPermissionsModeAllowList ProjectModelPermissionsMode = "allow_list"
const ProjectModelPermissionsModeDenyList ProjectModelPermissionsMode = "deny_list"
ModelIDs []string

The model IDs included in the model permissions policy.

Object ProjectModelPermissions

The object type, which is always project.model_permissions.

type ProjectModelPermissionsDeleted struct{…}

Confirmation payload returned after deleting project model permissions.

Deleted bool

Whether the project model permissions were deleted.

Object ProjectModelPermissionsDeleted

The object type, which is always project.model_permissions.deleted.

ProjectsHosted Tool Permissions

Retrieve project hosted tool permissions
client.Admin.Organization.Projects.HostedToolPermissions.Get(ctx, projectID) (*ProjectHostedToolPermissions, error)
GET/organization/projects/{project_id}/hosted_tool_permissions
Modify project hosted tool permissions
client.Admin.Organization.Projects.HostedToolPermissions.Update(ctx, projectID, body) (*ProjectHostedToolPermissions, error)
POST/organization/projects/{project_id}/hosted_tool_permissions
ModelsExpand Collapse
type ProjectHostedToolPermissions struct{…}

Represents hosted tool permissions for a project.

CodeInterpreter ProjectHostedToolPermissionsCodeInterpreter

Permission state for a single hosted tool on a project.

Enabled bool

Whether the hosted tool is enabled for the project.

ImageGeneration ProjectHostedToolPermissionsImageGeneration

Permission state for a single hosted tool on a project.

Enabled bool

Whether the hosted tool is enabled for the project.

Mcp ProjectHostedToolPermissionsMcp

Permission state for a single hosted tool on a project.

Enabled bool

Whether the hosted tool is enabled for the project.

ProjectsGroups

List project groups
client.Admin.Organization.Projects.Groups.List(ctx, projectID, query) (*NextCursorPage[ProjectGroup], error)
GET/organization/projects/{project_id}/groups
Add project group
client.Admin.Organization.Projects.Groups.New(ctx, projectID, body) (*ProjectGroup, error)
POST/organization/projects/{project_id}/groups
Retrieve project group
client.Admin.Organization.Projects.Groups.Get(ctx, projectID, groupID, query) (*ProjectGroup, error)
GET/organization/projects/{project_id}/groups/{group_id}
Remove project group
client.Admin.Organization.Projects.Groups.Delete(ctx, projectID, groupID) (*AdminOrganizationProjectGroupDeleteResponse, error)
DELETE/organization/projects/{project_id}/groups/{group_id}
ModelsExpand Collapse
type ProjectGroup struct{…}

Details about a group’s membership in a project.

CreatedAt int64

Unix timestamp (in seconds) when the group was granted project access.

formatunixtime
GroupID string

Identifier of the group that has access to the project.

GroupName string

Display name of the group.

GroupType ProjectGroupGroupType

The type of the group.

One of the following:
const ProjectGroupGroupTypeGroup ProjectGroupGroupType = "group"
const ProjectGroupGroupTypeTenantGroup ProjectGroupGroupType = "tenant_group"
Object ProjectGroup

Always project.group.

ProjectID string

Identifier of the project.

ProjectsGroupsRoles

List project group role assignments
client.Admin.Organization.Projects.Groups.Roles.List(ctx, projectID, groupID, query) (*NextCursorPage[AdminOrganizationProjectGroupRoleListResponse], error)
GET/projects/{project_id}/groups/{group_id}/roles
Assign project role to group
client.Admin.Organization.Projects.Groups.Roles.New(ctx, projectID, groupID, body) (*AdminOrganizationProjectGroupRoleNewResponse, error)
POST/projects/{project_id}/groups/{group_id}/roles
Retrieve project group role
client.Admin.Organization.Projects.Groups.Roles.Get(ctx, projectID, groupID, roleID) (*AdminOrganizationProjectGroupRoleGetResponse, error)
GET/projects/{project_id}/groups/{group_id}/roles/{role_id}
Unassign project role from group
client.Admin.Organization.Projects.Groups.Roles.Delete(ctx, projectID, groupID, roleID) (*AdminOrganizationProjectGroupRoleDeleteResponse, error)
DELETE/projects/{project_id}/groups/{group_id}/roles/{role_id}

ProjectsRoles

List project roles
client.Admin.Organization.Projects.Roles.List(ctx, projectID, query) (*NextCursorPage[Role], error)
GET/projects/{project_id}/roles
Create project role
client.Admin.Organization.Projects.Roles.New(ctx, projectID, body) (*Role, error)
POST/projects/{project_id}/roles
Retrieve project role
client.Admin.Organization.Projects.Roles.Get(ctx, projectID, roleID) (*Role, error)
GET/projects/{project_id}/roles/{role_id}
Update project role
client.Admin.Organization.Projects.Roles.Update(ctx, projectID, roleID, body) (*Role, error)
POST/projects/{project_id}/roles/{role_id}
Delete project role
client.Admin.Organization.Projects.Roles.Delete(ctx, projectID, roleID) (*AdminOrganizationProjectRoleDeleteResponse, error)
DELETE/projects/{project_id}/roles/{role_id}

ProjectsData Retention

Retrieve project data retention
client.Admin.Organization.Projects.DataRetention.Get(ctx, projectID) (*ProjectDataRetention, error)
GET/organization/projects/{project_id}/data_retention
Update project data retention
client.Admin.Organization.Projects.DataRetention.Update(ctx, projectID, body) (*ProjectDataRetention, error)
POST/organization/projects/{project_id}/data_retention
ModelsExpand Collapse
type ProjectDataRetention struct{…}

Represents a project’s data retention control setting.

Object ProjectDataRetention

The object type, which is always project.data_retention.

Type ProjectDataRetentionType

The configured project data retention type.

One of the following:
const ProjectDataRetentionTypeOrganizationDefault ProjectDataRetentionType = "organization_default"
const ProjectDataRetentionTypeNone ProjectDataRetentionType = "none"
const ProjectDataRetentionTypeZeroDataRetention ProjectDataRetentionType = "zero_data_retention"
const ProjectDataRetentionTypeModifiedAbuseMonitoring ProjectDataRetentionType = "modified_abuse_monitoring"
const ProjectDataRetentionTypeEnhancedZeroDataRetention ProjectDataRetentionType = "enhanced_zero_data_retention"
const ProjectDataRetentionTypeEnhancedModifiedAbuseMonitoring ProjectDataRetentionType = "enhanced_modified_abuse_monitoring"

ProjectsSpend Alerts

List project spend alerts
client.Admin.Organization.Projects.SpendAlerts.List(ctx, projectID, query) (*ConversationCursorPage[ProjectSpendAlert], error)
GET/organization/projects/{project_id}/spend_alerts
Create project spend alert
client.Admin.Organization.Projects.SpendAlerts.New(ctx, projectID, body) (*ProjectSpendAlert, error)
POST/organization/projects/{project_id}/spend_alerts
Retrieve project spend alert
client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)
GET/organization/projects/{project_id}/spend_alerts/{alert_id}
Update project spend alert
client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)
POST/organization/projects/{project_id}/spend_alerts/{alert_id}
Delete project spend alert
client.Admin.Organization.Projects.SpendAlerts.Delete(ctx, projectID, alertID) (*ProjectSpendAlertDeleted, error)
DELETE/organization/projects/{project_id}/spend_alerts/{alert_id}
ModelsExpand Collapse
type ProjectSpendAlert struct{…}

Represents a spend alert configured at the project level.

ID string

The identifier, which can be referenced in API endpoints.

Currency ProjectSpendAlertCurrency

The currency for the threshold amount.

Interval ProjectSpendAlertInterval

The time interval for evaluating spend against the threshold.

NotificationChannel ProjectSpendAlertNotificationChannel

Email notification settings for a spend alert.

Recipients []string

Email addresses that receive the spend alert notification.

Type Email

The notification channel type. Currently only email is supported.

SubjectPrefix stringOptional

Optional subject prefix for alert emails.

Object ProjectSpendAlert

The object type, which is always project.spend_alert.

ThresholdAmount int64

The alert threshold amount, in cents.

type ProjectSpendAlertDeleted struct{…}

Confirmation payload returned after deleting a project spend alert.

ID string

The deleted spend alert ID.

Deleted bool

Whether the spend alert was deleted.

Object ProjectSpendAlertDeleted

Always project.spend_alert.deleted.

ProjectsCertificates

List project certificates
client.Admin.Organization.Projects.Certificates.List(ctx, projectID, query) (*ConversationCursorPage[AdminOrganizationProjectCertificateListResponse], error)
GET/organization/projects/{project_id}/certificates
Activate certificates for project
client.Admin.Organization.Projects.Certificates.Activate(ctx, projectID, body) (*Page[AdminOrganizationProjectCertificateActivateResponse], error)
POST/organization/projects/{project_id}/certificates/activate
Deactivate certificates for project
client.Admin.Organization.Projects.Certificates.Deactivate(ctx, projectID, body) (*Page[AdminOrganizationProjectCertificateDeactivateResponse], error)
POST/organization/projects/{project_id}/certificates/deactivate