OpenAI API

Returns a list of service accounts in the project.

get
https://api.openai.com/v1/organization/projects/{project_id}/service_accounts

Query Parameters

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default:20

afterstring

A cursor for use in pagination. after is 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.

Path Parameters

project_idstringrequired

The ID of the project.

Response

application/json

Project service accounts listed successfully.

ProjectServiceAccountListResponse

objectstringrequired

Allowed values:list

dataarray[object]required

Represents an individual service account in a project.

Show Child Parameters
first_idstringrequired
last_idstringrequired
has_morebooleanrequired
get/organization/projects/{project_id}/service_accounts
 
application/json

Creates a new service account in the project. This also returns an unredacted API key for the service account.

post
https://api.openai.com/v1/organization/projects/{project_id}/service_accounts

Path Parameters

project_idstringrequired

The ID of the project.

Body

application/json

The project service account create request payload.

ProjectServiceAccountCreateRequest

namestringrequired

The name of the service account being created.

Response

application/json

Project service account created successfully.

ProjectServiceAccountCreateResponse

objectstringrequired

Allowed values:organization.project.service_account

idstringrequired
namestringrequired
rolestringrequired

Service accounts can only have one role of type member

Allowed values:member

created_atintegerrequired
api_keyobjectrequired
Show Child Parameters
post/organization/projects/{project_id}/service_accounts

Body

{ "name": "name" }
 
application/json

Retrieves a service account in the project.

get
https://api.openai.com/v1/organization/projects/{project_id}/service_accounts/{service_account_id}

Path Parameters

project_idstringrequired

The ID of the project.

service_account_idstringrequired

The ID of the service account.

Response

200 application/json

Project service account retrieved successfully.

ProjectServiceAccount

Represents an individual service account in a project.

objectstringrequired

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

Allowed values:organization.project.service_account

idstringrequired

The identifier, which can be referenced in API endpoints

namestringrequired

The name of the service account

rolestringrequired

owner or member

Allowed values:ownermember

created_atintegerrequired

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

get/organization/projects/{project_id}/service_accounts/{service_account_id}
 
200 application/json

Deletes a service account from the project.

delete
https://api.openai.com/v1/organization/projects/{project_id}/service_accounts/{service_account_id}

Path Parameters

project_idstringrequired

The ID of the project.

service_account_idstringrequired

The ID of the service account.

Response

200 application/json

Project service account deleted successfully.

ProjectServiceAccountDeleteResponse

objectstringrequired

Allowed values:organization.project.service_account.deleted

idstringrequired
deletedbooleanrequired
delete/organization/projects/{project_id}/service_accounts/{service_account_id}
 
200 application/json

Returns a list of users in the project.

get
https://api.openai.com/v1/organization/projects/{project_id}/users

Query Parameters

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default:20

afterstring

A cursor for use in pagination. after is 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.

Path Parameters

project_idstringrequired

The ID of the project.

Response

application/json

Project users listed successfully.

ProjectUserListResponse

objectstringrequired
dataarray[object]required

Represents an individual user in a project.

Show Child Parameters
first_idstringrequired
last_idstringrequired
has_morebooleanrequired
get/organization/projects/{project_id}/users
 
application/json