Admin
Organization
Audit Logs
List audit logs
$ openai admin:organization:audit-logs list
get /organization/audit_logs
List user actions and configuration changes within this organization.
Parameters
-
--actor-email: optional array of stringReturn only events performed by users with these emails.
-
--actor-id: optional array of stringReturn only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--before: optional stringA cursor for use in pagination.
beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. -
--effective-at: optional object { gt, gte, lt, lte }Return only events whose
effective_at(Unix seconds) is in this range. -
--event-type: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 48 moreReturn only events with a
typein one of these values. For example,project.created. For all options, see the documentation for the audit log object. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
-
--project-id: optional array of stringReturn only events for these projects.
-
--resource-id: optional array of stringReturn only events performed on these targets. For example, a project ID updated.
Returns
-
ListAuditLogsResponse: object { data, has_more, object, 2 more }-
data: array of object { id, effective_at, type, 49 more }-
id: stringThe ID of this log.
-
effective_at: numberThe Unix timestamp (in seconds) of the event.
-
type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 48 moreThe event type.
-
"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 object { api_key, session, type }The actor who performed the audit logged action.
-
api_key: optional object { id, service_account, type, user }The API Key used to perform the audit logged action.
-
id: optional stringThe tracking id of the API key.
-
service_account: optional object { id }The service account that performed the audit logged action.
-
id: optional stringThe service account id.
-
-
type: optional "user" or "service_account"The type of API key. Can be either
userorservice_account.-
"user" -
"service_account"
-
-
user: optional object { id, email }The user who performed the audit logged action.
-
id: optional stringThe user id.
-
email: optional stringThe user email.
-
-
-
session: optional object { ip_address, user }The session in which the audit logged action was performed.
-
ip_address: optional stringThe IP address from which the action was performed.
-
user: optional object { id, email }The user who performed the audit logged action.
-
id: optional stringThe user id.
-
email: optional stringThe user email.
-
-
-
type: optional "session" or "api_key"The type of actor. Is either
sessionorapi_key.-
"session" -
"api_key"
-
-
-
api_key.created: optional object { id, data }The details for events with this
type.-
id: optional stringThe tracking ID of the API key.
-
data: optional object { scopes }The payload used to create the API key.
-
scopes: optional array of stringA list of scopes allowed for the API key, e.g.
["api.model.request"]
-
-
-
api_key.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe tracking ID of the API key.
-
-
api_key.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe tracking ID of the API key.
-
changes_requested: optional object { scopes }The payload used to update the API key.
-
scopes: optional array of stringA list of scopes allowed for the API key, e.g.
["api.model.request"]
-
-
-
certificate.created: optional object { id, name }The details for events with this
type.-
id: optional stringThe certificate ID.
-
name: optional stringThe name of the certificate.
-
-
certificate.deleted: optional object { id, certificate, name }The details for events with this
type.-
id: optional stringThe certificate ID.
-
certificate: optional stringThe certificate content in PEM format.
-
name: optional stringThe name of the certificate.
-
-
certificate.updated: optional object { id, name }The details for events with this
type.-
id: optional stringThe certificate ID.
-
name: optional stringThe name of the certificate.
-
-
certificates.activated: optional object { certificates }The details for events with this
type.-
certificates: optional array of object { id, name }-
id: optional stringThe certificate ID.
-
name: optional stringThe name of the certificate.
-
-
-
certificates.deactivated: optional object { certificates }The details for events with this
type.-
certificates: optional array of object { id, name }-
id: optional stringThe certificate ID.
-
name: optional stringThe name of the certificate.
-
-
-
checkpoint.permission.created: optional object { id, data }The project and fine-tuned model checkpoint that the checkpoint permission was created for.
-
id: optional stringThe ID of the checkpoint permission.
-
data: optional object { fine_tuned_model_checkpoint, project_id }The payload used to create the checkpoint permission.
-
fine_tuned_model_checkpoint: optional stringThe ID of the fine-tuned model checkpoint.
-
project_id: optional stringThe ID of the project that the checkpoint permission was created for.
-
-
-
checkpoint.permission.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the checkpoint permission.
-
-
external_key.registered: optional object { id, data }The details for events with this
type.-
id: optional stringThe ID of the external key configuration.
-
data: optional unknownThe configuration for the external key.
-
-
external_key.removed: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the external key configuration.
-
-
group.created: optional object { id, data }The details for events with this
type.-
id: optional stringThe ID of the group.
-
data: optional object { group_name }Information about the created group.
-
group_name: optional stringThe group name.
-
-
-
group.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the group.
-
-
group.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe ID of the group.
-
changes_requested: optional object { group_name }The payload used to update the group.
-
group_name: optional stringThe updated group name.
-
-
-
invite.accepted: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the invite.
-
-
invite.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the invite.
-
-
invite.sent: optional object { id, data }The details for events with this
type.-
id: optional stringThe ID of the invite.
-
data: optional object { email, role }The payload used to create the invite.
-
email: optional stringThe email invited to the organization.
-
role: optional stringThe role the email was invited to be. Is either
ownerormember.
-
-
-
ip_allowlist.config.activated: optional object { configs }The details for events with this
type.-
configs: optional array of object { id, name }The configurations that were activated.
-
id: optional stringThe ID of the IP allowlist configuration.
-
name: optional stringThe name of the IP allowlist configuration.
-
-
-
ip_allowlist.config.deactivated: optional object { configs }The details for events with this
type.-
configs: optional array of object { id, name }The configurations that were deactivated.
-
id: optional stringThe ID of the IP allowlist configuration.
-
name: optional stringThe name of the IP allowlist configuration.
-
-
-
ip_allowlist.created: optional object { id, allowed_ips, name }The details for events with this
type.-
id: optional stringThe ID of the IP allowlist configuration.
-
allowed_ips: optional array of stringThe IP addresses or CIDR ranges included in the configuration.
-
name: optional stringThe name of the IP allowlist configuration.
-
-
ip_allowlist.deleted: optional object { id, allowed_ips, name }The details for events with this
type.-
id: optional stringThe ID of the IP allowlist configuration.
-
allowed_ips: optional array of stringThe IP addresses or CIDR ranges that were in the configuration.
-
name: optional stringThe name of the IP allowlist configuration.
-
-
ip_allowlist.updated: optional object { id, allowed_ips }The details for events with this
type.-
id: optional stringThe ID of the IP allowlist configuration.
-
allowed_ips: optional array of stringThe updated set of IP addresses or CIDR ranges in the configuration.
-
-
login.failed: optional object { error_code, error_message }The details for events with this
type.-
error_code: optional stringThe error code of the failure.
-
error_message: optional stringThe error message of the failure.
-
-
login.succeeded: optional unknownThis event has no additional fields beyond the standard audit log attributes.
-
logout.failed: optional object { error_code, error_message }The details for events with this
type.-
error_code: optional stringThe error code of the failure.
-
error_message: optional stringThe error message of the failure.
-
-
logout.succeeded: optional unknownThis event has no additional fields beyond the standard audit log attributes.
-
organization.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe organization ID.
-
changes_requested: optional object { api_call_logging, api_call_logging_project_ids, description, 4 more }The payload used to update the organization settings.
-
api_call_logging: optional stringHow your organization logs data from supported API calls. One of
disabled,enabled_per_call,enabled_for_all_projects, orenabled_for_selected_projects -
api_call_logging_project_ids: optional stringThe list of project ids if api_call_logging is set to
enabled_for_selected_projects -
description: optional stringThe organization description.
-
name: optional stringThe organization name.
-
threads_ui_visibility: optional stringVisibility of the threads page which shows messages created with the Assistants API and Playground. One of
ANY_ROLE,OWNERS, orNONE. -
title: optional stringThe organization title.
-
usage_dashboard_visibility: optional stringVisibility of the usage dashboard which shows activity and costs for your organization. One of
ANY_ROLEorOWNERS.
-
-
-
project: optional object { id, name }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 stringThe project ID.
-
name: optional stringThe project title.
-
-
project.archived: optional object { id }The details for events with this
type.-
id: optional stringThe project ID.
-
-
project.created: optional object { id, data }The details for events with this
type.-
id: optional stringThe project ID.
-
data: optional object { name, title }The payload used to create the project.
-
name: optional stringThe project name.
-
title: optional stringThe title of the project as seen on the dashboard.
-
-
-
project.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe project ID.
-
-
project.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe project ID.
-
changes_requested: optional object { title }The payload used to update the project.
-
title: optional stringThe title of the project as seen on the dashboard.
-
-
-
rate_limit.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe rate limit ID
-
-
rate_limit.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe rate limit ID
-
changes_requested: optional object { batch_1_day_max_input_tokens, max_audio_megabytes_per_1_minute, max_images_per_1_minute, 3 more }The payload used to update the rate limits.
-
batch_1_day_max_input_tokens: optional numberThe maximum batch input tokens per day. Only relevant for certain models.
-
max_audio_megabytes_per_1_minute: optional numberThe maximum audio megabytes per minute. Only relevant for certain models.
-
max_images_per_1_minute: optional numberThe maximum images per minute. Only relevant for certain models.
-
max_requests_per_1_day: optional numberThe maximum requests per day. Only relevant for certain models.
-
max_requests_per_1_minute: optional numberThe maximum requests per minute.
-
max_tokens_per_1_minute: optional numberThe maximum tokens per minute.
-
-
-
role.assignment.created: optional object { id, principal_id, principal_type, 2 more }The details for events with this
type.-
id: optional stringThe identifier of the role assignment.
-
principal_id: optional stringThe principal (user or group) that received the role.
-
principal_type: optional stringThe type of principal (user or group) that received the role.
-
resource_id: optional stringThe resource the role assignment is scoped to.
-
resource_type: optional stringThe type of resource the role assignment is scoped to.
-
-
role.assignment.deleted: optional object { id, principal_id, principal_type, 2 more }The details for events with this
type.-
id: optional stringThe identifier of the role assignment.
-
principal_id: optional stringThe principal (user or group) that had the role removed.
-
principal_type: optional stringThe type of principal (user or group) that had the role removed.
-
resource_id: optional stringThe resource the role assignment was scoped to.
-
resource_type: optional stringThe type of resource the role assignment was scoped to.
-
-
role.created: optional object { id, permissions, resource_id, 2 more }The details for events with this
type.-
id: optional stringThe role ID.
-
permissions: optional array of stringThe permissions granted by the role.
-
resource_id: optional stringThe resource the role is scoped to.
-
resource_type: optional stringThe type of resource the role belongs to.
-
role_name: optional stringThe name of the role.
-
-
role.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe role ID.
-
-
role.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe role ID.
-
changes_requested: optional object { description, metadata, permissions_added, 4 more }The payload used to update the role.
-
description: optional stringThe updated role description, when provided.
-
metadata: optional unknownAdditional metadata stored on the role.
-
permissions_added: optional array of stringThe permissions added to the role.
-
permissions_removed: optional array of stringThe permissions removed from the role.
-
resource_id: optional stringThe resource the role is scoped to.
-
resource_type: optional stringThe type of resource the role belongs to.
-
role_name: optional stringThe updated role name, when provided.
-
-
-
scim.disabled: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the SCIM was disabled for.
-
-
scim.enabled: optional object { id }The details for events with this
type.-
id: optional stringThe ID of the SCIM was enabled for.
-
-
service_account.created: optional object { id, data }The details for events with this
type.-
id: optional stringThe service account ID.
-
data: optional object { role }The payload used to create the service account.
-
role: optional stringThe role of the service account. Is either
ownerormember.
-
-
-
service_account.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe service account ID.
-
-
service_account.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe service account ID.
-
changes_requested: optional object { role }The payload used to updated the service account.
-
role: optional stringThe role of the service account. Is either
ownerormember.
-
-
-
user.added: optional object { id, data }The details for events with this
type.-
id: optional stringThe user ID.
-
data: optional object { role }The payload used to add the user to the project.
-
role: optional stringThe role of the user. Is either
ownerormember.
-
-
-
user.deleted: optional object { id }The details for events with this
type.-
id: optional stringThe user ID.
-
-
user.updated: optional object { id, changes_requested }The details for events with this
type.-
id: optional stringThe project ID.
-
changes_requested: optional object { role }The payload used to update the user.
-
role: optional stringThe role of the user. Is either
ownerormember.
-
-
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:audit-logs list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"effective_at": 0,
"type": "api_key.created",
"actor": {
"api_key": {
"id": "id",
"service_account": {
"id": "id"
},
"type": "user",
"user": {
"id": "id",
"email": "email"
}
},
"session": {
"ip_address": "ip_address",
"user": {
"id": "id",
"email": "email"
}
},
"type": "session"
},
"api_key.created": {
"id": "id",
"data": {
"scopes": [
"string"
]
}
},
"api_key.deleted": {
"id": "id"
},
"api_key.updated": {
"id": "id",
"changes_requested": {
"scopes": [
"string"
]
}
},
"certificate.created": {
"id": "id",
"name": "name"
},
"certificate.deleted": {
"id": "id",
"certificate": "certificate",
"name": "name"
},
"certificate.updated": {
"id": "id",
"name": "name"
},
"certificates.activated": {
"certificates": [
{
"id": "id",
"name": "name"
}
]
},
"certificates.deactivated": {
"certificates": [
{
"id": "id",
"name": "name"
}
]
},
"checkpoint.permission.created": {
"id": "id",
"data": {
"fine_tuned_model_checkpoint": "fine_tuned_model_checkpoint",
"project_id": "project_id"
}
},
"checkpoint.permission.deleted": {
"id": "id"
},
"external_key.registered": {
"id": "id",
"data": {}
},
"external_key.removed": {
"id": "id"
},
"group.created": {
"id": "id",
"data": {
"group_name": "group_name"
}
},
"group.deleted": {
"id": "id"
},
"group.updated": {
"id": "id",
"changes_requested": {
"group_name": "group_name"
}
},
"invite.accepted": {
"id": "id"
},
"invite.deleted": {
"id": "id"
},
"invite.sent": {
"id": "id",
"data": {
"email": "email",
"role": "role"
}
},
"ip_allowlist.config.activated": {
"configs": [
{
"id": "id",
"name": "name"
}
]
},
"ip_allowlist.config.deactivated": {
"configs": [
{
"id": "id",
"name": "name"
}
]
},
"ip_allowlist.created": {
"id": "id",
"allowed_ips": [
"string"
],
"name": "name"
},
"ip_allowlist.deleted": {
"id": "id",
"allowed_ips": [
"string"
],
"name": "name"
},
"ip_allowlist.updated": {
"id": "id",
"allowed_ips": [
"string"
]
},
"login.failed": {
"error_code": "error_code",
"error_message": "error_message"
},
"login.succeeded": {},
"logout.failed": {
"error_code": "error_code",
"error_message": "error_message"
},
"logout.succeeded": {},
"organization.updated": {
"id": "id",
"changes_requested": {
"api_call_logging": "api_call_logging",
"api_call_logging_project_ids": "api_call_logging_project_ids",
"description": "description",
"name": "name",
"threads_ui_visibility": "threads_ui_visibility",
"title": "title",
"usage_dashboard_visibility": "usage_dashboard_visibility"
}
},
"project": {
"id": "id",
"name": "name"
},
"project.archived": {
"id": "id"
},
"project.created": {
"id": "id",
"data": {
"name": "name",
"title": "title"
}
},
"project.deleted": {
"id": "id"
},
"project.updated": {
"id": "id",
"changes_requested": {
"title": "title"
}
},
"rate_limit.deleted": {
"id": "id"
},
"rate_limit.updated": {
"id": "id",
"changes_requested": {
"batch_1_day_max_input_tokens": 0,
"max_audio_megabytes_per_1_minute": 0,
"max_images_per_1_minute": 0,
"max_requests_per_1_day": 0,
"max_requests_per_1_minute": 0,
"max_tokens_per_1_minute": 0
}
},
"role.assignment.created": {
"id": "id",
"principal_id": "principal_id",
"principal_type": "principal_type",
"resource_id": "resource_id",
"resource_type": "resource_type"
},
"role.assignment.deleted": {
"id": "id",
"principal_id": "principal_id",
"principal_type": "principal_type",
"resource_id": "resource_id",
"resource_type": "resource_type"
},
"role.created": {
"id": "id",
"permissions": [
"string"
],
"resource_id": "resource_id",
"resource_type": "resource_type",
"role_name": "role_name"
},
"role.deleted": {
"id": "id"
},
"role.updated": {
"id": "id",
"changes_requested": {
"description": "description",
"metadata": {},
"permissions_added": [
"string"
],
"permissions_removed": [
"string"
],
"resource_id": "resource_id",
"resource_type": "resource_type",
"role_name": "role_name"
}
},
"scim.disabled": {
"id": "id"
},
"scim.enabled": {
"id": "id"
},
"service_account.created": {
"id": "id",
"data": {
"role": "role"
}
},
"service_account.deleted": {
"id": "id"
},
"service_account.updated": {
"id": "id",
"changes_requested": {
"role": "role"
}
},
"user.added": {
"id": "id",
"data": {
"role": "role"
}
},
"user.deleted": {
"id": "id"
},
"user.updated": {
"id": "id",
"changes_requested": {
"role": "role"
}
}
}
],
"has_more": true,
"object": "list",
"first_id": "audit_log-defb456h8dks",
"last_id": "audit_log-hnbkd8s93s"
}
Admin API Keys
List all organization and project API keys.
$ openai admin:organization:admin-api-keys list
get /organization/admin_api_keys
List organization API keys
Parameters
-
--after: optional stringReturn keys with IDs that come after this ID in the pagination order.
-
--limit: optional numberMaximum number of keys to return.
-
--order: optional "asc" or "desc"Order results by creation time, ascending or descending.
Returns
-
ApiKeyList: object { data, has_more, object, 2 more }-
data: array of AdminAPIKey-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
object: "organization.admin_api_key"The object type, which is always
organization.admin_api_key -
owner: object { id, created_at, name, 3 more }-
id: optional stringThe identifier, which can be referenced in API endpoints
-
created_at: optional numberThe Unix timestamp (in seconds) of when the user was created
-
name: optional stringThe name of the user
-
object: optional stringThe object type, which is always organization.user
-
role: optional stringAlways
owner -
type: optional stringAlways
user
-
-
redacted_value: stringThe redacted value of the API key
-
last_used_at: optional numberThe Unix timestamp (in seconds) of when the API key was last used
-
name: optional stringThe name of the API key
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:admin-api-keys list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "key_abc",
"created_at": 1711471533,
"object": "organization.admin_api_key",
"owner": {
"id": "sa_456",
"created_at": 1711471533,
"name": "My Service Account",
"object": "organization.user",
"role": "owner",
"type": "user"
},
"redacted_value": "sk-admin...def",
"last_used_at": 1711471534,
"name": "Administration Key"
}
],
"has_more": false,
"object": "list",
"first_id": "key_abc",
"last_id": "key_xyz"
}
Create admin API key
$ openai admin:organization:admin-api-keys create
post /organization/admin_api_keys
Create an organization admin API key
Parameters
--name: string
Returns
-
AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKeyRepresents an individual Admin API key in an org.
-
value: stringThe value of the API key. Only shown on create.
-
Example
openai admin:organization:admin-api-keys create \
--admin-api-key 'My Admin API Key' \
--name 'New Admin Key'
Response
{
"id": "key_abc",
"created_at": 1711471533,
"object": "organization.admin_api_key",
"owner": {
"id": "sa_456",
"created_at": 1711471533,
"name": "My Service Account",
"object": "organization.user",
"role": "owner",
"type": "user"
},
"redacted_value": "sk-admin...def",
"last_used_at": 1711471534,
"name": "Administration Key",
"value": "sk-admin-1234abcd"
}
Retrieve admin API key
$ openai admin:organization:admin-api-keys retrieve
get /organization/admin_api_keys/{key_id}
Retrieve a single organization API key
Parameters
-
--key-id: stringThe ID of the API key.
Returns
-
admin_api_key: object { id, created_at, object, 4 more }Represents an individual Admin API key in an org.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
object: "organization.admin_api_key"The object type, which is always
organization.admin_api_key -
owner: object { id, created_at, name, 3 more }-
id: optional stringThe identifier, which can be referenced in API endpoints
-
created_at: optional numberThe Unix timestamp (in seconds) of when the user was created
-
name: optional stringThe name of the user
-
object: optional stringThe object type, which is always organization.user
-
role: optional stringAlways
owner -
type: optional stringAlways
user
-
-
redacted_value: stringThe redacted value of the API key
-
last_used_at: optional numberThe Unix timestamp (in seconds) of when the API key was last used
-
name: optional stringThe name of the API key
-
Example
openai admin:organization:admin-api-keys retrieve \
--admin-api-key 'My Admin API Key' \
--key-id key_id
Response
{
"id": "key_abc",
"created_at": 1711471533,
"object": "organization.admin_api_key",
"owner": {
"id": "sa_456",
"created_at": 1711471533,
"name": "My Service Account",
"object": "organization.user",
"role": "owner",
"type": "user"
},
"redacted_value": "sk-admin...def",
"last_used_at": 1711471534,
"name": "Administration Key"
}
Delete admin API key
$ openai admin:organization:admin-api-keys delete
delete /organization/admin_api_keys/{key_id}
Delete an organization admin API key
Parameters
-
--key-id: stringThe ID of the API key to be deleted.
Returns
-
AdminOrganizationAdminAPIKeyDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.admin_api_key.deleted"
-
Example
openai admin:organization:admin-api-keys delete \
--admin-api-key 'My Admin API Key' \
--key-id key_id
Response
{
"id": "key_abc",
"deleted": true,
"object": "organization.admin_api_key.deleted"
}
Domain Types
Admin API Key
-
admin_api_key: object { id, created_at, object, 4 more }Represents an individual Admin API key in an org.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
object: "organization.admin_api_key"The object type, which is always
organization.admin_api_key -
owner: object { id, created_at, name, 3 more }-
id: optional stringThe identifier, which can be referenced in API endpoints
-
created_at: optional numberThe Unix timestamp (in seconds) of when the user was created
-
name: optional stringThe name of the user
-
object: optional stringThe object type, which is always organization.user
-
role: optional stringAlways
owner -
type: optional stringAlways
user
-
-
redacted_value: stringThe redacted value of the API key
-
last_used_at: optional numberThe Unix timestamp (in seconds) of when the API key was last used
-
name: optional stringThe name of the API key
-
Usage
Audio speeches
$ openai admin:organization:usage audio-speeches
get /organization/usage/audio_speeches
Get audio speeches usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or "model"Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,modelor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageAudioSpeechesResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage audio-speeches \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Audio transcriptions
$ openai admin:organization:usage audio-transcriptions
get /organization/usage/audio_transcriptions
Get audio transcriptions usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or "model"Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,modelor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageAudioTranscriptionsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage audio-transcriptions \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Code interpreter sessions
$ openai admin:organization:usage code-interpreter-sessions
get /organization/usage/code_interpreter_sessions
Get code interpreter sessions usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id"Group the usage data by the specified fields. Support fields include
project_id. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
Returns
-
AdminOrganizationUsageCodeInterpreterSessionsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage code-interpreter-sessions \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Completions
$ openai admin:organization:usage completions
get /organization/usage/completions
Get completions usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--batch: optional booleanIf
true, return batch jobs only. Iffalse, return non-batch jobs only. By default, return both. -
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or 3 moreGroup the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,model,batch,service_tieror any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageCompletionsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage completions \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Embeddings
$ openai admin:organization:usage embeddings
get /organization/usage/embeddings
Get embeddings usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or "model"Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,modelor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageEmbeddingsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage embeddings \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Images
$ openai admin:organization:usage images
get /organization/usage/images
Get images usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or 3 moreGroup the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,model,size,sourceor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--size: optional array of "256x256" or "512x512" or "1024x1024" or 2 moreReturn only usages for these image sizes. Possible values are
256x256,512x512,1024x1024,1792x1792,1024x1792or any combination of them. -
--source: optional array of "image.generation" or "image.edit" or "image.variation"Return only usages for these sources. Possible values are
image.generation,image.edit,image.variationor any combination of them. -
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageImagesResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage images \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Moderations
$ openai admin:organization:usage moderations
get /organization/usage/moderations
Get moderations usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or "model"Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,modelor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageModerationsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage moderations \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Vector stores
$ openai admin:organization:usage vector-stores
get /organization/usage/vector_stores
Get vector stores usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id"Group the usage data by the specified fields. Support fields include
project_id. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
Returns
-
AdminOrganizationUsageVectorStoresResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage vector-stores \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
File search calls
$ openai admin:organization:usage file-search-calls
get /organization/usage/file_search_calls
Get file search calls usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or "vector_store_id"Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,vector_store_idor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
-
--vector-store-id: optional array of stringReturn only usage for these vector stores.
Returns
-
AdminOrganizationUsageFileSearchCallsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage file-search-calls \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Web search calls
$ openai admin:organization:usage web-search-calls
get /organization/usage/web_search_calls
Get web search calls usage details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only usage for these API keys.
-
--bucket-width: optional "1m" or "1h" or "1d"Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d. -
--context-level: optional array of "low" or "medium" or "high"Return only web search usage for these context levels.
-
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "user_id" or "api_key_id" or 2 moreGroup the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,model,context_levelor any combination of them. -
--limit: optional numberSpecifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
-
--model: optional array of stringReturn only usage for these models.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only usage for these projects.
-
--user-id: optional array of stringReturn only usage for these users.
Returns
-
AdminOrganizationUsageWebSearchCallsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage web-search-calls \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Costs
$ openai admin:organization:usage costs
get /organization/costs
Get costs details for the organization.
Parameters
-
--start-time: numberStart time (Unix seconds) of the query time range, inclusive.
-
--api-key-id: optional array of stringReturn only costs for these API keys.
-
--bucket-width: optional "1d"Width of each time bucket in response. Currently only
1dis supported, default to1d. -
--end-time: optional numberEnd time (Unix seconds) of the query time range, exclusive.
-
--group-by: optional array of "project_id" or "line_item" or "api_key_id"Group the costs by the specified fields. Support fields include
project_id,line_item,api_key_idand any combination of them. -
--limit: optional numberA limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7.
-
--page: optional stringA cursor for use in pagination. Corresponding to the
next_pagefield from the previous response. -
--project-id: optional array of stringReturn only costs for these projects.
Returns
-
AdminOrganizationUsageCostsResponse: object { data, has_more, next_page, object }-
data: array of object { end_time, object, results, start_time }-
end_time: number -
object: "bucket" -
results: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 8 more-
organization.usage.completions.result: object { input_tokens, num_model_requests, object, 10 more }The aggregated completions usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.completions.result" -
output_tokens: numberThe aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
batch: optional booleanWhen
group_by=batch, this field tells whether the grouped usage result is batch or not. -
input_audio_tokens: optional numberThe aggregated number of audio input tokens used, including cached tokens.
-
input_cached_tokens: optional numberThe 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 stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
output_audio_tokens: optional numberThe aggregated number of audio output tokens used.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
service_tier: optional stringWhen
group_by=service_tier, this field provides the service tier of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.embeddings.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated embeddings usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.embeddings.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.moderations.result: object { input_tokens, num_model_requests, object, 4 more }The aggregated moderations usage details of the specific time bucket.
-
input_tokens: numberThe aggregated number of input tokens used.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.moderations.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.images.result: object { images, num_model_requests, object, 6 more }The aggregated images usage details of the specific time bucket.
-
images: numberThe number of images processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.images.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
size: optional stringWhen
group_by=size, this field provides the image size of the grouped usage result. -
source: optional stringWhen
group_by=source, this field provides the source of the grouped usage result, possible values areimage.generation,image.edit,image.variation. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_speeches.result: object { characters, num_model_requests, object, 4 more }The aggregated audio speeches usage details of the specific time bucket.
-
characters: numberThe number of characters processed.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_speeches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.audio_transcriptions.result: object { num_model_requests, object, seconds, 4 more }The aggregated audio transcriptions usage details of the specific time bucket.
-
num_model_requests: numberThe count of requests made to the model.
-
object: "organization.usage.audio_transcriptions.result" -
seconds: numberThe number of seconds processed.
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.usage.vector_stores.result: object { object, usage_bytes, project_id }The aggregated vector stores usage details of the specific time bucket.
-
object: "organization.usage.vector_stores.result" -
usage_bytes: numberThe vector stores usage in bytes.
-
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.code_interpreter_sessions.result: object { num_sessions, object, project_id }The aggregated code interpreter sessions usage details of the specific time bucket.
-
num_sessions: numberThe number of code interpreter sessions.
-
object: "organization.usage.code_interpreter_sessions.result" -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result.
-
-
organization.usage.file_searches.result: object { num_requests, object, api_key_id, 3 more }The aggregated file search calls usage details of the specific time bucket.
-
num_requests: numberThe count of file search calls.
-
object: "organization.usage.file_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result. -
vector_store_id: optional stringWhen
group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.
-
-
organization.usage.web_searches.result: object { num_model_requests, num_requests, object, 5 more }The aggregated web search calls usage details of the specific time bucket.
-
num_model_requests: numberThe count of model requests.
-
num_requests: numberThe count of web search calls.
-
object: "organization.usage.web_searches.result" -
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API key ID of the grouped usage result. -
context_level: optional stringWhen
group_by=context_level, this field provides the search context size of the grouped usage result. -
model: optional stringWhen
group_by=model, this field provides the model name of the grouped usage result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped usage result. -
user_id: optional stringWhen
group_by=user_id, this field provides the user ID of the grouped usage result.
-
-
organization.costs.result: object { object, amount, api_key_id, 3 more }The aggregated costs details of the specific time bucket.
-
object: "organization.costs.result" -
amount: optional object { currency, value }The monetary value in its associated currency.
-
currency: optional stringLowercase ISO-4217 currency e.g. "usd"
-
value: optional numberThe numeric value of the cost.
-
-
api_key_id: optional stringWhen
group_by=api_key_id, this field provides the API Key ID of the grouped costs result. -
line_item: optional stringWhen
group_by=line_item, this field provides the line item of the grouped costs result. -
project_id: optional stringWhen
group_by=project_id, this field provides the project ID of the grouped costs result. -
quantity: optional numberWhen
group_by=line_item, this field provides the quantity of the grouped costs result.
-
-
-
start_time: number
-
-
has_more: boolean -
next_page: string -
object: "page"
-
Example
openai admin:organization:usage costs \
--admin-api-key 'My Admin API Key' \
--start-time 0
Response
{
"data": [
{
"end_time": 0,
"object": "bucket",
"results": [
{
"input_tokens": 0,
"num_model_requests": 0,
"object": "organization.usage.completions.result",
"output_tokens": 0,
"api_key_id": "api_key_id",
"batch": true,
"input_audio_tokens": 0,
"input_cached_tokens": 0,
"model": "model",
"output_audio_tokens": 0,
"project_id": "project_id",
"service_tier": "service_tier",
"user_id": "user_id"
}
],
"start_time": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "page"
}
Invites
List invites
$ openai admin:organization:invites list
get /organization/invites
Returns a list of invites in the organization.
Parameters
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
InviteListResponse: object { data, has_more, object, 2 more }-
data: array of Invite-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the invite was sent.
-
email: stringThe email address of the individual to whom the invite was sent
-
object: "organization.invite"The object type, which is always
organization.invite -
projects: array of object { id, role }The projects that were granted membership upon acceptance of the invite.
-
id: stringProject's public ID
-
role: "member" or "owner"Project membership role
-
"member" -
"owner"
-
-
-
role: "owner" or "reader"ownerorreader-
"owner" -
"reader"
-
-
status: "accepted" or "expired" or "pending"accepted,expired, orpending-
"accepted" -
"expired" -
"pending"
-
-
accepted_at: optional numberThe Unix timestamp (in seconds) of when the invite was accepted.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the invite expires.
-
-
has_more: booleanThe
has_moreproperty is used for pagination to indicate there are additional results. -
object: "list"The object type, which is always
list -
first_id: optional stringThe first
invite_idin the retrievedlist -
last_id: optional stringThe last
invite_idin the retrievedlist
-
Example
openai admin:organization:invites list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"email": "email",
"object": "organization.invite",
"projects": [
{
"id": "id",
"role": "member"
}
],
"role": "owner",
"status": "accepted",
"accepted_at": 0,
"expires_at": 0
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Create invite
$ openai admin:organization:invites create
post /organization/invites
Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.
Parameters
-
--email: stringSend an email to this address
-
--role: "reader" or "owner"ownerorreader -
--project: optional array of object { id, role }An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. If empty list is passed, the user will not be invited to any projects, including the default one.
Returns
-
invite: object { id, created_at, email, 6 more }Represents an individual
inviteto the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the invite was sent.
-
email: stringThe email address of the individual to whom the invite was sent
-
object: "organization.invite"The object type, which is always
organization.invite -
projects: array of object { id, role }The projects that were granted membership upon acceptance of the invite.
-
id: stringProject's public ID
-
role: "member" or "owner"Project membership role
-
"member" -
"owner"
-
-
-
role: "owner" or "reader"ownerorreader-
"owner" -
"reader"
-
-
status: "accepted" or "expired" or "pending"accepted,expired, orpending-
"accepted" -
"expired" -
"pending"
-
-
accepted_at: optional numberThe Unix timestamp (in seconds) of when the invite was accepted.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the invite expires.
-
Example
openai admin:organization:invites create \
--admin-api-key 'My Admin API Key' \
--email email \
--role reader
Response
{
"id": "id",
"created_at": 0,
"email": "email",
"object": "organization.invite",
"projects": [
{
"id": "id",
"role": "member"
}
],
"role": "owner",
"status": "accepted",
"accepted_at": 0,
"expires_at": 0
}
Retrieve invite
$ openai admin:organization:invites retrieve
get /organization/invites/{invite_id}
Retrieves an invite.
Parameters
-
--invite-id: stringThe ID of the invite to retrieve.
Returns
-
invite: object { id, created_at, email, 6 more }Represents an individual
inviteto the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the invite was sent.
-
email: stringThe email address of the individual to whom the invite was sent
-
object: "organization.invite"The object type, which is always
organization.invite -
projects: array of object { id, role }The projects that were granted membership upon acceptance of the invite.
-
id: stringProject's public ID
-
role: "member" or "owner"Project membership role
-
"member" -
"owner"
-
-
-
role: "owner" or "reader"ownerorreader-
"owner" -
"reader"
-
-
status: "accepted" or "expired" or "pending"accepted,expired, orpending-
"accepted" -
"expired" -
"pending"
-
-
accepted_at: optional numberThe Unix timestamp (in seconds) of when the invite was accepted.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the invite expires.
-
Example
openai admin:organization:invites retrieve \
--admin-api-key 'My Admin API Key' \
--invite-id invite_id
Response
{
"id": "id",
"created_at": 0,
"email": "email",
"object": "organization.invite",
"projects": [
{
"id": "id",
"role": "member"
}
],
"role": "owner",
"status": "accepted",
"accepted_at": 0,
"expires_at": 0
}
Delete invite
$ openai admin:organization:invites delete
delete /organization/invites/{invite_id}
Delete an invite. If the invite has already been accepted, it cannot be deleted.
Parameters
-
--invite-id: stringThe ID of the invite to delete.
Returns
-
AdminOrganizationInviteDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.invite.deleted"The object type, which is always
organization.invite.deleted
-
Example
openai admin:organization:invites delete \
--admin-api-key 'My Admin API Key' \
--invite-id invite_id
Response
{
"id": "id",
"deleted": true,
"object": "organization.invite.deleted"
}
Domain Types
Invite
-
invite: object { id, created_at, email, 6 more }Represents an individual
inviteto the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the invite was sent.
-
email: stringThe email address of the individual to whom the invite was sent
-
object: "organization.invite"The object type, which is always
organization.invite -
projects: array of object { id, role }The projects that were granted membership upon acceptance of the invite.
-
id: stringProject's public ID
-
role: "member" or "owner"Project membership role
-
"member" -
"owner"
-
-
-
role: "owner" or "reader"ownerorreader-
"owner" -
"reader"
-
-
status: "accepted" or "expired" or "pending"accepted,expired, orpending-
"accepted" -
"expired" -
"pending"
-
-
accepted_at: optional numberThe Unix timestamp (in seconds) of when the invite was accepted.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the invite expires.
-
Users
List users
$ openai admin:organization:users list
get /organization/users
Lists all of the users in the organization.
Parameters
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--email: optional array of stringFilter by the email address of users.
-
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
UserListResponse: object { data, has_more, object, 2 more }-
data: array of OrganizationUser-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:users list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"added_at": 0,
"object": "organization.user",
"api_key_last_used_at": 0,
"created": 0,
"developer_persona": "developer_persona",
"email": "email",
"is_default": true,
"is_scale_tier_authorized_purchaser": true,
"is_scim_managed": true,
"is_service_account": true,
"name": "name",
"projects": {
"data": [
{
"id": "id",
"name": "name",
"role": "role"
}
],
"object": "list"
},
"role": "role",
"technical_level": "technical_level",
"user": {
"id": "id",
"object": "user",
"banned": true,
"banned_at": 0,
"email": "email",
"enabled": true,
"name": "name",
"picture": "picture"
}
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Retrieve user
$ openai admin:organization:users retrieve
get /organization/users/{user_id}
Retrieves a user by their identifier.
Parameters
-
--user-id: stringThe ID of the user.
Returns
-
organization_user: object { id, added_at, object, 13 more }Represents an individual
userwithin an organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
Example
openai admin:organization:users retrieve \
--admin-api-key 'My Admin API Key' \
--user-id user_id
Response
{
"id": "id",
"added_at": 0,
"object": "organization.user",
"api_key_last_used_at": 0,
"created": 0,
"developer_persona": "developer_persona",
"email": "email",
"is_default": true,
"is_scale_tier_authorized_purchaser": true,
"is_scim_managed": true,
"is_service_account": true,
"name": "name",
"projects": {
"data": [
{
"id": "id",
"name": "name",
"role": "role"
}
],
"object": "list"
},
"role": "role",
"technical_level": "technical_level",
"user": {
"id": "id",
"object": "user",
"banned": true,
"banned_at": 0,
"email": "email",
"enabled": true,
"name": "name",
"picture": "picture"
}
}
Modify user
$ openai admin:organization:users update
post /organization/users/{user_id}
Modifies a user's role in the organization.
Parameters
-
--user-id: stringThe ID of the user.
-
--developer-persona: optional stringDeveloper persona metadata.
-
--role: optional stringownerorreader -
--role-id: optional stringRole ID to assign to the user.
-
--technical-level: optional stringTechnical level metadata.
Returns
-
organization_user: object { id, added_at, object, 13 more }Represents an individual
userwithin an organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
Example
openai admin:organization:users update \
--admin-api-key 'My Admin API Key' \
--user-id user_id
Response
{
"id": "id",
"added_at": 0,
"object": "organization.user",
"api_key_last_used_at": 0,
"created": 0,
"developer_persona": "developer_persona",
"email": "email",
"is_default": true,
"is_scale_tier_authorized_purchaser": true,
"is_scim_managed": true,
"is_service_account": true,
"name": "name",
"projects": {
"data": [
{
"id": "id",
"name": "name",
"role": "role"
}
],
"object": "list"
},
"role": "role",
"technical_level": "technical_level",
"user": {
"id": "id",
"object": "user",
"banned": true,
"banned_at": 0,
"email": "email",
"enabled": true,
"name": "name",
"picture": "picture"
}
}
Delete user
$ openai admin:organization:users delete
delete /organization/users/{user_id}
Deletes a user from the organization.
Parameters
-
--user-id: stringThe ID of the user.
Returns
-
AdminOrganizationUserDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.user.deleted"
-
Example
openai admin:organization:users delete \
--admin-api-key 'My Admin API Key' \
--user-id user_id
Response
{
"id": "id",
"deleted": true,
"object": "organization.user.deleted"
}
Domain Types
Organization User
-
organization_user: object { id, added_at, object, 13 more }Represents an individual
userwithin an organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
Roles
List user organization role assignments
$ openai admin:organization:users:roles list
get /organization/users/{user_id}/roles
Lists the organization roles assigned to a user within the organization.
Parameters
-
--user-id: stringThe ID of the user to inspect.
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing organization roles. -
--limit: optional numberA limit on the number of organization role assignments to return.
-
--order: optional "asc" or "desc"Sort order for the returned organization roles.
Returns
-
RoleListResource: object { data, has_more, next, object }Paginated list of roles assigned to a principal.
-
data: array of object { id, created_at, created_by, 8 more }Role assignments returned in the current page.
-
id: stringIdentifier for the role.
-
created_at: numberWhen the role was created.
-
created_by: stringIdentifier of the actor who created the role.
-
created_by_user_obj: map[unknown]User details for the actor that created the role, when available.
-
description: stringDescription of the role.
-
metadata: map[unknown]Arbitrary metadata stored on the role.
-
name: stringName of the role.
-
permissions: array of stringPermissions associated with the role.
-
predefined_role: booleanWhether the role is predefined by OpenAI.
-
resource_type: stringResource type the role applies to.
-
updated_at: numberWhen the role was last updated.
-
-
has_more: booleanWhether additional assignments are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no more assignments. -
object: "list"Always
list.
-
Example
openai admin:organization:users:roles list \
--admin-api-key 'My Admin API Key' \
--user-id user_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"created_by": "created_by",
"created_by_user_obj": {
"foo": "bar"
},
"description": "description",
"metadata": {
"foo": "bar"
},
"name": "name",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type",
"updated_at": 0
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Assign organization role to user
$ openai admin:organization:users:roles create
post /organization/users/{user_id}/roles
Assigns an organization role to a user within the organization.
Parameters
-
--user-id: stringThe ID of the user that should receive the organization role.
-
--role-id: stringIdentifier of the role to assign.
Returns
-
AdminOrganizationUserRoleNewResponse: object { object, role, user }Role assignment linking a user to a role.
-
object: "user.role"Always
user.role. -
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
user: object { id, added_at, object, 13 more }Represents an individual
userwithin an organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
-
Example
openai admin:organization:users:roles create \
--admin-api-key 'My Admin API Key' \
--user-id user_id \
--role-id role_id
Response
{
"object": "user.role",
"role": {
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
},
"user": {
"id": "id",
"added_at": 0,
"object": "organization.user",
"api_key_last_used_at": 0,
"created": 0,
"developer_persona": "developer_persona",
"email": "email",
"is_default": true,
"is_scale_tier_authorized_purchaser": true,
"is_scim_managed": true,
"is_service_account": true,
"name": "name",
"projects": {
"data": [
{
"id": "id",
"name": "name",
"role": "role"
}
],
"object": "list"
},
"role": "role",
"technical_level": "technical_level",
"user": {
"id": "id",
"object": "user",
"banned": true,
"banned_at": 0,
"email": "email",
"enabled": true,
"name": "name",
"picture": "picture"
}
}
}
Unassign organization role from user
$ openai admin:organization:users:roles delete
delete /organization/users/{user_id}/roles/{role_id}
Unassigns an organization role from a user within the organization.
Parameters
-
--user-id: stringThe ID of the user to modify.
-
--role-id: stringThe ID of the organization role to remove from the user.
Returns
-
AdminOrganizationUserRoleDeleteResponse: object { deleted, object }Confirmation payload returned after unassigning a role.
-
deleted: booleanWhether the assignment was removed.
-
object: stringIdentifier for the deleted assignment, such as
group.role.deletedoruser.role.deleted.
-
Example
openai admin:organization:users:roles delete \
--admin-api-key 'My Admin API Key' \
--user-id user_id \
--role-id role_id
Response
{
"deleted": true,
"object": "object"
}
Groups
List groups
$ openai admin:organization:groups list
get /organization/groups
Lists all groups in the organization.
Parameters
-
--after: optional stringA cursor for use in pagination.
afteris a group ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with group_abc, your subsequent call can includeafter=group_abcin order to fetch the next page of the list. -
--limit: optional numberA limit on the number of groups to be returned. Limit can range between 0 and 1000, and the default is 100.
-
--order: optional "asc" or "desc"Specifies the sort order of the returned groups.
Returns
-
GroupListResource: object { data, has_more, next, object }Paginated list of organization groups.
-
data: array of GroupGroups returned in the current page.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
group_type: stringThe type of the group.
-
is_scim_managed: booleanWhether the group is managed through SCIM and controlled by your identity provider.
-
name: stringDisplay name of the group.
-
-
has_more: booleanWhether additional groups are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullif there are no more results. -
object: "list"Always
list.
-
Example
openai admin:organization:groups list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"group_type": "group_type",
"is_scim_managed": true,
"name": "name"
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Create group
$ openai admin:organization:groups create
post /organization/groups
Creates a new group in the organization.
Parameters
-
--name: stringHuman readable name for the group.
Returns
-
group: object { id, created_at, group_type, 2 more }Details about an organization group.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
group_type: stringThe type of the group.
-
is_scim_managed: booleanWhether the group is managed through SCIM and controlled by your identity provider.
-
name: stringDisplay name of the group.
-
Example
openai admin:organization:groups create \
--admin-api-key 'My Admin API Key' \
--name x
Response
{
"id": "id",
"created_at": 0,
"group_type": "group_type",
"is_scim_managed": true,
"name": "name"
}
Update group
$ openai admin:organization:groups update
post /organization/groups/{group_id}
Updates a group's information.
Parameters
-
--group-id: stringThe ID of the group to update.
-
--name: stringNew display name for the group.
Returns
-
AdminOrganizationGroupUpdateResponse: object { id, created_at, is_scim_managed, name }Response returned after updating a group.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
is_scim_managed: booleanWhether the group is managed through SCIM and controlled by your identity provider.
-
name: stringUpdated display name for the group.
-
Example
openai admin:organization:groups update \
--admin-api-key 'My Admin API Key' \
--group-id group_id \
--name x
Response
{
"id": "id",
"created_at": 0,
"is_scim_managed": true,
"name": "name"
}
Delete group
$ openai admin:organization:groups delete
delete /organization/groups/{group_id}
Deletes a group from the organization.
Parameters
-
--group-id: stringThe ID of the group to delete.
Returns
-
AdminOrganizationGroupDeleteResponse: object { id, deleted, object }Confirmation payload returned after deleting a group.
-
id: stringIdentifier of the deleted group.
-
deleted: booleanWhether the group was deleted.
-
object: "group.deleted"Always
group.deleted.
-
Example
openai admin:organization:groups delete \
--admin-api-key 'My Admin API Key' \
--group-id group_id
Response
{
"id": "id",
"deleted": true,
"object": "group.deleted"
}
Domain Types
Group
-
group: object { id, created_at, group_type, 2 more }Details about an organization group.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
group_type: stringThe type of the group.
-
is_scim_managed: booleanWhether the group is managed through SCIM and controlled by your identity provider.
-
name: stringDisplay name of the group.
-
Users
List group users
$ openai admin:organization:groups:users list
get /organization/groups/{group_id}/users
Lists the users assigned to a group.
Parameters
-
--group-id: stringThe ID of the group to inspect.
-
--after: optional stringA cursor for use in pagination. Provide the ID of the last user from the previous list response to retrieve the next page.
-
--limit: optional numberA limit on the number of users to be returned. Limit can range between 0 and 1000, and the default is 100.
-
--order: optional "asc" or "desc"Specifies the sort order of users in the list.
Returns
-
UserListResource: object { data, has_more, next, object }Paginated list of user objects returned when inspecting group membership.
-
data: array of OrganizationGroupUserUsers in the current page.
-
id: stringThe identifier, which can be referenced in API endpoints
-
email: stringThe email address of the user.
-
name: stringThe name of the user.
-
-
has_more: booleanWhether more users are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen no further users are available. -
object: "list"Always
list.
-
Example
openai admin:organization:groups:users list \
--admin-api-key 'My Admin API Key' \
--group-id group_id
Response
{
"data": [
{
"id": "id",
"email": "email",
"name": "name"
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Add group user
$ openai admin:organization:groups:users create
post /organization/groups/{group_id}/users
Adds a user to a group.
Parameters
-
--group-id: stringThe ID of the group to update.
-
--user-id: stringIdentifier of the user to add to the group.
Returns
-
AdminOrganizationGroupUserNewResponse: object { group_id, object, user_id }Confirmation payload returned after adding a user to a group.
-
group_id: stringIdentifier of the group the user was added to.
-
object: "group.user"Always
group.user. -
user_id: stringIdentifier of the user that was added.
-
Example
openai admin:organization:groups:users create \
--admin-api-key 'My Admin API Key' \
--group-id group_id \
--user-id user_id
Response
{
"group_id": "group_id",
"object": "group.user",
"user_id": "user_id"
}
Remove group user
$ openai admin:organization:groups:users delete
delete /organization/groups/{group_id}/users/{user_id}
Removes a user from a group.
Parameters
-
--group-id: stringThe ID of the group to update.
-
--user-id: stringThe ID of the user to remove from the group.
Returns
-
AdminOrganizationGroupUserDeleteResponse: object { deleted, object }Confirmation payload returned after removing a user from a group.
-
deleted: booleanWhether the group membership was removed.
-
object: "group.user.deleted"Always
group.user.deleted.
-
Example
openai admin:organization:groups:users delete \
--admin-api-key 'My Admin API Key' \
--group-id group_id \
--user-id user_id
Response
{
"deleted": true,
"object": "group.user.deleted"
}
Domain Types
Organization Group User
-
organization_group_user: object { id, email, name }Represents an individual user returned when inspecting group membership.
-
id: stringThe identifier, which can be referenced in API endpoints
-
email: stringThe email address of the user.
-
name: stringThe name of the user.
-
Roles
List group organization role assignments
$ openai admin:organization:groups:roles list
get /organization/groups/{group_id}/roles
Lists the organization roles assigned to a group within the organization.
Parameters
-
--group-id: stringThe ID of the group whose organization role assignments you want to list.
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing organization roles. -
--limit: optional numberA limit on the number of organization role assignments to return.
-
--order: optional "asc" or "desc"Sort order for the returned organization roles.
Returns
-
RoleListResource: object { data, has_more, next, object }Paginated list of roles assigned to a principal.
-
data: array of object { id, created_at, created_by, 8 more }Role assignments returned in the current page.
-
id: stringIdentifier for the role.
-
created_at: numberWhen the role was created.
-
created_by: stringIdentifier of the actor who created the role.
-
created_by_user_obj: map[unknown]User details for the actor that created the role, when available.
-
description: stringDescription of the role.
-
metadata: map[unknown]Arbitrary metadata stored on the role.
-
name: stringName of the role.
-
permissions: array of stringPermissions associated with the role.
-
predefined_role: booleanWhether the role is predefined by OpenAI.
-
resource_type: stringResource type the role applies to.
-
updated_at: numberWhen the role was last updated.
-
-
has_more: booleanWhether additional assignments are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no more assignments. -
object: "list"Always
list.
-
Example
openai admin:organization:groups:roles list \
--admin-api-key 'My Admin API Key' \
--group-id group_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"created_by": "created_by",
"created_by_user_obj": {
"foo": "bar"
},
"description": "description",
"metadata": {
"foo": "bar"
},
"name": "name",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type",
"updated_at": 0
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Assign organization role to group
$ openai admin:organization:groups:roles create
post /organization/groups/{group_id}/roles
Assigns an organization role to a group within the organization.
Parameters
-
--group-id: stringThe ID of the group that should receive the organization role.
-
--role-id: stringIdentifier of the role to assign.
Returns
-
AdminOrganizationGroupRoleNewResponse: object { group, object, role }Role assignment linking a group to a role.
-
group: object { id, created_at, name, 2 more }Summary information about a group returned in role assignment responses.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
name: stringDisplay name of the group.
-
object: "group"Always
group. -
scim_managed: booleanWhether the group is managed through SCIM.
-
-
object: "group.role"Always
group.role. -
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
Example
openai admin:organization:groups:roles create \
--admin-api-key 'My Admin API Key' \
--group-id group_id \
--role-id role_id
Response
{
"group": {
"id": "id",
"created_at": 0,
"name": "name",
"object": "group",
"scim_managed": true
},
"object": "group.role",
"role": {
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
}
Unassign organization role from group
$ openai admin:organization:groups:roles delete
delete /organization/groups/{group_id}/roles/{role_id}
Unassigns an organization role from a group within the organization.
Parameters
-
--group-id: stringThe ID of the group to modify.
-
--role-id: stringThe ID of the organization role to remove from the group.
Returns
-
AdminOrganizationGroupRoleDeleteResponse: object { deleted, object }Confirmation payload returned after unassigning a role.
-
deleted: booleanWhether the assignment was removed.
-
object: stringIdentifier for the deleted assignment, such as
group.role.deletedoruser.role.deleted.
-
Example
openai admin:organization:groups:roles delete \
--admin-api-key 'My Admin API Key' \
--group-id group_id \
--role-id role_id
Response
{
"deleted": true,
"object": "object"
}
Roles
List organization roles
$ openai admin:organization:roles list
get /organization/roles
Lists the roles configured for the organization.
Parameters
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing roles. -
--limit: optional numberA limit on the number of roles to return. Defaults to 1000.
-
--order: optional "asc" or "desc"Sort order for the returned roles.
Returns
-
PublicRoleListResource: object { data, has_more, next, object }Paginated list of roles available on an organization or project.
-
data: array of RoleRoles returned in the current page.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
has_more: booleanWhether more roles are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no additional roles. -
object: "list"Always
list.
-
Example
openai admin:organization:roles list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Create organization role
$ openai admin:organization:roles create
post /organization/roles
Creates a custom role for the organization.
Parameters
-
--permission: array of stringPermissions to grant to the role.
-
--role-name: stringUnique name for the role.
-
--description: optional stringOptional description of the role.
Returns
-
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
Example
openai admin:organization:roles create \
--admin-api-key 'My Admin API Key' \
--permission string \
--role-name role_name
Response
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
Update organization role
$ openai admin:organization:roles update
post /organization/roles/{role_id}
Updates an existing organization role.
Parameters
-
--role-id: stringThe ID of the role to update.
-
--description: optional stringNew description for the role.
-
--permission: optional array of stringUpdated set of permissions for the role.
-
--role-name: optional stringNew name for the role.
Returns
-
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
Example
openai admin:organization:roles update \
--admin-api-key 'My Admin API Key' \
--role-id role_id
Response
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
Delete organization role
$ openai admin:organization:roles delete
delete /organization/roles/{role_id}
Deletes a custom role from the organization.
Parameters
-
--role-id: stringThe ID of the role to delete.
Returns
-
AdminOrganizationRoleDeleteResponse: object { id, deleted, object }Confirmation payload returned after deleting a role.
-
id: stringIdentifier of the deleted role.
-
deleted: booleanWhether the role was deleted.
-
object: "role.deleted"Always
role.deleted.
-
Example
openai admin:organization:roles delete \
--admin-api-key 'My Admin API Key' \
--role-id role_id
Response
{
"id": "id",
"deleted": true,
"object": "role.deleted"
}
Domain Types
Role
-
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
Certificates
List organization certificates
$ openai admin:organization:certificates list
get /organization/certificates
List uploaded certificates for this organization.
Parameters
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
-
--order: optional "asc" or "desc"Sort order by the
created_attimestamp of the objects.ascfor ascending order anddescfor descending order.
Returns
-
ListCertificatesResponse: object { data, first_id, has_more, 2 more }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the organization level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.certificate"The object type, which is always
organization.certificate.
-
-
first_id: string -
has_more: boolean -
last_id: string -
object: "list"
-
Example
openai admin:organization:certificates list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.certificate"
}
],
"first_id": "cert_abc",
"has_more": true,
"last_id": "cert_abc",
"object": "list"
}
Upload certificate
$ openai admin:organization:certificates create
post /organization/certificates
Upload a certificate to the organization. This does not automatically activate the certificate.
Organizations can upload up to 50 certificates.
Parameters
-
--certificate: stringThe certificate content in PEM format
-
--name: optional stringAn optional name for the certificate
Returns
-
certificate: object { id, certificate_details, created_at, 3 more }Represents an individual
certificateuploaded to the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
certificate_details: object { content, expires_at, valid_at }-
content: optional stringThe content of the certificate in PEM format.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "certificate" or "organization.certificate" or "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. -
"certificate" -
"organization.certificate" -
"organization.project.certificate"
-
-
active: optional booleanWhether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
-
Example
openai admin:organization:certificates create \
--admin-api-key 'My Admin API Key' \
--certificate certificate
Response
{
"id": "id",
"certificate_details": {
"content": "content",
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "certificate",
"active": true
}
Get certificate
$ openai admin:organization:certificates retrieve
get /organization/certificates/{certificate_id}
Get a certificate that has been uploaded to the organization.
You can get a certificate regardless of whether it is active or not.
Parameters
-
--certificate-id: stringUnique ID of the certificate to retrieve.
-
--include: optional array of "content"A list of additional fields to include in the response. Currently the only supported value is
contentto fetch the PEM content of the certificate.
Returns
-
certificate: object { id, certificate_details, created_at, 3 more }Represents an individual
certificateuploaded to the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
certificate_details: object { content, expires_at, valid_at }-
content: optional stringThe content of the certificate in PEM format.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "certificate" or "organization.certificate" or "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. -
"certificate" -
"organization.certificate" -
"organization.project.certificate"
-
-
active: optional booleanWhether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
-
Example
openai admin:organization:certificates retrieve \
--admin-api-key 'My Admin API Key' \
--certificate-id certificate_id
Response
{
"id": "id",
"certificate_details": {
"content": "content",
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "certificate",
"active": true
}
Modify certificate
$ openai admin:organization:certificates update
post /organization/certificates/{certificate_id}
Modify a certificate. Note that only the name can be modified.
Parameters
-
--certificate-id: stringUnique ID of the certificate to modify.
-
--name: optional stringThe updated name for the certificate
Returns
-
certificate: object { id, certificate_details, created_at, 3 more }Represents an individual
certificateuploaded to the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
certificate_details: object { content, expires_at, valid_at }-
content: optional stringThe content of the certificate in PEM format.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "certificate" or "organization.certificate" or "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. -
"certificate" -
"organization.certificate" -
"organization.project.certificate"
-
-
active: optional booleanWhether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
-
Example
openai admin:organization:certificates update \
--admin-api-key 'My Admin API Key' \
--certificate-id certificate_id
Response
{
"id": "id",
"certificate_details": {
"content": "content",
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "certificate",
"active": true
}
Delete certificate
$ openai admin:organization:certificates delete
delete /organization/certificates/{certificate_id}
Delete a certificate from the organization.
The certificate must be inactive for the organization and all projects.
Parameters
-
--certificate-id: stringUnique ID of the certificate to delete.
Returns
-
AdminOrganizationCertificateDeleteResponse: object { id, object }-
id: stringThe ID of the certificate that was deleted.
-
object: "certificate.deleted"The object type, must be
certificate.deleted.
-
Example
openai admin:organization:certificates delete \
--admin-api-key 'My Admin API Key' \
--certificate-id certificate_id
Response
{
"id": "id",
"object": "certificate.deleted"
}
Activate certificates for organization
$ openai admin:organization:certificates activate
post /organization/certificates/activate
Activate certificates at the organization level.
You can atomically and idempotently activate up to 10 certificates at a time.
Parameters
--certificate-id: array of string
Returns
-
OrganizationCertificateActivationResponse: object { data, object }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the organization level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.certificate"The object type, which is always
organization.certificate.
-
-
object: "organization.certificate.activation"The organization certificate activation result type.
-
Example
openai admin:organization:certificates activate \
--admin-api-key 'My Admin API Key' \
--certificate-id cert_abc
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.certificate"
}
],
"object": "organization.certificate.activation"
}
Deactivate certificates for organization
$ openai admin:organization:certificates deactivate
post /organization/certificates/deactivate
Deactivate certificates at the organization level.
You can atomically and idempotently deactivate up to 10 certificates at a time.
Parameters
--certificate-id: array of string
Returns
-
OrganizationCertificateDeactivationResponse: object { data, object }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the organization level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.certificate"The object type, which is always
organization.certificate.
-
-
object: "organization.certificate.deactivation"The organization certificate deactivation result type.
-
Example
openai admin:organization:certificates deactivate \
--admin-api-key 'My Admin API Key' \
--certificate-id cert_abc
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.certificate"
}
],
"object": "organization.certificate.deactivation"
}
Domain Types
Certificate
-
certificate: object { id, certificate_details, created_at, 3 more }Represents an individual
certificateuploaded to the organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
certificate_details: object { content, expires_at, valid_at }-
content: optional stringThe content of the certificate in PEM format.
-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "certificate" or "organization.certificate" or "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. -
"certificate" -
"organization.certificate" -
"organization.project.certificate"
-
-
active: optional booleanWhether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
-
Projects
List projects
$ openai admin:organization:projects list
get /organization/projects
Returns a list of projects.
Parameters
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--include-archived: optional booleanIf
truereturns all projects including those that have beenarchived. Archived projects are not included by default. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
ProjectListResponse: object { data, has_more, object, 2 more }-
data: array of Project-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:projects list \
--admin-api-key 'My Admin API Key'
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"object": "organization.project",
"archived_at": 0,
"external_key_id": "external_key_id",
"name": "name",
"status": "status"
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Create project
$ openai admin:organization:projects create
post /organization/projects
Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
Parameters
-
--name: stringThe friendly name of the project, this name appears in reports.
-
--external-key-id: optional stringExternal key ID to associate with the project.
-
--geography: optional stringCreate the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See data residency controls to review the functionality and limitations of setting this field.
Returns
-
project: object { id, created_at, object, 4 more }Represents an individual project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
Example
openai admin:organization:projects create \
--admin-api-key 'My Admin API Key' \
--name name
Response
{
"id": "id",
"created_at": 0,
"object": "organization.project",
"archived_at": 0,
"external_key_id": "external_key_id",
"name": "name",
"status": "status"
}
Retrieve project
$ openai admin:organization:projects retrieve
get /organization/projects/{project_id}
Retrieves a project.
Parameters
-
--project-id: stringThe ID of the project.
Returns
-
project: object { id, created_at, object, 4 more }Represents an individual project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
Example
openai admin:organization:projects retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"id": "id",
"created_at": 0,
"object": "organization.project",
"archived_at": 0,
"external_key_id": "external_key_id",
"name": "name",
"status": "status"
}
Modify project
$ openai admin:organization:projects update
post /organization/projects/{project_id}
Modifies a project in the organization.
Parameters
-
--project-id: stringThe ID of the project.
-
--external-key-id: optional stringExternal key ID to associate with the project.
-
--geography: optional stringGeography for the project.
-
--name: optional stringThe updated name of the project, this name appears in reports.
Returns
-
project: object { id, created_at, object, 4 more }Represents an individual project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
Example
openai admin:organization:projects update \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"id": "id",
"created_at": 0,
"object": "organization.project",
"archived_at": 0,
"external_key_id": "external_key_id",
"name": "name",
"status": "status"
}
Archive project
$ openai admin:organization:projects archive
post /organization/projects/{project_id}/archive
Archives a project in the organization. Archived projects cannot be used or updated.
Parameters
-
--project-id: stringThe ID of the project.
Returns
-
project: object { id, created_at, object, 4 more }Represents an individual project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
Example
openai admin:organization:projects archive \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"id": "id",
"created_at": 0,
"object": "organization.project",
"archived_at": 0,
"external_key_id": "external_key_id",
"name": "name",
"status": "status"
}
Domain Types
Project
-
project: object { id, created_at, object, 4 more }Represents an individual project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the project was created.
-
object: "organization.project"The object type, which is always
organization.project -
archived_at: optional numberThe Unix timestamp (in seconds) of when the project was archived or
null. -
external_key_id: optional stringThe external key associated with the project.
-
name: optional stringThe name of the project. This appears in reporting.
-
status: optional stringactiveorarchived
-
Users
List project users
$ openai admin:organization:projects:users list
get /organization/projects/{project_id}/users
Returns a list of users in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
ProjectUserListResponse: object { data, has_more, object, 2 more }-
data: array of ProjectUser-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the project was added.
-
object: "organization.project.user"The object type, which is always
organization.project.user -
role: stringownerormember -
email: optional stringThe email address of the user
-
name: optional stringThe name of the user
-
-
has_more: boolean -
object: string -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:projects:users list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"added_at": 0,
"object": "organization.project.user",
"role": "role",
"email": "email",
"name": "name"
}
],
"has_more": true,
"object": "object",
"first_id": "first_id",
"last_id": "last_id"
}
Create project user
$ openai admin:organization:projects:users create
post /organization/projects/{project_id}/users
Adds a user to the project. Users must already be members of the organization to be added to a project.
Parameters
-
--project-id: stringThe ID of the project.
-
--role: stringownerormember -
--email: optional stringEmail of the user to add.
-
--user-id: optional stringThe ID of the user.
Returns
-
project_user: object { id, added_at, object, 3 more }Represents an individual user in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the project was added.
-
object: "organization.project.user"The object type, which is always
organization.project.user -
role: stringownerormember -
email: optional stringThe email address of the user
-
name: optional stringThe name of the user
-
Example
openai admin:organization:projects:users create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--role role
Response
{
"id": "id",
"added_at": 0,
"object": "organization.project.user",
"role": "role",
"email": "email",
"name": "name"
}
Retrieve project user
$ openai admin:organization:projects:users retrieve
get /organization/projects/{project_id}/users/{user_id}
Retrieves a user in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--user-id: stringThe ID of the user.
Returns
-
project_user: object { id, added_at, object, 3 more }Represents an individual user in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the project was added.
-
object: "organization.project.user"The object type, which is always
organization.project.user -
role: stringownerormember -
email: optional stringThe email address of the user
-
name: optional stringThe name of the user
-
Example
openai admin:organization:projects:users retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id
Response
{
"id": "id",
"added_at": 0,
"object": "organization.project.user",
"role": "role",
"email": "email",
"name": "name"
}
Modify project user
$ openai admin:organization:projects:users update
post /organization/projects/{project_id}/users/{user_id}
Modifies a user's role in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--user-id: stringThe ID of the user.
-
--role: optional stringownerormember
Returns
-
project_user: object { id, added_at, object, 3 more }Represents an individual user in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the project was added.
-
object: "organization.project.user"The object type, which is always
organization.project.user -
role: stringownerormember -
email: optional stringThe email address of the user
-
name: optional stringThe name of the user
-
Example
openai admin:organization:projects:users update \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id
Response
{
"id": "id",
"added_at": 0,
"object": "organization.project.user",
"role": "role",
"email": "email",
"name": "name"
}
Delete project user
$ openai admin:organization:projects:users delete
delete /organization/projects/{project_id}/users/{user_id}
Deletes a user from the project.
Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users).
Parameters
-
--project-id: stringThe ID of the project.
-
--user-id: stringThe ID of the user.
Returns
-
AdminOrganizationProjectUserDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.project.user.deleted"
-
Example
openai admin:organization:projects:users delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id
Response
{
"id": "id",
"deleted": true,
"object": "organization.project.user.deleted"
}
Domain Types
Project User
-
project_user: object { id, added_at, object, 3 more }Represents an individual user in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the project was added.
-
object: "organization.project.user"The object type, which is always
organization.project.user -
role: stringownerormember -
email: optional stringThe email address of the user
-
name: optional stringThe name of the user
-
Roles
List project user role assignments
$ openai admin:organization:projects:users:roles list
get /projects/{project_id}/users/{user_id}/roles
Lists the project roles assigned to a user within a project.
Parameters
-
--project-id: stringThe ID of the project to inspect.
-
--user-id: stringThe ID of the user to inspect.
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing project roles. -
--limit: optional numberA limit on the number of project role assignments to return.
-
--order: optional "asc" or "desc"Sort order for the returned project roles.
Returns
-
RoleListResource: object { data, has_more, next, object }Paginated list of roles assigned to a principal.
-
data: array of object { id, created_at, created_by, 8 more }Role assignments returned in the current page.
-
id: stringIdentifier for the role.
-
created_at: numberWhen the role was created.
-
created_by: stringIdentifier of the actor who created the role.
-
created_by_user_obj: map[unknown]User details for the actor that created the role, when available.
-
description: stringDescription of the role.
-
metadata: map[unknown]Arbitrary metadata stored on the role.
-
name: stringName of the role.
-
permissions: array of stringPermissions associated with the role.
-
predefined_role: booleanWhether the role is predefined by OpenAI.
-
resource_type: stringResource type the role applies to.
-
updated_at: numberWhen the role was last updated.
-
-
has_more: booleanWhether additional assignments are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no more assignments. -
object: "list"Always
list.
-
Example
openai admin:organization:projects:users:roles list \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"created_by": "created_by",
"created_by_user_obj": {
"foo": "bar"
},
"description": "description",
"metadata": {
"foo": "bar"
},
"name": "name",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type",
"updated_at": 0
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Assign project role to user
$ openai admin:organization:projects:users:roles create
post /projects/{project_id}/users/{user_id}/roles
Assigns a project role to a user within a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--user-id: stringThe ID of the user that should receive the project role.
-
--role-id: stringIdentifier of the role to assign.
Returns
-
AdminOrganizationProjectUserRoleNewResponse: object { object, role, user }Role assignment linking a user to a role.
-
object: "user.role"Always
user.role. -
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
user: object { id, added_at, object, 13 more }Represents an individual
userwithin an organization.-
id: stringThe identifier, which can be referenced in API endpoints
-
added_at: numberThe Unix timestamp (in seconds) of when the user was added.
-
object: "organization.user"The object type, which is always
organization.user -
api_key_last_used_at: optional numberThe Unix timestamp (in seconds) of the user's last API key usage.
-
created: optional numberThe Unix timestamp (in seconds) of when the user was created.
-
developer_persona: optional stringThe developer persona metadata for the user.
-
email: optional stringThe email address of the user
-
is_default: optional booleanWhether this is the organization's default user.
-
is_scale_tier_authorized_purchaser: optional booleanWhether the user is an authorized purchaser for Scale Tier.
-
is_scim_managed: optional booleanWhether the user is managed through SCIM.
-
is_service_account: optional booleanWhether the user is a service account.
-
name: optional stringThe name of the user
-
projects: optional object { data, object }Projects associated with the user, if included.
-
data: array of object { id, name, role }-
id: optional string -
name: optional string -
role: optional string
-
-
object: "list"
-
-
role: optional stringownerorreader -
technical_level: optional stringThe technical level metadata for the user.
-
user: optional object { id, object, banned, 5 more }Nested user details.
-
id: string -
object: "user" -
banned: optional boolean -
banned_at: optional number -
email: optional string -
enabled: optional boolean -
name: optional string -
picture: optional string
-
-
-
Example
openai admin:organization:projects:users:roles create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id \
--role-id role_id
Response
{
"object": "user.role",
"role": {
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
},
"user": {
"id": "id",
"added_at": 0,
"object": "organization.user",
"api_key_last_used_at": 0,
"created": 0,
"developer_persona": "developer_persona",
"email": "email",
"is_default": true,
"is_scale_tier_authorized_purchaser": true,
"is_scim_managed": true,
"is_service_account": true,
"name": "name",
"projects": {
"data": [
{
"id": "id",
"name": "name",
"role": "role"
}
],
"object": "list"
},
"role": "role",
"technical_level": "technical_level",
"user": {
"id": "id",
"object": "user",
"banned": true,
"banned_at": 0,
"email": "email",
"enabled": true,
"name": "name",
"picture": "picture"
}
}
}
Unassign project role from user
$ openai admin:organization:projects:users:roles delete
delete /projects/{project_id}/users/{user_id}/roles/{role_id}
Unassigns a project role from a user within a project.
Parameters
-
--project-id: stringThe ID of the project to modify.
-
--user-id: stringThe ID of the user whose project role assignment should be removed.
-
--role-id: stringThe ID of the project role to remove from the user.
Returns
-
AdminOrganizationProjectUserRoleDeleteResponse: object { deleted, object }Confirmation payload returned after unassigning a role.
-
deleted: booleanWhether the assignment was removed.
-
object: stringIdentifier for the deleted assignment, such as
group.role.deletedoruser.role.deleted.
-
Example
openai admin:organization:projects:users:roles delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--user-id user_id \
--role-id role_id
Response
{
"deleted": true,
"object": "object"
}
Service Accounts
List project service accounts
$ openai admin:organization:projects:service-accounts list
get /organization/projects/{project_id}/service_accounts
Returns a list of service accounts in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
ProjectServiceAccountListResponse: object { data, has_more, object, 2 more }-
data: array of ProjectServiceAccount-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created
-
name: stringThe name of the service account
-
object: "organization.project.service_account"The object type, which is always
organization.project.service_account -
role: "owner" or "member"ownerormember-
"owner" -
"member"
-
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:projects:service-accounts list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"name": "name",
"object": "organization.project.service_account",
"role": "owner"
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Create project service account
$ openai admin:organization:projects:service-accounts create
post /organization/projects/{project_id}/service_accounts
Creates a new service account in the project. This also returns an unredacted API key for the service account.
Parameters
-
--project-id: stringThe ID of the project.
-
--name: stringThe name of the service account being created.
Returns
-
AdminOrganizationProjectServiceAccountNewResponse: object { id, api_key, created_at, 3 more }-
id: string -
api_key: object { id, created_at, name, 2 more }-
id: string -
created_at: number -
name: string -
object: "organization.project.service_account.api_key"The object type, which is always
organization.project.service_account.api_key -
value: string
-
-
created_at: number -
name: string -
object: "organization.project.service_account" -
role: "member"Service accounts can only have one role of type
member
-
Example
openai admin:organization:projects:service-accounts create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--name name
Response
{
"id": "id",
"api_key": {
"id": "id",
"created_at": 0,
"name": "name",
"object": "organization.project.service_account.api_key",
"value": "value"
},
"created_at": 0,
"name": "name",
"object": "organization.project.service_account",
"role": "member"
}
Retrieve project service account
$ openai admin:organization:projects:service-accounts retrieve
get /organization/projects/{project_id}/service_accounts/{service_account_id}
Retrieves a service account in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--service-account-id: stringThe ID of the service account.
Returns
-
project_service_account: object { id, created_at, name, 2 more }Represents an individual service account in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created
-
name: stringThe name of the service account
-
object: "organization.project.service_account"The object type, which is always
organization.project.service_account -
role: "owner" or "member"ownerormember-
"owner" -
"member"
-
-
Example
openai admin:organization:projects:service-accounts retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--service-account-id service_account_id
Response
{
"id": "id",
"created_at": 0,
"name": "name",
"object": "organization.project.service_account",
"role": "owner"
}
Delete project service account
$ openai admin:organization:projects:service-accounts delete
delete /organization/projects/{project_id}/service_accounts/{service_account_id}
Deletes a service account from the project.
Returns confirmation of service account deletion, or an error if the project is archived (archived projects have no service accounts).
Parameters
-
--project-id: stringThe ID of the project.
-
--service-account-id: stringThe ID of the service account.
Returns
-
AdminOrganizationProjectServiceAccountDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.project.service_account.deleted"
-
Example
openai admin:organization:projects:service-accounts delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--service-account-id service_account_id
Response
{
"id": "id",
"deleted": true,
"object": "organization.project.service_account.deleted"
}
Domain Types
Project Service Account
-
project_service_account: object { id, created_at, name, 2 more }Represents an individual service account in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created
-
name: stringThe name of the service account
-
object: "organization.project.service_account"The object type, which is always
organization.project.service_account -
role: "owner" or "member"ownerormember-
"owner" -
"member"
-
-
API Keys
List project API keys
$ openai admin:organization:projects:api-keys list
get /organization/projects/{project_id}/api_keys
Returns a list of API keys in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
-
ProjectApiKeyListResponse: object { data, has_more, object, 2 more }-
data: array of ProjectAPIKey-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
last_used_at: numberThe Unix timestamp (in seconds) of when the API key was last used.
-
name: stringThe name of the API key
-
object: "organization.project.api_key"The object type, which is always
organization.project.api_key -
owner: object { service_account, type, user }-
service_account: optional object { id, created_at, name, role }The service account that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created.
-
name: stringThe name of the service account.
-
role: stringThe service account's project role.
-
-
type: optional "user" or "service_account"userorservice_account-
"user" -
"service_account"
-
-
user: optional object { id, created_at, email, 2 more }The user that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the user was created.
-
email: stringThe email address of the user.
-
name: stringThe name of the user.
-
role: stringThe user's project role.
-
-
-
redacted_value: stringThe redacted value of the API key
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:projects:api-keys list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"last_used_at": 0,
"name": "name",
"object": "organization.project.api_key",
"owner": {
"service_account": {
"id": "id",
"created_at": 0,
"name": "name",
"role": "role"
},
"type": "user",
"user": {
"id": "id",
"created_at": 0,
"email": "email",
"name": "name",
"role": "role"
}
},
"redacted_value": "redacted_value"
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Retrieve project API key
$ openai admin:organization:projects:api-keys retrieve
get /organization/projects/{project_id}/api_keys/{api_key_id}
Retrieves an API key in the project.
Parameters
-
--project-id: stringThe ID of the project.
-
--api-key-id: stringThe ID of the API key.
Returns
-
project_api_key: object { id, created_at, last_used_at, 4 more }Represents an individual API key in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
last_used_at: numberThe Unix timestamp (in seconds) of when the API key was last used.
-
name: stringThe name of the API key
-
object: "organization.project.api_key"The object type, which is always
organization.project.api_key -
owner: object { service_account, type, user }-
service_account: optional object { id, created_at, name, role }The service account that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created.
-
name: stringThe name of the service account.
-
role: stringThe service account's project role.
-
-
type: optional "user" or "service_account"userorservice_account-
"user" -
"service_account"
-
-
user: optional object { id, created_at, email, 2 more }The user that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the user was created.
-
email: stringThe email address of the user.
-
name: stringThe name of the user.
-
role: stringThe user's project role.
-
-
-
redacted_value: stringThe redacted value of the API key
-
Example
openai admin:organization:projects:api-keys retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--api-key-id api_key_id
Response
{
"id": "id",
"created_at": 0,
"last_used_at": 0,
"name": "name",
"object": "organization.project.api_key",
"owner": {
"service_account": {
"id": "id",
"created_at": 0,
"name": "name",
"role": "role"
},
"type": "user",
"user": {
"id": "id",
"created_at": 0,
"email": "email",
"name": "name",
"role": "role"
}
},
"redacted_value": "redacted_value"
}
Delete project API key
$ openai admin:organization:projects:api-keys delete
delete /organization/projects/{project_id}/api_keys/{api_key_id}
Deletes an API key from the project.
Returns confirmation of the key deletion, or an error if the key belonged to a service account.
Parameters
-
--project-id: stringThe ID of the project.
-
--api-key-id: stringThe ID of the API key.
Returns
-
AdminOrganizationProjectAPIKeyDeleteResponse: object { id, deleted, object }-
id: string -
deleted: boolean -
object: "organization.project.api_key.deleted"
-
Example
openai admin:organization:projects:api-keys delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--api-key-id api_key_id
Response
{
"id": "id",
"deleted": true,
"object": "organization.project.api_key.deleted"
}
Domain Types
Project API Key
-
project_api_key: object { id, created_at, last_used_at, 4 more }Represents an individual API key in a project.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the API key was created
-
last_used_at: numberThe Unix timestamp (in seconds) of when the API key was last used.
-
name: stringThe name of the API key
-
object: "organization.project.api_key"The object type, which is always
organization.project.api_key -
owner: object { service_account, type, user }-
service_account: optional object { id, created_at, name, role }The service account that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the service account was created.
-
name: stringThe name of the service account.
-
role: stringThe service account's project role.
-
-
type: optional "user" or "service_account"userorservice_account-
"user" -
"service_account"
-
-
user: optional object { id, created_at, email, 2 more }The user that owns a project API key.
-
id: stringThe identifier, which can be referenced in API endpoints
-
created_at: numberThe Unix timestamp (in seconds) of when the user was created.
-
email: stringThe email address of the user.
-
name: stringThe name of the user.
-
role: stringThe user's project role.
-
-
-
redacted_value: stringThe redacted value of the API key
-
Rate Limits
List project rate limits
$ openai admin:organization:projects:rate-limits list-rate-limits
get /organization/projects/{project_id}/rate_limits
Returns the rate limits per model for a project.
Parameters
-
--project-id: stringThe ID of the project.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--before: optional stringA cursor for use in pagination.
beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. -
--limit: optional numberA limit on the number of objects to be returned. The default is 100.
Returns
-
ProjectRateLimitListResponse: object { data, has_more, object, 2 more }-
data: array of ProjectRateLimit-
id: stringThe identifier, which can be referenced in API endpoints.
-
max_requests_per_1_minute: numberThe maximum requests per minute.
-
max_tokens_per_1_minute: numberThe maximum tokens per minute.
-
model: stringThe model this rate limit applies to.
-
object: "project.rate_limit"The object type, which is always
project.rate_limit -
batch_1_day_max_input_tokens: optional numberThe maximum batch input tokens per day. Only present for relevant models.
-
max_audio_megabytes_per_1_minute: optional numberThe maximum audio megabytes per minute. Only present for relevant models.
-
max_images_per_1_minute: optional numberThe maximum images per minute. Only present for relevant models.
-
max_requests_per_1_day: optional numberThe maximum requests per day. Only present for relevant models.
-
-
has_more: boolean -
object: "list" -
first_id: optional string -
last_id: optional string
-
Example
openai admin:organization:projects:rate-limits list-rate-limits \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"max_requests_per_1_minute": 0,
"max_tokens_per_1_minute": 0,
"model": "model",
"object": "project.rate_limit",
"batch_1_day_max_input_tokens": 0,
"max_audio_megabytes_per_1_minute": 0,
"max_images_per_1_minute": 0,
"max_requests_per_1_day": 0
}
],
"has_more": true,
"object": "list",
"first_id": "first_id",
"last_id": "last_id"
}
Modify project rate limit
$ openai admin:organization:projects:rate-limits update-rate-limit
post /organization/projects/{project_id}/rate_limits/{rate_limit_id}
Updates a project rate limit.
Parameters
-
--project-id: stringThe ID of the project.
-
--rate-limit-id: stringThe ID of the rate limit.
-
--batch-1-day-max-input-tokens: optional numberThe maximum batch input tokens per day. Only relevant for certain models.
-
--max-audio-megabytes-per-1-minute: optional numberThe maximum audio megabytes per minute. Only relevant for certain models.
-
--max-images-per-1-minute: optional numberThe maximum images per minute. Only relevant for certain models.
-
--max-requests-per-1-day: optional numberThe maximum requests per day. Only relevant for certain models.
-
--max-requests-per-1-minute: optional numberThe maximum requests per minute.
-
--max-tokens-per-1-minute: optional numberThe maximum tokens per minute.
Returns
-
project_rate_limit: object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }Represents a project rate limit config.
-
id: stringThe identifier, which can be referenced in API endpoints.
-
max_requests_per_1_minute: numberThe maximum requests per minute.
-
max_tokens_per_1_minute: numberThe maximum tokens per minute.
-
model: stringThe model this rate limit applies to.
-
object: "project.rate_limit"The object type, which is always
project.rate_limit -
batch_1_day_max_input_tokens: optional numberThe maximum batch input tokens per day. Only present for relevant models.
-
max_audio_megabytes_per_1_minute: optional numberThe maximum audio megabytes per minute. Only present for relevant models.
-
max_images_per_1_minute: optional numberThe maximum images per minute. Only present for relevant models.
-
max_requests_per_1_day: optional numberThe maximum requests per day. Only present for relevant models.
-
Example
openai admin:organization:projects:rate-limits update-rate-limit \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--rate-limit-id rate_limit_id
Response
{
"id": "id",
"max_requests_per_1_minute": 0,
"max_tokens_per_1_minute": 0,
"model": "model",
"object": "project.rate_limit",
"batch_1_day_max_input_tokens": 0,
"max_audio_megabytes_per_1_minute": 0,
"max_images_per_1_minute": 0,
"max_requests_per_1_day": 0
}
Domain Types
Project Rate Limit
-
project_rate_limit: object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }Represents a project rate limit config.
-
id: stringThe identifier, which can be referenced in API endpoints.
-
max_requests_per_1_minute: numberThe maximum requests per minute.
-
max_tokens_per_1_minute: numberThe maximum tokens per minute.
-
model: stringThe model this rate limit applies to.
-
object: "project.rate_limit"The object type, which is always
project.rate_limit -
batch_1_day_max_input_tokens: optional numberThe maximum batch input tokens per day. Only present for relevant models.
-
max_audio_megabytes_per_1_minute: optional numberThe maximum audio megabytes per minute. Only present for relevant models.
-
max_images_per_1_minute: optional numberThe maximum images per minute. Only present for relevant models.
-
max_requests_per_1_day: optional numberThe maximum requests per day. Only present for relevant models.
-
Model Permissions
Retrieve project model permissions
$ openai admin:organization:projects:model-permissions retrieve
get /organization/projects/{project_id}/model_permissions
Returns model permissions for a project.
Parameters
-
--project-id: stringThe ID of the project.
Returns
-
project_model_permissions: object { mode, model_ids, object }Represents the model allowlist or denylist policy for a project.
-
mode: "allow_list" or "deny_list"Whether the project uses an allowlist or a denylist.
-
"allow_list" -
"deny_list"
-
-
model_ids: array of stringThe model IDs included in the model permissions policy.
-
object: "project.model_permissions"The object type, which is always
project.model_permissions.
-
Example
openai admin:organization:projects:model-permissions retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"mode": "allow_list",
"model_ids": [
"string"
],
"object": "project.model_permissions"
}
Modify project model permissions
$ openai admin:organization:projects:model-permissions update
post /organization/projects/{project_id}/model_permissions
Updates model permissions for a project.
Parameters
-
--project-id: stringThe ID of the project.
-
--mode: "allow_list" or "deny_list"The model permissions mode to apply.
-
--model-id: array of stringThe model IDs included in this permissions policy.
Returns
-
project_model_permissions: object { mode, model_ids, object }Represents the model allowlist or denylist policy for a project.
-
mode: "allow_list" or "deny_list"Whether the project uses an allowlist or a denylist.
-
"allow_list" -
"deny_list"
-
-
model_ids: array of stringThe model IDs included in the model permissions policy.
-
object: "project.model_permissions"The object type, which is always
project.model_permissions.
-
Example
openai admin:organization:projects:model-permissions update \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--mode allow_list \
--model-id string
Response
{
"mode": "allow_list",
"model_ids": [
"string"
],
"object": "project.model_permissions"
}
Delete project model permissions
$ openai admin:organization:projects:model-permissions delete
delete /organization/projects/{project_id}/model_permissions
Deletes model permissions for a project.
Parameters
-
--project-id: stringThe ID of the project.
Returns
-
project_model_permissions_deleted: object { deleted, object }Confirmation payload returned after deleting project model permissions.
-
deleted: booleanWhether the project model permissions were deleted.
-
object: "project.model_permissions.deleted"The object type, which is always
project.model_permissions.deleted.
-
Example
openai admin:organization:projects:model-permissions delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"deleted": true,
"object": "project.model_permissions.deleted"
}
Domain Types
Project Model Permissions
-
project_model_permissions: object { mode, model_ids, object }Represents the model allowlist or denylist policy for a project.
-
mode: "allow_list" or "deny_list"Whether the project uses an allowlist or a denylist.
-
"allow_list" -
"deny_list"
-
-
model_ids: array of stringThe model IDs included in the model permissions policy.
-
object: "project.model_permissions"The object type, which is always
project.model_permissions.
-
Project Model Permissions Deleted
-
project_model_permissions_deleted: object { deleted, object }Confirmation payload returned after deleting project model permissions.
-
deleted: booleanWhether the project model permissions were deleted.
-
object: "project.model_permissions.deleted"The object type, which is always
project.model_permissions.deleted.
-
Hosted Tool Permissions
Retrieve project hosted tool permissions
$ openai admin:organization:projects:hosted-tool-permissions retrieve
get /organization/projects/{project_id}/hosted_tool_permissions
Returns hosted tool permissions for a project.
Parameters
-
--project-id: stringThe ID of the project.
Returns
-
project_hosted_tool_permissions: object { code_interpreter, file_search, image_generation, 2 more }Represents hosted tool permissions for a project.
-
code_interpreter: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
file_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
image_generation: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
mcp: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
web_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
Example
openai admin:organization:projects:hosted-tool-permissions retrieve \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"code_interpreter": {
"enabled": true
},
"file_search": {
"enabled": true
},
"image_generation": {
"enabled": true
},
"mcp": {
"enabled": true
},
"web_search": {
"enabled": true
}
}
Modify project hosted tool permissions
$ openai admin:organization:projects:hosted-tool-permissions update
post /organization/projects/{project_id}/hosted_tool_permissions
Updates hosted tool permissions for a project.
Parameters
-
--project-id: stringThe ID of the project.
-
--code-interpreter: optional object { enabled }The code interpreter permission update.
-
--file-search: optional object { enabled }The file search permission update.
-
--image-generation: optional object { enabled }The image generation permission update.
-
--mcp: optional object { enabled }The MCP permission update.
-
--web-search: optional object { enabled }The web search permission update.
Returns
-
project_hosted_tool_permissions: object { code_interpreter, file_search, image_generation, 2 more }Represents hosted tool permissions for a project.
-
code_interpreter: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
file_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
image_generation: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
mcp: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
web_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
Example
openai admin:organization:projects:hosted-tool-permissions update \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"code_interpreter": {
"enabled": true
},
"file_search": {
"enabled": true
},
"image_generation": {
"enabled": true
},
"mcp": {
"enabled": true
},
"web_search": {
"enabled": true
}
}
Domain Types
Project Hosted Tool Permissions
-
project_hosted_tool_permissions: object { code_interpreter, file_search, image_generation, 2 more }Represents hosted tool permissions for a project.
-
code_interpreter: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
file_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
image_generation: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
mcp: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
web_search: object { enabled }Permission state for a single hosted tool on a project.
-
enabled: booleanWhether the hosted tool is enabled for the project.
-
-
Groups
List project groups
$ openai admin:organization:projects:groups list
get /organization/projects/{project_id}/groups
Lists the groups that have access to a project.
Parameters
-
--project-id: stringThe ID of the project to inspect.
-
--after: optional stringCursor for pagination. Provide the ID of the last group from the previous response to fetch the next page.
-
--limit: optional numberA limit on the number of project groups to return. Defaults to 20.
-
--order: optional "asc" or "desc"Sort order for the returned groups.
Returns
-
ProjectGroupListResource: object { data, has_more, next, object }Paginated list of groups that have access to a project.
-
data: array of ProjectGroupProject group memberships returned in the current page.
-
created_at: numberUnix timestamp (in seconds) when the group was granted project access.
-
group_id: stringIdentifier of the group that has access to the project.
-
group_name: stringDisplay name of the group.
-
group_type: stringThe type of the group.
-
object: "project.group"Always
project.group. -
project_id: stringIdentifier of the project.
-
-
has_more: booleanWhether additional project group memberships are available.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no more results. -
object: "list"Always
list.
-
Example
openai admin:organization:projects:groups list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"created_at": 0,
"group_id": "group_id",
"group_name": "group_name",
"group_type": "group_type",
"object": "project.group",
"project_id": "project_id"
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Add project group
$ openai admin:organization:projects:groups create
post /organization/projects/{project_id}/groups
Grants a group access to a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--group-id: stringIdentifier of the group to add to the project.
-
--role: stringIdentifier of the project role to grant to the group.
Returns
-
project_group: object { created_at, group_id, group_name, 3 more }Details about a group's membership in a project.
-
created_at: numberUnix timestamp (in seconds) when the group was granted project access.
-
group_id: stringIdentifier of the group that has access to the project.
-
group_name: stringDisplay name of the group.
-
group_type: stringThe type of the group.
-
object: "project.group"Always
project.group. -
project_id: stringIdentifier of the project.
-
Example
openai admin:organization:projects:groups create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--group-id group_id \
--role role
Response
{
"created_at": 0,
"group_id": "group_id",
"group_name": "group_name",
"group_type": "group_type",
"object": "project.group",
"project_id": "project_id"
}
Remove project group
$ openai admin:organization:projects:groups delete
delete /organization/projects/{project_id}/groups/{group_id}
Revokes a group's access to a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--group-id: stringThe ID of the group to remove from the project.
Returns
-
AdminOrganizationProjectGroupDeleteResponse: object { deleted, object }Confirmation payload returned after removing a group from a project.
-
deleted: booleanWhether the group membership in the project was removed.
-
object: "project.group.deleted"Always
project.group.deleted.
-
Example
openai admin:organization:projects:groups delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--group-id group_id
Response
{
"deleted": true,
"object": "project.group.deleted"
}
Domain Types
Project Group
-
project_group: object { created_at, group_id, group_name, 3 more }Details about a group's membership in a project.
-
created_at: numberUnix timestamp (in seconds) when the group was granted project access.
-
group_id: stringIdentifier of the group that has access to the project.
-
group_name: stringDisplay name of the group.
-
group_type: stringThe type of the group.
-
object: "project.group"Always
project.group. -
project_id: stringIdentifier of the project.
-
Roles
List project group role assignments
$ openai admin:organization:projects:groups:roles list
get /projects/{project_id}/groups/{group_id}/roles
Lists the project roles assigned to a group within a project.
Parameters
-
--project-id: stringThe ID of the project to inspect.
-
--group-id: stringThe ID of the group to inspect.
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing project roles. -
--limit: optional numberA limit on the number of project role assignments to return.
-
--order: optional "asc" or "desc"Sort order for the returned project roles.
Returns
-
RoleListResource: object { data, has_more, next, object }Paginated list of roles assigned to a principal.
-
data: array of object { id, created_at, created_by, 8 more }Role assignments returned in the current page.
-
id: stringIdentifier for the role.
-
created_at: numberWhen the role was created.
-
created_by: stringIdentifier of the actor who created the role.
-
created_by_user_obj: map[unknown]User details for the actor that created the role, when available.
-
description: stringDescription of the role.
-
metadata: map[unknown]Arbitrary metadata stored on the role.
-
name: stringName of the role.
-
permissions: array of stringPermissions associated with the role.
-
predefined_role: booleanWhether the role is predefined by OpenAI.
-
resource_type: stringResource type the role applies to.
-
updated_at: numberWhen the role was last updated.
-
-
has_more: booleanWhether additional assignments are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no more assignments. -
object: "list"Always
list.
-
Example
openai admin:organization:projects:groups:roles list \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--group-id group_id
Response
{
"data": [
{
"id": "id",
"created_at": 0,
"created_by": "created_by",
"created_by_user_obj": {
"foo": "bar"
},
"description": "description",
"metadata": {
"foo": "bar"
},
"name": "name",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type",
"updated_at": 0
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Assign project role to group
$ openai admin:organization:projects:groups:roles create
post /projects/{project_id}/groups/{group_id}/roles
Assigns a project role to a group within a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--group-id: stringThe ID of the group that should receive the project role.
-
--role-id: stringIdentifier of the role to assign.
Returns
-
AdminOrganizationProjectGroupRoleNewResponse: object { group, object, role }Role assignment linking a group to a role.
-
group: object { id, created_at, name, 2 more }Summary information about a group returned in role assignment responses.
-
id: stringIdentifier for the group.
-
created_at: numberUnix timestamp (in seconds) when the group was created.
-
name: stringDisplay name of the group.
-
object: "group"Always
group. -
scim_managed: booleanWhether the group is managed through SCIM.
-
-
object: "group.role"Always
group.role. -
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
Example
openai admin:organization:projects:groups:roles create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--group-id group_id \
--role-id role_id
Response
{
"group": {
"id": "id",
"created_at": 0,
"name": "name",
"object": "group",
"scim_managed": true
},
"object": "group.role",
"role": {
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
}
Unassign project role from group
$ openai admin:organization:projects:groups:roles delete
delete /projects/{project_id}/groups/{group_id}/roles/{role_id}
Unassigns a project role from a group within a project.
Parameters
-
--project-id: stringThe ID of the project to modify.
-
--group-id: stringThe ID of the group whose project role assignment should be removed.
-
--role-id: stringThe ID of the project role to remove from the group.
Returns
-
AdminOrganizationProjectGroupRoleDeleteResponse: object { deleted, object }Confirmation payload returned after unassigning a role.
-
deleted: booleanWhether the assignment was removed.
-
object: stringIdentifier for the deleted assignment, such as
group.role.deletedoruser.role.deleted.
-
Example
openai admin:organization:projects:groups:roles delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--group-id group_id \
--role-id role_id
Response
{
"deleted": true,
"object": "object"
}
Roles
List project roles
$ openai admin:organization:projects:roles list
get /projects/{project_id}/roles
Lists the roles configured for a project.
Parameters
-
--project-id: stringThe ID of the project to inspect.
-
--after: optional stringCursor for pagination. Provide the value from the previous response's
nextfield to continue listing roles. -
--limit: optional numberA limit on the number of roles to return. Defaults to 1000.
-
--order: optional "asc" or "desc"Sort order for the returned roles.
Returns
-
PublicRoleListResource: object { data, has_more, next, object }Paginated list of roles available on an organization or project.
-
data: array of RoleRoles returned in the current page.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
-
has_more: booleanWhether more roles are available when paginating.
-
next: stringCursor to fetch the next page of results, or
nullwhen there are no additional roles. -
object: "list"Always
list.
-
Example
openai admin:organization:projects:roles list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
],
"has_more": true,
"next": "next",
"object": "list"
}
Create project role
$ openai admin:organization:projects:roles create
post /projects/{project_id}/roles
Creates a custom role for a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--permission: array of stringPermissions to grant to the role.
-
--role-name: stringUnique name for the role.
-
--description: optional stringOptional description of the role.
Returns
-
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
Example
openai admin:organization:projects:roles create \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--permission string \
--role-name role_name
Response
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
Update project role
$ openai admin:organization:projects:roles update
post /projects/{project_id}/roles/{role_id}
Updates an existing project role.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--role-id: stringThe ID of the role to update.
-
--description: optional stringNew description for the role.
-
--permission: optional array of stringUpdated set of permissions for the role.
-
--role-name: optional stringNew name for the role.
Returns
-
role: object { id, description, name, 4 more }Details about a role that can be assigned through the public Roles API.
-
id: stringIdentifier for the role.
-
description: stringOptional description of the role.
-
name: stringUnique name for the role.
-
object: "role"Always
role. -
permissions: array of stringPermissions granted by the role.
-
predefined_role: booleanWhether the role is predefined and managed by OpenAI.
-
resource_type: stringResource type the role is bound to (for example
api.organizationorapi.project).
-
Example
openai admin:organization:projects:roles update \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--role-id role_id
Response
{
"id": "id",
"description": "description",
"name": "name",
"object": "role",
"permissions": [
"string"
],
"predefined_role": true,
"resource_type": "resource_type"
}
Delete project role
$ openai admin:organization:projects:roles delete
delete /projects/{project_id}/roles/{role_id}
Deletes a custom role from a project.
Parameters
-
--project-id: stringThe ID of the project to update.
-
--role-id: stringThe ID of the role to delete.
Returns
-
AdminOrganizationProjectRoleDeleteResponse: object { id, deleted, object }Confirmation payload returned after deleting a role.
-
id: stringIdentifier of the deleted role.
-
deleted: booleanWhether the role was deleted.
-
object: "role.deleted"Always
role.deleted.
-
Example
openai admin:organization:projects:roles delete \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--role-id role_id
Response
{
"id": "id",
"deleted": true,
"object": "role.deleted"
}
Certificates
List project certificates
$ openai admin:organization:projects:certificates list
get /organization/projects/{project_id}/certificates
List certificates for this project.
Parameters
-
--project-id: stringThe ID of the project.
-
--after: optional stringA cursor for use in pagination.
afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
-
--order: optional "asc" or "desc"Sort order by the
created_attimestamp of the objects.ascfor ascending order anddescfor descending order.
Returns
-
ListProjectCertificatesResponse: object { data, first_id, has_more, 2 more }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the project level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.project.certificate"The object type, which is always
organization.project.certificate.
-
-
first_id: string -
has_more: boolean -
last_id: string -
object: "list"
-
Example
openai admin:organization:projects:certificates list \
--admin-api-key 'My Admin API Key' \
--project-id project_id
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.project.certificate"
}
],
"first_id": "cert_abc",
"has_more": true,
"last_id": "cert_abc",
"object": "list"
}
Activate certificates for project
$ openai admin:organization:projects:certificates activate
post /organization/projects/{project_id}/certificates/activate
Activate certificates at the project level.
You can atomically and idempotently activate up to 10 certificates at a time.
Parameters
-
--project-id: stringThe ID of the project.
-
--certificate-id: array of string
Returns
-
OrganizationProjectCertificateActivationResponse: object { data, object }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the project level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.project.certificate"The object type, which is always
organization.project.certificate.
-
-
object: "organization.project.certificate.activation"The project certificate activation result type.
-
Example
openai admin:organization:projects:certificates activate \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--certificate-id cert_abc
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.project.certificate"
}
],
"object": "organization.project.certificate.activation"
}
Deactivate certificates for project
$ openai admin:organization:projects:certificates deactivate
post /organization/projects/{project_id}/certificates/deactivate
Deactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.
Parameters
-
--project-id: stringThe ID of the project.
-
--certificate-id: array of string
Returns
-
OrganizationProjectCertificateDeactivationResponse: object { data, object }-
data: array of object { id, active, certificate_details, 3 more }-
id: stringThe identifier, which can be referenced in API endpoints
-
active: booleanWhether the certificate is currently active at the project level.
-
certificate_details: object { expires_at, valid_at }-
expires_at: optional numberThe Unix timestamp (in seconds) of when the certificate expires.
-
valid_at: optional numberThe Unix timestamp (in seconds) of when the certificate becomes valid.
-
-
created_at: numberThe Unix timestamp (in seconds) of when the certificate was uploaded.
-
name: stringThe name of the certificate.
-
object: "organization.project.certificate"The object type, which is always
organization.project.certificate.
-
-
object: "organization.project.certificate.deactivation"The project certificate deactivation result type.
-
Example
openai admin:organization:projects:certificates deactivate \
--admin-api-key 'My Admin API Key' \
--project-id project_id \
--certificate-id cert_abc
Response
{
"data": [
{
"id": "id",
"active": true,
"certificate_details": {
"expires_at": 0,
"valid_at": 0
},
"created_at": 0,
"name": "name",
"object": "organization.project.certificate"
}
],
"object": "organization.project.certificate.deactivation"
}