Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Admin

AdminOrganization

AdminOrganizationAdmin API Keys

Create admin API key
admin.organization.admin_api_keys.create(**kwargs) -> AdminAPIKeyCreateResponse { value }
POST/organization/admin_api_keys
Delete admin API key
admin.organization.admin_api_keys.delete(key_id) -> AdminAPIKeyDeleteResponse { id, deleted, object }
DELETE/organization/admin_api_keys/{key_id}
List all organization and project API keys.
admin.organization.admin_api_keys.list(**kwargs) -> CursorPage<AdminAPIKey { id, created_at, expires_at, 5 more } >
GET/organization/admin_api_keys
Retrieve admin API key
admin.organization.admin_api_keys.retrieve(key_id) -> AdminAPIKey { id, created_at, expires_at, 5 more }
GET/organization/admin_api_keys/{key_id}
ModelsExpand Collapse
class AdminAPIKey { id, created_at, expires_at, 5 more }

Represents an individual Admin API key in an org.

class AdminAPIKeyCreateResponse { value }

Represents an individual Admin API key in an org.

class AdminAPIKeyDeleteResponse { id, deleted, object }

AdminOrganizationAudit Logs

List user actions and configuration changes within this organization.

List audit logs
admin.organization.audit_logs.list(**kwargs) -> ConversationCursorPage<AuditLogListResponse { id, effective_at, type, 57 more } >
GET/organization/audit_logs
ModelsExpand Collapse
class AuditLogListResponse { id, effective_at, type, 57 more }

A log of a user action or configuration change within this organization.

AdminOrganizationCertificates

Activate certificates for organization
admin.organization.certificates.activate(**kwargs) -> Page<CertificateActivateResponse { id, active, certificate_details, 3 more } >
POST/organization/certificates/activate
Upload certificate
admin.organization.certificates.create(**kwargs) -> Certificate { id, certificate_details, created_at, 3 more }
POST/organization/certificates
Deactivate certificates for organization
admin.organization.certificates.deactivate(**kwargs) -> Page<CertificateDeactivateResponse { id, active, certificate_details, 3 more } >
POST/organization/certificates/deactivate
Delete certificate
admin.organization.certificates.delete(certificate_id) -> CertificateDeleteResponse { id, object }
DELETE/organization/certificates/{certificate_id}
List organization certificates
admin.organization.certificates.list(**kwargs) -> ConversationCursorPage<CertificateListResponse { id, active, certificate_details, 3 more } >
GET/organization/certificates
Get certificate
admin.organization.certificates.retrieve(certificate_id, **kwargs) -> Certificate { id, certificate_details, created_at, 3 more }
GET/organization/certificates/{certificate_id}
Modify certificate
admin.organization.certificates.update(certificate_id, **kwargs) -> Certificate { id, certificate_details, created_at, 3 more }
POST/organization/certificates/{certificate_id}
ModelsExpand Collapse
class Certificate { id, certificate_details, created_at, 3 more }

Represents an individual certificate uploaded to the organization.

class CertificateActivateResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the organization level.

class CertificateDeactivateResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the organization level.

class CertificateDeleteResponse { id, object }
class CertificateListResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the organization level.

AdminOrganizationData Retention

Retrieve organization data retention
admin.organization.data_retention.retrieve() -> OrganizationDataRetention { object, type }
GET/organization/data_retention
Update organization data retention
admin.organization.data_retention.update(**kwargs) -> OrganizationDataRetention { object, type }
POST/organization/data_retention
ModelsExpand Collapse
class OrganizationDataRetention { object, type }

Represents the organization’s data retention control setting.

AdminOrganizationGroups

Create group
admin.organization.groups.create(**kwargs) -> Group { id, created_at, group_type, 2 more }
POST/organization/groups
Delete group
admin.organization.groups.delete(group_id) -> GroupDeleteResponse { id, deleted, object }
DELETE/organization/groups/{group_id}
List groups
admin.organization.groups.list(**kwargs) -> NextCursorPage<Group { id, created_at, group_type, 2 more } >
GET/organization/groups
Retrieve group
admin.organization.groups.retrieve(group_id) -> Group { id, created_at, group_type, 2 more }
GET/organization/groups/{group_id}
Update group
admin.organization.groups.update(group_id, **kwargs) -> GroupUpdateResponse { id, created_at, is_scim_managed, name }
POST/organization/groups/{group_id}
ModelsExpand Collapse
class Group { id, created_at, group_type, 2 more }

