Delete project service account
admin.organization.projects.service_accounts.delete(strservice_account_id, ServiceAccountDeleteParams**kwargs) -> ServiceAccountDeleteResponse
DELETE/organization/projects/{project_id}/service_accounts/{service_account_id}
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).
Delete project service account
import os
from openai import OpenAI
client = OpenAI(
admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted
)
service_account = client.admin.organization.projects.service_accounts.delete(
service_account_id="service_account_id",
project_id="project_id",
)
print(service_account.id){
"object": "organization.project.service_account.deleted",
"id": "svc_acct_abc",
"deleted": true
}
Returns Examples
{
"object": "organization.project.service_account.deleted",
"id": "svc_acct_abc",
"deleted": true
}