Skip to content
Primary navigation

Organization

OrganizationAudit Logs

List user actions and configuration changes within this organization.

List audit logs
admin.organization.audit_logs.list(AuditLogListParams**kwargs) -> SyncConversationCursorPage[AuditLogListResponse]
GET/organization/audit_logs
ModelsExpand Collapse
class AuditLogListResponse:

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

id: str

The ID of this log.

effective_at: int

The Unix timestamp (in seconds) of the event.

formatunixtime
type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 48 more]

The event type.

One of the following:
"api_key.created"
"api_key.updated"
"api_key.deleted"
"certificate.created"
"certificate.updated"
"certificate.deleted"
"certificates.activated"
"certificates.deactivated"
"checkpoint.permission.created"
"checkpoint.permission.deleted"
"external_key.registered"
"external_key.removed"
"group.created"
"group.updated"
"group.deleted"
"invite.sent"
"invite.accepted"
"invite.deleted"
"ip_allowlist.created"
"ip_allowlist.updated"
"ip_allowlist.deleted"
"ip_allowlist.config.activated"
"ip_allowlist.config.deactivated"
"login.succeeded"
"login.failed"
"logout.succeeded"
"logout.failed"
"organization.updated"
"project.created"
"project.updated"
"project.archived"
"project.deleted"
"rate_limit.updated"
"rate_limit.deleted"
"resource.deleted"
"tunnel.created"
"tunnel.updated"
"tunnel.deleted"
"role.created"
"role.updated"
"role.deleted"
"role.assignment.created"
"role.assignment.deleted"
"scim.enabled"
"scim.disabled"
"service_account.created"
"service_account.updated"
"service_account.deleted"
"user.added"
"user.updated"
"user.deleted"
actor: Optional[Actor]

The actor who performed the audit logged action.

api_key: Optional[ActorAPIKey]

The API Key used to perform the audit logged action.

id: Optional[str]

The tracking id of the API key.

service_account: Optional[ActorAPIKeyServiceAccount]

The service account that performed the audit logged action.

id: Optional[str]

The service account id.

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

The type of API key. Can be either user or service_account.

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

The user who performed the audit logged action.

id: Optional[str]

The user id.

email: Optional[str]

The user email.

session: Optional[ActorSession]

The session in which the audit logged action was performed.

ip_address: Optional[str]

The IP address from which the action was performed.

user: Optional[ActorSessionUser]

The user who performed the audit logged action.

id: Optional[str]

The user id.

email: Optional[str]

The user email.

type: Optional[Literal["session", "api_key"]]

The type of actor. Is either session or api_key.

One of the following:
"session"
"api_key"
api_key_created: Optional[APIKeyCreated]

The details for events with this type.

id: Optional[str]

The tracking ID of the API key.

data: Optional[APIKeyCreatedData]

The payload used to create the API key.

scopes: Optional[List[str]]

A list of scopes allowed for the API key, e.g. ["api.model.request"]

api_key_deleted: Optional[APIKeyDeleted]

The details for events with this type.

id: Optional[str]

The tracking ID of the API key.

api_key_updated: Optional[APIKeyUpdated]

The details for events with this type.

id: Optional[str]

The tracking ID of the API key.

changes_requested: Optional[APIKeyUpdatedChangesRequested]

The payload used to update the API key.

scopes: Optional[List[str]]

A list of scopes allowed for the API key, e.g. ["api.model.request"]

certificate_created: Optional[CertificateCreated]

The details for events with this type.

id: Optional[str]

The certificate ID.

name: Optional[str]

The name of the certificate.

certificate_deleted: Optional[CertificateDeleted]

The details for events with this type.

id: Optional[str]

The certificate ID.

certificate: Optional[str]

The certificate content in PEM format.

name: Optional[str]

The name of the certificate.

certificate_updated: Optional[CertificateUpdated]

The details for events with this type.

id: Optional[str]

The certificate ID.

name: Optional[str]

The name of the certificate.

certificates_activated: Optional[CertificatesActivated]

The details for events with this type.

certificates: Optional[List[CertificatesActivatedCertificate]]
id: Optional[str]

The certificate ID.

name: Optional[str]

The name of the certificate.

certificates_deactivated: Optional[CertificatesDeactivated]

The details for events with this type.

certificates: Optional[List[CertificatesDeactivatedCertificate]]
id: Optional[str]