Details about an organization group.

class GroupDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a group.

class GroupUpdateResponse { id, created_at, is_scim_managed, name }

Response returned after updating a group.

AdminOrganizationGroupsRoles

Assign organization role to group
admin.organization.groups.roles.create(group_id, **kwargs) -> RoleCreateResponse { group, object, role }
POST/organization/groups/{group_id}/roles
Unassign organization role from group
admin.organization.groups.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/roles/{role_id}
List group organization role assignments
admin.organization.groups.roles.list(group_id, **kwargs) -> NextCursorPage<RoleListResponse { id, assignment_sources, created_at, 9 more } >
GET/organization/groups/{group_id}/roles
Retrieve group organization role
admin.organization.groups.roles.retrieve(role_id, **kwargs) -> RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }
GET/organization/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
class RoleCreateResponse { group, object, role }

Role assignment linking a group to a role.

class RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

class RoleListResponse { id, assignment_sources, created_at, 9 more }

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

class RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }

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

AdminOrganizationGroupsUsers

Add group user
admin.organization.groups.users.create(group_id, **kwargs) -> UserCreateResponse { group_id, object, user_id }
POST/organization/groups/{group_id}/users
Remove group user
admin.organization.groups.users.delete(user_id, **kwargs) -> UserDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/users/{user_id}
List group users
admin.organization.groups.users.list(group_id, **kwargs) -> NextCursorPage<OrganizationGroupUser { id, email, name } >
GET/organization/groups/{group_id}/users
Retrieve group user
admin.organization.groups.users.retrieve(user_id, **kwargs) -> UserRetrieveResponse { id, email, is_service_account, 3 more }
GET/organization/groups/{group_id}/users/{user_id}
ModelsExpand Collapse
class OrganizationGroupUser { id, email, name }

Represents an individual user returned when inspecting group membership.

class UserCreateResponse { group_id, object, user_id }

Confirmation payload returned after adding a user to a group.

class UserDeleteResponse { deleted, object }

Confirmation payload returned after removing a user from a group.

class UserRetrieveResponse { id, email, is_service_account, 3 more }

Details about a user returned from an organization group membership lookup.

AdminOrganizationInvites

Create invite
admin.organization.invites.create(**kwargs) -> Invite { id, created_at, email, 6 more }
POST/organization/invites
Delete invite
admin.organization.invites.delete(invite_id) -> InviteDeleteResponse { id, deleted, object }
DELETE/organization/invites/{invite_id}
List invites
admin.organization.invites.list(**kwargs) -> ConversationCursorPage<Invite { id, created_at, email, 6 more } >
GET/organization/invites
Retrieve invite
admin.organization.invites.retrieve(invite_id) -> Invite { id, created_at, email, 6 more }
GET/organization/invites/{invite_id}
ModelsExpand Collapse
class Invite { id, created_at, email, 6 more }

Represents an individual invite to the organization.

class InviteDeleteResponse { id, deleted, object }

AdminOrganizationProjects

Archive project
admin.organization.projects.archive(project_id) -> Project { id, created_at, object, 5 more }
POST/organization/projects/{project_id}/archive
Create project
admin.organization.projects.create(**kwargs) -> Project { id, created_at, object, 5 more }
POST/organization/projects
List projects
admin.organization.projects.list(**kwargs) -> ConversationCursorPage<Project { id, created_at, object, 5 more } >
GET/organization/projects
Retrieve project
admin.organization.projects.retrieve(project_id) -> Project { id, created_at, object, 5 more }
GET/organization/projects/{project_id}
Modify project
admin.organization.projects.update(project_id, **kwargs) -> Project { id, created_at, object, 5 more }
POST/organization/projects/{project_id}
ModelsExpand Collapse
class Project { id, created_at, object, 5 more }

Represents an individual project.

AdminOrganizationProjectsAPI Keys

