Skip to content
Primary navigation

Projects

List projects
admin.organization.projects.list(ProjectListParams**kwargs) -> SyncConversationCursorPage[Project]
GET/organization/projects
Create project
admin.organization.projects.create(ProjectCreateParams**kwargs) -> Project
POST/organization/projects
Retrieve project
admin.organization.projects.retrieve(strproject_id) -> Project
GET/organization/projects/{project_id}
Modify project
admin.organization.projects.update(strproject_id, ProjectUpdateParams**kwargs) -> Project
POST/organization/projects/{project_id}
Archive project
admin.organization.projects.archive(strproject_id) -> Project
POST/organization/projects/{project_id}/archive
ModelsExpand Collapse
class Project:

Represents an individual project.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

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

formatunixtime
object: Literal["organization.project"]

The object type, which is always organization.project

archived_at: Optional[int]

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

formatunixtime
external_key_id: Optional[str]

The external key associated with the project.

name: Optional[str]

The name of the project. This appears in reporting.

status: Optional[str]

active or archived

ProjectsUsers

List project users
admin.organization.projects.users.list(strproject_id, UserListParams**kwargs) -> SyncConversationCursorPage[ProjectUser]
GET/organization/projects/{project_id}/users
Create project user
admin.organization.projects.users.create(strproject_id, UserCreateParams**kwargs) -> ProjectUser
POST/organization/projects/{project_id}/users
Retrieve project user
admin.organization.projects.users.retrieve(struser_id, UserRetrieveParams**kwargs) -> ProjectUser
GET/organization/projects/{project_id}/users/{user_id}
Modify project user
admin.organization.projects.users.update(struser_id, UserUpdateParams**kwargs) -> ProjectUser
POST/organization/projects/{project_id}/users/{user_id}
Delete project user
admin.organization.projects.users.delete(struser_id, UserDeleteParams**kwargs) -> UserDeleteResponse
DELETE/organization/projects/{project_id}/users/{user_id}
ModelsExpand Collapse
class ProjectUser:

Represents an individual user in a project.

id: str

The identifier, which can be referenced in API endpoints

added_at: int

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

formatunixtime
object: Literal["organization.project.user"]

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

role: str

owner or member

email: Optional[str]

The email address of the user

name: Optional[str]

The name of the user

class UserDeleteResponse:
id: str
deleted: bool
object: Literal["organization.project.user.deleted"]

ProjectsUsersRoles