The certificate ID.

name: Optional[str]

The name of the certificate.

checkpoint_permission_created: Optional[CheckpointPermissionCreated]

The project and fine-tuned model checkpoint that the checkpoint permission was created for.

id: Optional[str]

The ID of the checkpoint permission.

data: Optional[CheckpointPermissionCreatedData]

The payload used to create the checkpoint permission.

fine_tuned_model_checkpoint: Optional[str]

The ID of the fine-tuned model checkpoint.

project_id: Optional[str]

The ID of the project that the checkpoint permission was created for.

checkpoint_permission_deleted: Optional[CheckpointPermissionDeleted]

The details for events with this type.

id: Optional[str]

The ID of the checkpoint permission.

external_key_registered: Optional[ExternalKeyRegistered]

The details for events with this type.

id: Optional[str]

The ID of the external key configuration.

data: Optional[object]

The configuration for the external key.

external_key_removed: Optional[ExternalKeyRemoved]

The details for events with this type.

id: Optional[str]

The ID of the external key configuration.

group_created: Optional[GroupCreated]

The details for events with this type.

id: Optional[str]

The ID of the group.

data: Optional[GroupCreatedData]

Information about the created group.

group_name: Optional[str]

The group name.

group_deleted: Optional[GroupDeleted]

The details for events with this type.

id: Optional[str]

The ID of the group.

group_updated: Optional[GroupUpdated]

The details for events with this type.

id: Optional[str]

The ID of the group.

changes_requested: Optional[GroupUpdatedChangesRequested]

The payload used to update the group.

group_name: Optional[str]

The updated group name.

invite_accepted: Optional[InviteAccepted]

The details for events with this type.

id: Optional[str]

The ID of the invite.

invite_deleted: Optional[InviteDeleted]

The details for events with this type.

id: Optional[str]

The ID of the invite.

invite_sent: Optional[InviteSent]

The details for events with this type.

id: Optional[str]

The ID of the invite.

data: Optional[InviteSentData]

The payload used to create the invite.

email: Optional[str]

The email invited to the organization.

role: Optional[str]

The role the email was invited to be. Is either owner or member.

ip_allowlist_config_activated: Optional[IPAllowlistConfigActivated]

The details for events with this type.

configs: Optional[List[IPAllowlistConfigActivatedConfig]]

The configurations that were activated.

id: Optional[str]

The ID of the IP allowlist configuration.

name: Optional[str]

The name of the IP allowlist configuration.

ip_allowlist_config_deactivated: Optional[IPAllowlistConfigDeactivated]

The details for events with this type.

configs: Optional[List[IPAllowlistConfigDeactivatedConfig]]

The configurations that were deactivated.

id: Optional[str]

The ID of the IP allowlist configuration.

name: Optional[str]

The name of the IP allowlist configuration.

ip_allowlist_created: Optional[IPAllowlistCreated]

The details for events with this type.

id: Optional[str]

The ID of the IP allowlist configuration.

allowed_ips: Optional[List[str]]

The IP addresses or CIDR ranges included in the configuration.

name: Optional[str]

The name of the IP allowlist configuration.

ip_allowlist_deleted: Optional[IPAllowlistDeleted]

The details for events with this type.

id: Optional[str]

The ID of the IP allowlist configuration.

allowed_ips: Optional[List[str]]

The IP addresses or CIDR ranges that were in the configuration.

name: Optional[str]

The name of the IP allowlist configuration.

ip_allowlist_updated: Optional[IPAllowlistUpdated]

The details for events with this type.

id: Optional[str]

The ID of the IP allowlist configuration.

allowed_ips: Optional[List[str]]

The updated set of IP addresses or CIDR ranges in the configuration.

login_failed: Optional[LoginFailed]

The details for events with this type.

error_code: Optional[str]

The error code of the failure.

error_message: Optional[str]

The error message of the failure.

login_succeeded: Optional[object]

This event has no additional fields beyond the standard audit log attributes.

logout_failed: Optional[LogoutFailed]

The details for events with this type.

error_code: Optional[str]

The error code of the failure.

error_message: Optional[str]

The error message of the failure.

logout_succeeded: Optional[object]

This event has no additional fields beyond the standard audit log attributes.

organization_updated: Optional[OrganizationUpdated]

The details for events with this type.

id: Optional[str]

The organization ID.