Delete project API key
admin.organization.projects.api_keys.delete(api_key_id, **kwargs) -> APIKeyDeleteResponse { id, deleted, object }
DELETE/organization/projects/{project_id}/api_keys/{api_key_id}
List project API keys
admin.organization.projects.api_keys.list(project_id, **kwargs) -> ConversationCursorPage<ProjectAPIKey { id, created_at, last_used_at, 5 more } >
GET/organization/projects/{project_id}/api_keys
Retrieve project API key
admin.organization.projects.api_keys.retrieve(api_key_id, **kwargs) -> ProjectAPIKey { id, created_at, last_used_at, 5 more }
GET/organization/projects/{project_id}/api_keys/{api_key_id}
ModelsExpand Collapse
class APIKeyDeleteResponse { id, deleted, object }
class ProjectAPIKey { id, created_at, last_used_at, 5 more }

Represents an individual API key in a project.

AdminOrganizationProjectsCertificates

Activate certificates for project
admin.organization.projects.certificates.activate(project_id, **kwargs) -> Page<CertificateActivateResponse { id, active, certificate_details, 3 more } >
POST/organization/projects/{project_id}/certificates/activate
Deactivate certificates for project
admin.organization.projects.certificates.deactivate(project_id, **kwargs) -> Page<CertificateDeactivateResponse { id, active, certificate_details, 3 more } >
POST/organization/projects/{project_id}/certificates/deactivate
List project certificates
admin.organization.projects.certificates.list(project_id, **kwargs) -> ConversationCursorPage<CertificateListResponse { id, active, certificate_details, 3 more } >
GET/organization/projects/{project_id}/certificates
ModelsExpand Collapse
class CertificateActivateResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the project level.

class CertificateDeactivateResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the project level.

class CertificateListResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the project level.

AdminOrganizationProjectsData Retention

Retrieve project data retention
admin.organization.projects.data_retention.retrieve(project_id) -> ProjectDataRetention { object, type }
GET/organization/projects/{project_id}/data_retention
Update project data retention
admin.organization.projects.data_retention.update(project_id, **kwargs) -> ProjectDataRetention { object, type }
POST/organization/projects/{project_id}/data_retention
ModelsExpand Collapse
class ProjectDataRetention { object, type }

Represents a project’s data retention control setting.

AdminOrganizationProjectsGroups

Add project group
admin.organization.projects.groups.create(project_id, **kwargs) -> ProjectGroup { created_at, group_id, group_name, 3 more }
POST/organization/projects/{project_id}/groups
Remove project group
admin.organization.projects.groups.delete(group_id, **kwargs) -> GroupDeleteResponse { deleted, object }
DELETE/organization/projects/{project_id}/groups/{group_id}
List project groups
admin.organization.projects.groups.list(project_id, **kwargs) -> NextCursorPage<ProjectGroup { created_at, group_id, group_name, 3 more } >
GET/organization/projects/{project_id}/groups
Retrieve project group
admin.organization.projects.groups.retrieve(group_id, **kwargs) -> ProjectGroup { created_at, group_id, group_name, 3 more }
GET/organization/projects/{project_id}/groups/{group_id}
ModelsExpand Collapse
class GroupDeleteResponse { deleted, object }

Confirmation payload returned after removing a group from a project.

class ProjectGroup { created_at, group_id, group_name, 3 more }

Details about a group’s membership in a project.

AdminOrganizationProjectsGroupsRoles

Assign project role to group
admin.organization.projects.groups.roles.create(group_id, **kwargs) -> RoleCreateResponse { group, object, role }
POST/projects/{project_id}/groups/{group_id}/roles
Unassign project role from group
admin.organization.projects.groups.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { deleted, object }
DELETE/projects/{project_id}/groups/{group_id}/roles/{role_id}
List project group role assignments
admin.organization.projects.groups.roles.list(group_id, **kwargs) -> NextCursorPage<RoleListResponse { id, assignment_sources, created_at, 9 more } >
GET/projects/{project_id}/groups/{group_id}/roles
Retrieve project group role
admin.organization.projects.groups.roles.retrieve(role_id, **kwargs) -> RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }
GET/projects/{project_id}/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
class RoleCreateResponse { group, object, role }

Role assignment linking a group to a role.

class RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

class RoleListResponse { id, assignment_sources, created_at, 9 more }

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

class RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }

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

