Projects

Create project service account

Changed on

Creates a new service account in the project. By default, this also returns an unredacted API key for the service account.

post/organization/projects/{project_id}/service_accounts

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/organization/projects/{project_id}/service_accounts
  • Auth
    HTTP bearer

Path parameters

project_idstring required

The ID of the project.

Request body

namestring required

The name of the service account being created.

create_service_account_onlyboolean nullable

Create the service account without default roles or an API key.

expires_in_secondsinteger nullable

Number of seconds until the initial API key expires. If omitted or null, the key does not expire unless the effective organization or project policy requires an expiration. When a policy sets a maximum lifetime, this value must be provided and must not exceed that limit. A non-null value cannot be used when create_service_account_only is true.

Response

Project service account created successfully.

object'organization.project.service_account' required
idstring required
namestring required
role'member' | 'none' required

Service accounts created with default project membership have role member. Accounts created with create_service_account_only have role none.

created_atinteger required

Changes

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      response property error/code list-of-types was widened by adding types null to media type application/json of response 400

    • breaking

      response property error/param list-of-types was widened by adding types null to media type application/json of response 400

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      added the new none enum value to the response property for the response status

    • info

      the endpoint scheme security AdminApiKeyAuth was added to the API

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added subschema #2 to the response property anyOf list for the response status

    • info

      added the success response with the status