changes_requested: Optional[OrganizationUpdatedChangesRequested]

The payload used to update the organization settings.

api_call_logging: Optional[str]

How your organization logs data from supported API calls. One of disabled, enabled_per_call, enabled_for_all_projects, or enabled_for_selected_projects

api_call_logging_project_ids: Optional[str]

The list of project ids if api_call_logging is set to enabled_for_selected_projects

description: Optional[str]

The organization description.

name: Optional[str]

The organization name.

threads_ui_visibility: Optional[str]

Visibility of the threads page which shows messages created with the Assistants API and Playground. One of ANY_ROLE, OWNERS, or NONE.

title: Optional[str]

The organization title.

usage_dashboard_visibility: Optional[str]

Visibility of the usage dashboard which shows activity and costs for your organization. One of ANY_ROLE or OWNERS.

project: Optional[Project]

The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project.

id: Optional[str]

The project ID.

name: Optional[str]

The project title.

project_archived: Optional[ProjectArchived]

The details for events with this type.

id: Optional[str]

The project ID.

project_created: Optional[ProjectCreated]

The details for events with this type.

id: Optional[str]

The project ID.

data: Optional[ProjectCreatedData]

The payload used to create the project.

name: Optional[str]

The project name.

title: Optional[str]

The title of the project as seen on the dashboard.

project_deleted: Optional[ProjectDeleted]

The details for events with this type.

id: Optional[str]

The project ID.

project_updated: Optional[ProjectUpdated]

The details for events with this type.

id: Optional[str]

The project ID.

changes_requested: Optional[ProjectUpdatedChangesRequested]

The payload used to update the project.

title: Optional[str]

The title of the project as seen on the dashboard.

rate_limit_deleted: Optional[RateLimitDeleted]

The details for events with this type.

id: Optional[str]

The rate limit ID

rate_limit_updated: Optional[RateLimitUpdated]

The details for events with this type.

id: Optional[str]

The rate limit ID

changes_requested: Optional[RateLimitUpdatedChangesRequested]

The payload used to update the rate limits.

batch_1_day_max_input_tokens: Optional[int]

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

max_audio_megabytes_per_1_minute: Optional[int]

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

max_images_per_1_minute: Optional[int]

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

max_requests_per_1_day: Optional[int]

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

max_requests_per_1_minute: Optional[int]

The maximum requests per minute.

max_tokens_per_1_minute: Optional[int]

The maximum tokens per minute.

role_assignment_created: Optional[RoleAssignmentCreated]

The details for events with this type.

id: Optional[str]

The identifier of the role assignment.

principal_id: Optional[str]

The principal (user or group) that received the role.

principal_type: Optional[str]

The type of principal (user or group) that received the role.

resource_id: Optional[str]

The resource the role assignment is scoped to.

resource_type: Optional[str]

The type of resource the role assignment is scoped to.

role_assignment_deleted: Optional[RoleAssignmentDeleted]

The details for events with this type.

id: Optional[str]

The identifier of the role assignment.

principal_id: Optional[str]

The principal (user or group) that had the role removed.

principal_type: Optional[str]

The type of principal (user or group) that had the role removed.

resource_id: Optional[str]

The resource the role assignment was scoped to.

resource_type: Optional[str]

The type of resource the role assignment was scoped to.

role_created: Optional[RoleCreated]

The details for events with this type.

id: Optional[str]

The role ID.

permissions: Optional[List[str]]

The permissions granted by the role.

resource_id: Optional[str]

The resource the role is scoped to.

resource_type: Optional[str]

The type of resource the role belongs to.

role_name: Optional[str]

The name of the role.

role_deleted: Optional[RoleDeleted]

The details for events with this type.

id: Optional[str]

The role ID.

role_updated: Optional[RoleUpdated]

The details for events with this type.

id: Optional[str]

The role ID.

changes_requested: Optional[RoleUpdatedChangesRequested]

The payload used to update the role.

description: Optional[str]

The updated role description, when provided.

metadata: Optional[object]

Additional metadata stored on the role.

permissions_added: Optional[List[str]]

The permissions added to the role.

permissions_removed: Optional[List[str]]

The permissions removed from the role.

resource_id: Optional[str]

The resource the role is scoped to.

resource_type: Optional[str]

The type of resource the role belongs to.

role_name: Optional[str]

The updated role name, when provided.