AdminOrganizationProjectsHosted Tool Permissions

Retrieve project hosted tool permissions
admin.organization.projects.hosted_tool_permissions.retrieve(project_id) -> ProjectHostedToolPermissions { code_interpreter, file_search, image_generation, 2 more }
GET/organization/projects/{project_id}/hosted_tool_permissions
Modify project hosted tool permissions
admin.organization.projects.hosted_tool_permissions.update(project_id, **kwargs) -> ProjectHostedToolPermissions { code_interpreter, file_search, image_generation, 2 more }
POST/organization/projects/{project_id}/hosted_tool_permissions
ModelsExpand Collapse
class ProjectHostedToolPermissions { code_interpreter, file_search, image_generation, 2 more }

Represents hosted tool permissions for a project.

AdminOrganizationProjectsModel Permissions

Delete project model permissions
admin.organization.projects.model_permissions.delete(project_id) -> ProjectModelPermissionsDeleted { deleted, object }
DELETE/organization/projects/{project_id}/model_permissions
Retrieve project model permissions
admin.organization.projects.model_permissions.retrieve(project_id) -> ProjectModelPermissions { mode, model_ids, object }
GET/organization/projects/{project_id}/model_permissions
Modify project model permissions
admin.organization.projects.model_permissions.update(project_id, **kwargs) -> ProjectModelPermissions { mode, model_ids, object }
POST/organization/projects/{project_id}/model_permissions
ModelsExpand Collapse
class ProjectModelPermissions { mode, model_ids, object }

Represents the model allowlist or denylist policy for a project.

class ProjectModelPermissionsDeleted { deleted, object }

Confirmation payload returned after deleting project model permissions.

AdminOrganizationProjectsRate Limits

List project rate limits
admin.organization.projects.rate_limits.list_rate_limits(project_id, **kwargs) -> ConversationCursorPage<ProjectRateLimit { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more } >
GET/organization/projects/{project_id}/rate_limits
Modify project rate limit
admin.organization.projects.rate_limits.update_rate_limit(rate_limit_id, **kwargs) -> ProjectRateLimit { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }
POST/organization/projects/{project_id}/rate_limits/{rate_limit_id}
ModelsExpand Collapse
class ProjectRateLimit { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }

Represents a project rate limit config.

AdminOrganizationProjectsRoles

Create project role
admin.organization.projects.roles.create(project_id, **kwargs) -> Role { id, description, name, 4 more }
POST/projects/{project_id}/roles
Delete project role
admin.organization.projects.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { id, deleted, object }
DELETE/projects/{project_id}/roles/{role_id}
List project roles
admin.organization.projects.roles.list(project_id, **kwargs) -> NextCursorPage<Role { id, description, name, 4 more } >
GET/projects/{project_id}/roles
Retrieve project role
admin.organization.projects.roles.retrieve(role_id, **kwargs) -> Role { id, description, name, 4 more }
GET/projects/{project_id}/roles/{role_id}
Update project role
admin.organization.projects.roles.update(role_id, **kwargs) -> Role { id, description, name, 4 more }
POST/projects/{project_id}/roles/{role_id}
ModelsExpand Collapse
class RoleDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a role.

AdminOrganizationProjectsService Accounts

Create project service account
admin.organization.projects.service_accounts.create(project_id, **kwargs) -> ServiceAccountCreateResponse { id, api_key, created_at, 3 more }
POST/organization/projects/{project_id}/service_accounts
Delete project service account
admin.organization.projects.service_accounts.delete(service_account_id, **kwargs) -> ServiceAccountDeleteResponse { id, deleted, object }
DELETE/organization/projects/{project_id}/service_accounts/{service_account_id}
List project service accounts
admin.organization.projects.service_accounts.list(project_id, **kwargs) -> ConversationCursorPage<ProjectServiceAccount { id, created_at, name, 2 more } >
GET/organization/projects/{project_id}/service_accounts
Retrieve project service account
admin.organization.projects.service_accounts.retrieve(service_account_id, **kwargs) -> ProjectServiceAccount { id, created_at, name, 2 more }
GET/organization/projects/{project_id}/service_accounts/{service_account_id}
Update project service account
admin.organization.projects.service_accounts.update(service_account_id, **kwargs) -> ProjectServiceAccount { id, created_at, name, 2 more }
POST/organization/projects/{project_id}/service_accounts/{service_account_id}
ModelsExpand Collapse
class ProjectServiceAccount { id, created_at, name, 2 more }