List project user role assignments
admin.organization.projects.users.roles.list(struser_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/projects/{project_id}/users/{user_id}/roles
Assign project role to user
admin.organization.projects.users.roles.create(struser_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/projects/{project_id}/users/{user_id}/roles
Unassign project role from user
admin.organization.projects.users.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/projects/{project_id}/users/{user_id}/roles/{role_id}
ModelsExpand Collapse
class RoleListResponse:

Detailed information about a role assignment entry returned when listing assignments.

id: str

Identifier for the role.

created_at: Optional[int]

When the role was created.

formatunixtime
created_by: Optional[str]

Identifier of the actor who created the role.

created_by_user_obj: Optional[Dict[str, object]]

User details for the actor that created the role, when available.

description: Optional[str]

Description of the role.

metadata: Optional[Dict[str, object]]

Arbitrary metadata stored on the role.

name: str

Name of the role.

permissions: List[str]

Permissions associated with the role.

predefined_role: bool

Whether the role is predefined by OpenAI.

resource_type: str

Resource type the role applies to.

updated_at: Optional[int]

When the role was last updated.

formatint64
class RoleCreateResponse:

Role assignment linking a user to a role.

object: Literal["user.role"]

Always user.role.

role: Role

Details about a role that can be assigned through the public Roles API.

Represents an individual user within an organization.

class RoleDeleteResponse:

Confirmation payload returned after unassigning a role.

deleted: bool

Whether the assignment was removed.

object: str

Identifier for the deleted assignment, such as group.role.deleted or user.role.deleted.

ProjectsService Accounts

List project service accounts
admin.organization.projects.service_accounts.list(strproject_id, ServiceAccountListParams**kwargs) -> SyncConversationCursorPage[ProjectServiceAccount]
GET/organization/projects/{project_id}/service_accounts
Create project service account
admin.organization.projects.service_accounts.create(strproject_id, ServiceAccountCreateParams**kwargs) -> ServiceAccountCreateResponse
POST/organization/projects/{project_id}/service_accounts
Retrieve project service account
admin.organization.projects.service_accounts.retrieve(strservice_account_id, ServiceAccountRetrieveParams**kwargs) -> ProjectServiceAccount
GET/organization/projects/{project_id}/service_accounts/{service_account_id}
Delete project service account
admin.organization.projects.service_accounts.delete(strservice_account_id, ServiceAccountDeleteParams**kwargs) -> ServiceAccountDeleteResponse
DELETE/organization/projects/{project_id}/service_accounts/{service_account_id}
ModelsExpand Collapse
class ProjectServiceAccount:

Represents an individual service account in a project.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

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

formatunixtime
name: str

The name of the service account

object: Literal["organization.project.service_account"]

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

role: Literal["owner", "member"]

owner or member

One of the following:
"owner"
"member"
class ServiceAccountCreateResponse:
id: str
api_key: Optional[APIKey]
id: str
created_at: int
formatunixtime
name: str
object: Literal["organization.project.service_account.api_key"]

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

value: str
created_at: int
formatunixtime
name: str
object: Literal["organization.project.service_account"]
role: Literal["member"]

Service accounts can only have one role of type member

class ServiceAccountDeleteResponse:
id: str
deleted: bool
object: Literal["organization.project.service_account.deleted"]

ProjectsAPI Keys

List project API keys
admin.organization.projects.api_keys.list(strproject_id, APIKeyListParams**kwargs) -> SyncConversationCursorPage[ProjectAPIKey]
GET/organization/projects/{project_id}/api_keys
Retrieve project API key
admin.organization.projects.api_keys.retrieve(strapi_key_id, APIKeyRetrieveParams**kwargs) -> ProjectAPIKey
GET/organization/projects/{project_id}/api_keys/{api_key_id}
Delete project API key
admin.organization.projects.api_keys.delete(strapi_key_id, APIKeyDeleteParams**kwargs) -> APIKeyDeleteResponse
DELETE/organization/projects/{project_id}/api_keys/{api_key_id}
ModelsExpand Collapse
class ProjectAPIKey:

Represents an individual API key in a project.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

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

formatunixtime
last_used_at: Optional[int]

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

formatunixtime
name: str

The name of the API key

object: Literal["organization.project.api_key"]

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

owner: Owner
service_account: Optional[OwnerServiceAccount]

The service account that owns a project API key.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

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

formatunixtime
name: str

The name of the service account.

role: str

The service account’s project role.

type: Optional[Literal["user", "service_account"]]

user or service_account

One of the following:
"user"
"service_account"
user: Optional[OwnerUser]

The user that owns a project API key.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

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

formatunixtime
email: str

The email address of the user.

name: str

The name of the user.

role: str

The user’s project role.

redacted_value: str

The redacted value of the API key

class APIKeyDeleteResponse:
id: str
deleted: bool
object: Literal["organization.project.api_key.deleted"]

ProjectsRate Limits

List project rate limits
admin.organization.projects.rate_limits.list_rate_limits(strproject_id, RateLimitListRateLimitsParams**kwargs) -> SyncConversationCursorPage[ProjectRateLimit]
GET/organization/projects/{project_id}/rate_limits
Modify project rate limit
admin.organization.projects.rate_limits.update_rate_limit(strrate_limit_id, RateLimitUpdateRateLimitParams**kwargs) -> ProjectRateLimit
POST/organization/projects/{project_id}/rate_limits/{rate_limit_id}
ModelsExpand Collapse
class ProjectRateLimit:

Represents a project rate limit config.

id: str

The identifier, which can be referenced in API endpoints.

max_requests_per_1_minute: int

The maximum requests per minute.

max_tokens_per_1_minute: int

The maximum tokens per minute.

model: str

The model this rate limit applies to.

object: Literal["project.rate_limit"]

The object type, which is always project.rate_limit

batch_1_day_max_input_tokens: Optional[int]

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

max_audio_megabytes_per_1_minute: Optional[int]

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

max_images_per_1_minute: Optional[int]

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

max_requests_per_1_day: Optional[int]

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

ProjectsGroups

List project groups
admin.organization.projects.groups.list(strproject_id, GroupListParams**kwargs) -> SyncNextCursorPage[ProjectGroup]
GET/organization/projects/{project_id}/groups
Add project group
admin.organization.projects.groups.create(strproject_id, GroupCreateParams**kwargs) -> ProjectGroup
POST/organization/projects/{project_id}/groups
Remove project group
admin.organization.projects.groups.delete(strgroup_id, GroupDeleteParams**kwargs) -> GroupDeleteResponse
DELETE/organization/projects/{project_id}/groups/{group_id}
ModelsExpand Collapse
class ProjectGroup:

Details about a group’s membership in a project.

created_at: int

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

formatunixtime
group_id: str

Identifier of the group that has access to the project.

group_name: str

Display name of the group.

group_type: str

The type of the group.

object: Literal["project.group"]

Always project.group.

project_id: str

Identifier of the project.

class GroupDeleteResponse:

Confirmation payload returned after removing a group from a project.

deleted: bool

Whether the group membership in the project was removed.

object: Literal["project.group.deleted"]

Always project.group.deleted.

ProjectsGroupsRoles

List project group role assignments
admin.organization.projects.groups.roles.list(strgroup_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/projects/{project_id}/groups/{group_id}/roles
Assign project role to group
admin.organization.projects.groups.roles.create(strgroup_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/projects/{project_id}/groups/{group_id}/roles
Unassign project role from group
admin.organization.projects.groups.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/projects/{project_id}/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
class RoleListResponse:

Detailed information about a role assignment entry returned when listing assignments.

id: str

Identifier for the role.

created_at: Optional[int]

When the role was created.

formatunixtime
created_by: Optional[str]

Identifier of the actor who created the role.

created_by_user_obj: Optional[Dict[str, object]]

User details for the actor that created the role, when available.

description: Optional[str]

Description of the role.

metadata: Optional[Dict[str, object]]

Arbitrary metadata stored on the role.

name: str

Name of the role.

permissions: List[str]

Permissions associated with the role.

predefined_role: bool

Whether the role is predefined by OpenAI.

resource_type: str

Resource type the role applies to.

updated_at: Optional[int]

When the role was last updated.

formatint64
class RoleCreateResponse:

Role assignment linking a group to a role.

group: Group

Summary information about a group returned in role assignment responses.

id: str

Identifier for the group.

created_at: int

Unix timestamp (in seconds) when the group was created.

formatunixtime
name: str

Display name of the group.

object: Literal["group"]

Always group.

scim_managed: bool

Whether the group is managed through SCIM.

object: Literal["group.role"]

Always group.role.

role: Role

Details about a role that can be assigned through the public Roles API.

class RoleDeleteResponse:

Confirmation payload returned after unassigning a role.

deleted: bool

Whether the assignment was removed.

object: str

Identifier for the deleted assignment, such as group.role.deleted or user.role.deleted.

ProjectsRoles

List project roles
admin.organization.projects.roles.list(strproject_id, RoleListParams**kwargs) -> SyncNextCursorPage[Role]
GET/projects/{project_id}/roles
Create project role
admin.organization.projects.roles.create(strproject_id, RoleCreateParams**kwargs) -> Role
POST/projects/{project_id}/roles
Update project role
admin.organization.projects.roles.update(strrole_id, RoleUpdateParams**kwargs) -> Role
POST/projects/{project_id}/roles/{role_id}
Delete project role
admin.organization.projects.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/projects/{project_id}/roles/{role_id}
ModelsExpand Collapse
class RoleDeleteResponse:

Confirmation payload returned after deleting a role.

id: str

Identifier of the deleted role.

deleted: bool

Whether the role was deleted.

object: Literal["role.deleted"]

Always role.deleted.

ProjectsCertificates

List project certificates
admin.organization.projects.certificates.list(strproject_id, CertificateListParams**kwargs) -> SyncConversationCursorPage[CertificateListResponse]
GET/organization/projects/{project_id}/certificates
Activate certificates for project
admin.organization.projects.certificates.activate(strproject_id, CertificateActivateParams**kwargs) -> SyncPage[CertificateActivateResponse]
POST/organization/projects/{project_id}/certificates/activate
Deactivate certificates for project
admin.organization.projects.certificates.deactivate(strproject_id, CertificateDeactivateParams**kwargs) -> SyncPage[CertificateDeactivateResponse]
POST/organization/projects/{project_id}/certificates/deactivate
ModelsExpand Collapse
class CertificateListResponse:

Represents an individual certificate configured at the project level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the project level.

certificate_details: CertificateDetails
expires_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate expires.

formatunixtime
valid_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate becomes valid.

formatunixtime
created_at: int

The Unix timestamp (in seconds) of when the certificate was uploaded.

formatunixtime
name: Optional[str]

The name of the certificate.

object: Literal["organization.project.certificate"]

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

class CertificateActivateResponse:

Represents an individual certificate configured at the project level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the project level.

certificate_details: CertificateDetails
expires_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate expires.

formatunixtime
valid_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate becomes valid.

formatunixtime
created_at: int

The Unix timestamp (in seconds) of when the certificate was uploaded.

formatunixtime
name: Optional[str]

The name of the certificate.

object: Literal["organization.project.certificate"]

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

class CertificateDeactivateResponse:

Represents an individual certificate configured at the project level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the project level.

certificate_details: CertificateDetails
expires_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate expires.

formatunixtime
valid_at: Optional[int]

The Unix timestamp (in seconds) of when the certificate becomes valid.

formatunixtime
created_at: int

The Unix timestamp (in seconds) of when the certificate was uploaded.

formatunixtime
name: Optional[str]

The name of the certificate.

object: Literal["organization.project.certificate"]

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