scim_disabled: Optional[ScimDisabled]

The details for events with this type.

id: Optional[str]

The ID of the SCIM was disabled for.

scim_enabled: Optional[ScimEnabled]

The details for events with this type.

id: Optional[str]

The ID of the SCIM was enabled for.

service_account_created: Optional[ServiceAccountCreated]

The details for events with this type.

id: Optional[str]

The service account ID.

data: Optional[ServiceAccountCreatedData]

The payload used to create the service account.

role: Optional[str]

The role of the service account. Is either owner or member.

service_account_deleted: Optional[ServiceAccountDeleted]

The details for events with this type.

id: Optional[str]

The service account ID.

service_account_updated: Optional[ServiceAccountUpdated]

The details for events with this type.

id: Optional[str]

The service account ID.

changes_requested: Optional[ServiceAccountUpdatedChangesRequested]

The payload used to updated the service account.

role: Optional[str]

The role of the service account. Is either owner or member.

user_added: Optional[UserAdded]

The details for events with this type.

id: Optional[str]

The user ID.

data: Optional[UserAddedData]

The payload used to add the user to the project.

role: Optional[str]

The role of the user. Is either owner or member.

user_deleted: Optional[UserDeleted]

The details for events with this type.

id: Optional[str]

The user ID.

user_updated: Optional[UserUpdated]

The details for events with this type.

id: Optional[str]

The project ID.

changes_requested: Optional[UserUpdatedChangesRequested]

The payload used to update the user.

role: Optional[str]

The role of the user. Is either owner or member.

OrganizationAdmin API Keys

List all organization and project API keys.
admin.organization.admin_api_keys.list(AdminAPIKeyListParams**kwargs) -> SyncCursorPage[AdminAPIKey]
GET/organization/admin_api_keys
Create admin API key
admin.organization.admin_api_keys.create(AdminAPIKeyCreateParams**kwargs) -> AdminAPIKeyCreateResponse
POST/organization/admin_api_keys
Retrieve admin API key
admin.organization.admin_api_keys.retrieve(strkey_id) -> AdminAPIKey
GET/organization/admin_api_keys/{key_id}
Delete admin API key
admin.organization.admin_api_keys.delete(strkey_id) -> AdminAPIKeyDeleteResponse
DELETE/organization/admin_api_keys/{key_id}
ModelsExpand Collapse
class AdminAPIKey:

Represents an individual Admin API key in an org.

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
object: Literal["organization.admin_api_key"]

The object type, which is always organization.admin_api_key

owner: Owner
id: Optional[str]

The identifier, which can be referenced in API endpoints

created_at: Optional[int]

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

formatunixtime
name: Optional[str]

The name of the user

object: Optional[str]

The object type, which is always organization.user

role: Optional[str]

Always owner

type: Optional[str]

Always user

redacted_value: str

The redacted value of the API key

last_used_at: Optional[int]

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

formatunixtime
name: Optional[str]

The name of the API key

class AdminAPIKeyCreateResponse:

Represents an individual Admin API key in an org.

value: str

The value of the API key. Only shown on create.

class AdminAPIKeyDeleteResponse:
id: str
deleted: bool
object: Literal["organization.admin_api_key.deleted"]

OrganizationUsage

Audio speeches
admin.organization.usage.audio_speeches(UsageAudioSpeechesParams**kwargs) -> UsageAudioSpeechesResponse
GET/organization/usage/audio_speeches
Audio transcriptions
admin.organization.usage.audio_transcriptions(UsageAudioTranscriptionsParams**kwargs) -> UsageAudioTranscriptionsResponse
GET/organization/usage/audio_transcriptions
Code interpreter sessions
admin.organization.usage.code_interpreter_sessions(UsageCodeInterpreterSessionsParams**kwargs) -> UsageCodeInterpreterSessionsResponse
GET/organization/usage/code_interpreter_sessions
Completions
admin.organization.usage.completions(UsageCompletionsParams**kwargs) -> UsageCompletionsResponse
GET/organization/usage/completions
Embeddings
admin.organization.usage.embeddings(UsageEmbeddingsParams**kwargs) -> UsageEmbeddingsResponse
GET/organization/usage/embeddings
Images
admin.organization.usage.images(UsageImagesParams**kwargs) -> UsageImagesResponse
GET/organization/usage/images
Moderations
admin.organization.usage.moderations(UsageModerationsParams**kwargs) -> UsageModerationsResponse
GET/organization/usage/moderations
Vector stores
admin.organization.usage.vector_stores(UsageVectorStoresParams**kwargs) -> UsageVectorStoresResponse
GET/organization/usage/vector_stores
Costs
admin.organization.usage.costs(UsageCostsParams**kwargs) -> UsageCostsResponse
GET/organization/costs
ModelsExpand Collapse
class UsageAudioSpeechesResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageAudioTranscriptionsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageCodeInterpreterSessionsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageCompletionsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageEmbeddingsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageImagesResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageModerationsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageVectorStoresResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]
class UsageCostsResponse:
data: List[Data]
end_time: int
object: Literal["bucket"]
results: List[DataResult]
One of the following:
class DataResultOrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