Represents an individual service account in a project.

class ServiceAccountCreateResponse { id, api_key, created_at, 3 more }
class ServiceAccountDeleteResponse { id, deleted, object }

AdminOrganizationProjectsService AccountsAPI Keys

Create project service account API key
admin.organization.projects.service_accounts.api_keys.create(service_account_id, **kwargs) -> APIKeyCreateResponse { id, created_at, name, 2 more }
POST/organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys
ModelsExpand Collapse
class APIKeyCreateResponse { id, created_at, name, 2 more }

AdminOrganizationProjectsSpend Alerts

Create project spend alert
admin.organization.projects.spend_alerts.create(project_id, **kwargs) -> ProjectSpendAlert { id, currency, interval, 3 more }
POST/organization/projects/{project_id}/spend_alerts
Delete project spend alert
admin.organization.projects.spend_alerts.delete(alert_id, **kwargs) -> ProjectSpendAlertDeleted { id, deleted, object }
DELETE/organization/projects/{project_id}/spend_alerts/{alert_id}
List project spend alerts
admin.organization.projects.spend_alerts.list(project_id, **kwargs) -> ConversationCursorPage<ProjectSpendAlert { id, currency, interval, 3 more } >
GET/organization/projects/{project_id}/spend_alerts
Retrieve project spend alert
admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert { id, currency, interval, 3 more }
GET/organization/projects/{project_id}/spend_alerts/{alert_id}
Update project spend alert
admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert { id, currency, interval, 3 more }
POST/organization/projects/{project_id}/spend_alerts/{alert_id}
ModelsExpand Collapse
class ProjectSpendAlert { id, currency, interval, 3 more }

Represents a spend alert configured at the project level.

class ProjectSpendAlertDeleted { id, deleted, object }

Confirmation payload returned after deleting a project spend alert.

AdminOrganizationProjectsSpend Limit

Delete project spend limit
admin.organization.projects.spend_limit.delete(project_id) -> ProjectSpendLimitDeleted { deleted, object }
DELETE/organization/projects/{project_id}/spend_limit
Retrieve project spend limit
admin.organization.projects.spend_limit.retrieve(project_id) -> ProjectSpendLimit { currency, enforcement, interval, 2 more }
GET/organization/projects/{project_id}/spend_limit
Update project spend limit
admin.organization.projects.spend_limit.update(project_id, **kwargs) -> ProjectSpendLimit { currency, enforcement, interval, 2 more }
POST/organization/projects/{project_id}/spend_limit
ModelsExpand Collapse
class ProjectSpendLimit { currency, enforcement, interval, 2 more }

Represents a hard spend limit configured at the project level.

class ProjectSpendLimitDeleted { deleted, object }

Confirmation payload returned after deleting a project hard spend limit.

AdminOrganizationProjectsUsers

Create project user
admin.organization.projects.users.create(project_id, **kwargs) -> ProjectUser { id, added_at, object, 3 more }
POST/organization/projects/{project_id}/users
Delete project user
admin.organization.projects.users.delete(user_id, **kwargs) -> UserDeleteResponse { id, deleted, object }
DELETE/organization/projects/{project_id}/users/{user_id}
List project users
admin.organization.projects.users.list(project_id, **kwargs) -> ConversationCursorPage<ProjectUser { id, added_at, object, 3 more } >
GET/organization/projects/{project_id}/users
Retrieve project user
admin.organization.projects.users.retrieve(user_id, **kwargs) -> ProjectUser { id, added_at, object, 3 more }
GET/organization/projects/{project_id}/users/{user_id}
Modify project user
admin.organization.projects.users.update(user_id, **kwargs) -> ProjectUser { id, added_at, object, 3 more }
POST/organization/projects/{project_id}/users/{user_id}
ModelsExpand Collapse
class ProjectUser { id, added_at, object, 3 more }

Represents an individual user in a project.

class UserDeleteResponse { id, deleted, object }

AdminOrganizationProjectsUsersRoles