input_tokens: int

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.completions.result"]
output_tokens: int

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

batch: Optional[bool]

When group_by=batch, this field tells whether the grouped usage result is batch or not.

input_audio_tokens: Optional[int]

The aggregated number of audio input tokens used, including cached tokens.

input_cached_tokens: Optional[int]

The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

output_audio_tokens: Optional[int]

The aggregated number of audio output tokens used.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

service_tier: Optional[str]

When group_by=service_tier, this field provides the service tier of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.embeddings.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

input_tokens: int

The aggregated number of input tokens used.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.moderations.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

images: int

The number of images processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.images.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

size: Optional[str]

When group_by=size, this field provides the image size of the grouped usage result.

source: Optional[str]

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

characters: int

The number of characters processed.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_speeches.result"]
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

num_model_requests: int

The count of requests made to the model.

object: Literal["organization.usage.audio_transcriptions.result"]
seconds: int

The number of seconds processed.

formatint64
api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

model: Optional[str]

When group_by=model, this field provides the model name of the grouped usage result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_id: Optional[str]

When group_by=user_id, this field provides the user ID of the grouped usage result.

class DataResultOrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

object: Literal["organization.usage.vector_stores.result"]
usage_bytes: int

The vector stores usage in bytes.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationUsageCodeInterpreterSessionsResult:

The aggregated code interpreter sessions usage details of the specific time bucket.

num_sessions: int

The number of code interpreter sessions.

object: Literal["organization.usage.code_interpreter_sessions.result"]
project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped usage result.

class DataResultOrganizationCostsResult:

The aggregated costs details of the specific time bucket.

object: Literal["organization.costs.result"]
amount: Optional[DataResultOrganizationCostsResultAmount]

The monetary value in its associated currency.

currency: Optional[str]

Lowercase ISO-4217 currency e.g. “usd”

value: Optional[float]

The numeric value of the cost.

api_key_id: Optional[str]

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

line_item: Optional[str]

When group_by=line_item, this field provides the line item of the grouped costs result.

project_id: Optional[str]

When group_by=project_id, this field provides the project ID of the grouped costs result.

start_time: int
has_more: bool
next_page: Optional[str]
object: Literal["page"]

OrganizationInvites

List invites
admin.organization.invites.list(InviteListParams**kwargs) -> SyncConversationCursorPage[Invite]
GET/organization/invites
Create invite
admin.organization.invites.create(InviteCreateParams**kwargs) -> Invite
POST/organization/invites
Retrieve invite
admin.organization.invites.retrieve(strinvite_id) -> Invite
GET/organization/invites/{invite_id}
Delete invite
admin.organization.invites.delete(strinvite_id) -> InviteDeleteResponse
DELETE/organization/invites/{invite_id}
ModelsExpand Collapse
class Invite:

Represents an individual invite to the organization.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

The Unix timestamp (in seconds) of when the invite was sent.

formatunixtime
email: str

The email address of the individual to whom the invite was sent

object: Literal["organization.invite"]

The object type, which is always organization.invite

projects: List[Project]

The projects that were granted membership upon acceptance of the invite.

id: str

Project’s public ID

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

Project membership role

One of the following:
"member"
"owner"
role: Literal["owner", "reader"]

owner or reader

One of the following:
"owner"
"reader"
status: Literal["accepted", "expired", "pending"]

accepted,expired, or pending

One of the following:
"accepted"
"expired"
"pending"
accepted_at: Optional[int]

The Unix timestamp (in seconds) of when the invite was accepted.

formatunixtime
expires_at: Optional[int]

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