Assign project role to user
admin.organization.projects.users.roles.create(user_id, **kwargs) -> RoleCreateResponse { object, role, user }
POST/projects/{project_id}/users/{user_id}/roles
Unassign project role from user
admin.organization.projects.users.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { deleted, object }
DELETE/projects/{project_id}/users/{user_id}/roles/{role_id}
List project user role assignments
admin.organization.projects.users.roles.list(user_id, **kwargs) -> NextCursorPage<RoleListResponse { id, assignment_sources, created_at, 9 more } >
GET/projects/{project_id}/users/{user_id}/roles
Retrieve project user role
admin.organization.projects.users.roles.retrieve(role_id, **kwargs) -> RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }
GET/projects/{project_id}/users/{user_id}/roles/{role_id}
ModelsExpand Collapse
class RoleCreateResponse { object, role, user }

Role assignment linking a user to a role.

class RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

class RoleListResponse { id, assignment_sources, created_at, 9 more }

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

class RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }

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

AdminOrganizationRoles

Create organization role
admin.organization.roles.create(**kwargs) -> Role { id, description, name, 4 more }
POST/organization/roles
Delete organization role
admin.organization.roles.delete(role_id) -> RoleDeleteResponse { id, deleted, object }
DELETE/organization/roles/{role_id}
List organization roles
admin.organization.roles.list(**kwargs) -> NextCursorPage<Role { id, description, name, 4 more } >
GET/organization/roles
Retrieve organization role
admin.organization.roles.retrieve(role_id) -> Role { id, description, name, 4 more }
GET/organization/roles/{role_id}
Update organization role
admin.organization.roles.update(role_id, **kwargs) -> Role { id, description, name, 4 more }
POST/organization/roles/{role_id}
ModelsExpand Collapse
class Role { id, description, name, 4 more }

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

class RoleDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a role.

AdminOrganizationSpend Alerts

Create organization spend alert
admin.organization.spend_alerts.create(**kwargs) -> OrganizationSpendAlert { id, currency, interval, 3 more }
POST/organization/spend_alerts
Delete organization spend alert
admin.organization.spend_alerts.delete(alert_id) -> OrganizationSpendAlertDeleted { id, deleted, object }
DELETE/organization/spend_alerts/{alert_id}
List organization spend alerts
admin.organization.spend_alerts.list(**kwargs) -> ConversationCursorPage<OrganizationSpendAlert { id, currency, interval, 3 more } >
GET/organization/spend_alerts
Retrieve organization spend alert
admin.organization.spend_alerts.retrieve(alert_id) -> OrganizationSpendAlert { id, currency, interval, 3 more }
GET/organization/spend_alerts/{alert_id}
Update organization spend alert
admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert { id, currency, interval, 3 more }
POST/organization/spend_alerts/{alert_id}
ModelsExpand Collapse
class OrganizationSpendAlert { id, currency, interval, 3 more }

Represents a spend alert configured at the organization level.

class OrganizationSpendAlertDeleted { id, deleted, object }

Confirmation payload returned after deleting an organization spend alert.

AdminOrganizationSpend Limit

Delete organization spend limit
admin.organization.spend_limit.delete() -> OrganizationSpendLimitDeleted { deleted, object }
DELETE/organization/spend_limit
Retrieve organization spend limit
admin.organization.spend_limit.retrieve() -> OrganizationSpendLimit { currency, enforcement, interval, 2 more }
GET/organization/spend_limit
Update organization spend limit
admin.organization.spend_limit.update(**kwargs) -> OrganizationSpendLimit { currency, enforcement, interval, 2 more }
POST/organization/spend_limit
ModelsExpand Collapse
class OrganizationSpendLimit { currency, enforcement, interval, 2 more }

Represents a hard spend limit configured at the organization level.

class OrganizationSpendLimitDeleted { deleted, object }

Confirmation payload returned after deleting an organization hard spend limit.

AdminOrganizationUsage