formatunixtime
class InviteDeleteResponse:
id: str
deleted: bool
object: Literal["organization.invite.deleted"]

The object type, which is always organization.invite.deleted

OrganizationUsers

List users
admin.organization.users.list(UserListParams**kwargs) -> SyncConversationCursorPage[OrganizationUser]
GET/organization/users
Retrieve user
admin.organization.users.retrieve(struser_id) -> OrganizationUser
GET/organization/users/{user_id}
Modify user
admin.organization.users.update(struser_id, UserUpdateParams**kwargs) -> OrganizationUser
POST/organization/users/{user_id}
Delete user
admin.organization.users.delete(struser_id) -> UserDeleteResponse
DELETE/organization/users/{user_id}
ModelsExpand Collapse
class OrganizationUser:

Represents an individual user within an organization.

id: str

The identifier, which can be referenced in API endpoints

added_at: int

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

formatunixtime
object: Literal["organization.user"]

The object type, which is always organization.user

api_key_last_used_at: Optional[int]

The Unix timestamp (in seconds) of the user’s last API key usage.

formatunixtime
created: Optional[int]

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

formatunixtime
developer_persona: Optional[str]

The developer persona metadata for the user.

email: Optional[str]

The email address of the user

is_default: Optional[bool]

Whether this is the organization’s default user.

is_scale_tier_authorized_purchaser: Optional[bool]

Whether the user is an authorized purchaser for Scale Tier.

is_scim_managed: Optional[bool]

Whether the user is managed through SCIM.

is_service_account: Optional[bool]

Whether the user is a service account.

name: Optional[str]

The name of the user

projects: Optional[Projects]

Projects associated with the user, if included.

data: List[ProjectsData]
id: Optional[str]
name: Optional[str]
role: Optional[str]
object: Literal["list"]
role: Optional[str]

owner or reader

technical_level: Optional[str]

The technical level metadata for the user.

user: Optional[User]

Nested user details.

id: str
object: Literal["user"]
banned: Optional[bool]
banned_at: Optional[int]
formatunixtime
email: Optional[str]
enabled: Optional[bool]
name: Optional[str]
picture: Optional[str]
class UserDeleteResponse:
id: str
deleted: bool
object: Literal["organization.user.deleted"]

OrganizationUsersRoles

List user organization role assignments
admin.organization.users.roles.list(struser_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/organization/users/{user_id}/roles
Assign organization role to user
admin.organization.users.roles.create(struser_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/organization/users/{user_id}/roles
Unassign organization role from user
admin.organization.users.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/organization/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.

OrganizationGroups

List groups
admin.organization.groups.list(GroupListParams**kwargs) -> SyncNextCursorPage[Group]
GET/organization/groups
Create group
admin.organization.groups.create(GroupCreateParams**kwargs) -> Group
POST/organization/groups
Update group
admin.organization.groups.update(strgroup_id, GroupUpdateParams**kwargs) -> GroupUpdateResponse
POST/organization/groups/{group_id}
Delete group
admin.organization.groups.delete(strgroup_id) -> GroupDeleteResponse
DELETE/organization/groups/{group_id}
ModelsExpand Collapse
class Group:

Details about an organization group.

id: str

Identifier for the group.

created_at: int

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

formatunixtime
group_type: str

The type of the group.

is_scim_managed: bool

Whether the group is managed through SCIM and controlled by your identity provider.

name: str

Display name of the group.

class GroupUpdateResponse:

Response returned after updating a group.

id: str

Identifier for the group.

created_at: int

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

formatunixtime
is_scim_managed: bool

Whether the group is managed through SCIM and controlled by your identity provider.

name: str

Updated display name for the group.

class GroupDeleteResponse:

Confirmation payload returned after deleting a group.

id: str

Identifier of the deleted group.

deleted: bool

Whether the group was deleted.

object: Literal["group.deleted"]

Always group.deleted.

OrganizationGroupsUsers

List group users
admin.organization.groups.users.list(strgroup_id, UserListParams**kwargs) -> SyncNextCursorPage[OrganizationGroupUser]
GET/organization/groups/{group_id}/users
Add group user
admin.organization.groups.users.create(strgroup_id, UserCreateParams**kwargs) -> UserCreateResponse
POST/organization/groups/{group_id}/users
Remove group user
admin.organization.groups.users.delete(struser_id, UserDeleteParams**kwargs) -> UserDeleteResponse
DELETE/organization/groups/{group_id}/users/{user_id}
ModelsExpand Collapse
class OrganizationGroupUser:

Represents an individual user returned when inspecting group membership.

id: str

The identifier, which can be referenced in API endpoints

email: Optional[str]

The email address of the user.

name: str

The name of the user.

class UserCreateResponse:

Confirmation payload returned after adding a user to a group.

group_id: str

Identifier of the group the user was added to.

object: Literal["group.user"]

Always group.user.

user_id: str

Identifier of the user that was added.

class UserDeleteResponse:

Confirmation payload returned after removing a user from a group.

deleted: bool

Whether the group membership was removed.

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

Always group.user.deleted.

OrganizationGroupsRoles

List group organization role assignments
admin.organization.groups.roles.list(strgroup_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/organization/groups/{group_id}/roles
Assign organization role to group
admin.organization.groups.roles.create(strgroup_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/organization/groups/{group_id}/roles
Unassign organization role from group
admin.organization.groups.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/organization/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.

OrganizationRoles

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

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

id: str

Identifier for the role.

description: Optional[str]

Optional description of the role.

name: str

Unique name for the role.

object: Literal["role"]

Always role.

permissions: List[str]

Permissions granted by the role.

predefined_role: bool

Whether the role is predefined and managed by OpenAI.

resource_type: str

Resource type the role is bound to (for example api.organization or api.project).

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.

OrganizationCertificates

List organization certificates
admin.organization.certificates.list(CertificateListParams**kwargs) -> SyncConversationCursorPage[CertificateListResponse]
GET/organization/certificates
Upload certificate
admin.organization.certificates.create(CertificateCreateParams**kwargs) -> Certificate
POST/organization/certificates
Get certificate
admin.organization.certificates.retrieve(strcertificate_id, CertificateRetrieveParams**kwargs) -> Certificate
GET/organization/certificates/{certificate_id}
Modify certificate
admin.organization.certificates.update(strcertificate_id, CertificateUpdateParams**kwargs) -> Certificate
POST/organization/certificates/{certificate_id}
Delete certificate
admin.organization.certificates.delete(strcertificate_id) -> CertificateDeleteResponse
DELETE/organization/certificates/{certificate_id}
Activate certificates for organization
admin.organization.certificates.activate(CertificateActivateParams**kwargs) -> SyncPage[CertificateActivateResponse]
POST/organization/certificates/activate
Deactivate certificates for organization
admin.organization.certificates.deactivate(CertificateDeactivateParams**kwargs) -> SyncPage[CertificateDeactivateResponse]
POST/organization/certificates/deactivate
ModelsExpand Collapse
class Certificate:

Represents an individual certificate uploaded to the organization.

id: str

The identifier, which can be referenced in API endpoints

certificate_details: CertificateDetails
content: Optional[str]

The content of the certificate in PEM format.

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["certificate", "organization.certificate", "organization.project.certificate"]

The object type.

  • If creating, updating, or getting a specific certificate, the object type is certificate.
  • If listing, activating, or deactivating certificates for the organization, the object type is organization.certificate.
  • If listing, activating, or deactivating certificates for a project, the object type is organization.project.certificate.
One of the following:
"certificate"
"organization.certificate"
"organization.project.certificate"
active: Optional[bool]

Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.

class CertificateListResponse:

Represents an individual certificate configured at the organization level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the organization 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.certificate"]

The object type, which is always organization.certificate.

class CertificateDeleteResponse:
id: str

The ID of the certificate that was deleted.

object: Literal["certificate.deleted"]

The object type, must be certificate.deleted.

class CertificateActivateResponse:

Represents an individual certificate configured at the organization level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the organization 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.certificate"]

The object type, which is always organization.certificate.

class CertificateDeactivateResponse:

Represents an individual certificate configured at the organization level.

id: str

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the organization 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.certificate"]

The object type, which is always organization.certificate.

OrganizationProjects

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

OrganizationProjectsUsers

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"]

OrganizationProjectsUsersRoles

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.

OrganizationProjectsService 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"]

OrganizationProjectsAPI 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"]

OrganizationProjectsRate 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.

OrganizationProjectsGroups

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.

OrganizationProjectsGroupsRoles

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.

OrganizationProjectsRoles

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.

OrganizationProjectsCertificates

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.