Audio speeches
admin.organization.usage.audio_speeches(**kwargs) -> UsageAudioSpeechesResponse { data, has_more, next_page, object }
GET/organization/usage/audio_speeches
Audio transcriptions
admin.organization.usage.audio_transcriptions(**kwargs) -> UsageAudioTranscriptionsResponse { data, has_more, next_page, object }
GET/organization/usage/audio_transcriptions
Code interpreter sessions
admin.organization.usage.code_interpreter_sessions(**kwargs) -> UsageCodeInterpreterSessionsResponse { data, has_more, next_page, object }
GET/organization/usage/code_interpreter_sessions
Completions
admin.organization.usage.completions(**kwargs) -> UsageCompletionsResponse { data, has_more, next_page, object }
GET/organization/usage/completions
Costs
admin.organization.usage.costs(**kwargs) -> UsageCostsResponse { data, has_more, next_page, object }
GET/organization/costs
Embeddings
admin.organization.usage.embeddings(**kwargs) -> UsageEmbeddingsResponse { data, has_more, next_page, object }
GET/organization/usage/embeddings
File search calls
admin.organization.usage.file_search_calls(**kwargs) -> UsageFileSearchCallsResponse { data, has_more, next_page, object }
GET/organization/usage/file_search_calls
Images
admin.organization.usage.images(**kwargs) -> UsageImagesResponse { data, has_more, next_page, object }
GET/organization/usage/images
Moderations
admin.organization.usage.moderations(**kwargs) -> UsageModerationsResponse { data, has_more, next_page, object }
GET/organization/usage/moderations
Vector stores
admin.organization.usage.vector_stores(**kwargs) -> UsageVectorStoresResponse { data, has_more, next_page, object }
GET/organization/usage/vector_stores
Web search calls
admin.organization.usage.web_search_calls(**kwargs) -> UsageWebSearchCallsResponse { data, has_more, next_page, object }
GET/organization/usage/web_search_calls
ModelsExpand Collapse
class UsageAudioSpeechesResponse { data, has_more, next_page, object }
class UsageAudioTranscriptionsResponse { data, has_more, next_page, object }
class UsageCodeInterpreterSessionsResponse { data, has_more, next_page, object }
class UsageCompletionsResponse { data, has_more, next_page, object }
class UsageCostsResponse { data, has_more, next_page, object }
class UsageEmbeddingsResponse { data, has_more, next_page, object }
class UsageFileSearchCallsResponse { data, has_more, next_page, object }
class UsageImagesResponse { data, has_more, next_page, object }
class UsageModerationsResponse { data, has_more, next_page, object }
class UsageVectorStoresResponse { data, has_more, next_page, object }
class UsageWebSearchCallsResponse { data, has_more, next_page, object }

AdminOrganizationUsers

Delete user
admin.organization.users.delete(user_id) -> UserDeleteResponse { id, deleted, object }
DELETE/organization/users/{user_id}
List users
admin.organization.users.list(**kwargs) -> ConversationCursorPage<OrganizationUser { id, added_at, object, 13 more } >
GET/organization/users
Retrieve user
admin.organization.users.retrieve(user_id) -> OrganizationUser { id, added_at, object, 13 more }
GET/organization/users/{user_id}
Modify user
admin.organization.users.update(user_id, **kwargs) -> OrganizationUser { id, added_at, object, 13 more }
POST/organization/users/{user_id}
ModelsExpand Collapse
class OrganizationUser { id, added_at, object, 13 more }

Represents an individual user within an organization.

class UserDeleteResponse { id, deleted, object }

AdminOrganizationUsersRoles

Assign organization role to user
admin.organization.users.roles.create(user_id, **kwargs) -> RoleCreateResponse { object, role, user }
POST/organization/users/{user_id}/roles
Unassign organization role from user
admin.organization.users.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { deleted, object }
DELETE/organization/users/{user_id}/roles/{role_id}
List user organization role assignments
admin.organization.users.roles.list(user_id, **kwargs) -> NextCursorPage<RoleListResponse { id, assignment_sources, created_at, 9 more } >
GET/organization/users/{user_id}/roles
Retrieve user organization role
admin.organization.users.roles.retrieve(role_id, **kwargs) -> RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }
GET/organization/users/{user_id}/roles/{role_id}
ModelsExpand Collapse
class RoleCreateResponse { object, role, user }

Role assignment linking a user to a role.

class RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

class RoleListResponse { id, assignment_sources, created_at, 9 more }

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

class RoleRetrieveResponse { id, assignment_sources, created_at, 9 more }

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