---
title: "Returns a list of service accounts in the project."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/list-project-service-accounts"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Returns a list of service accounts in the project.

`GET` `/organization/projects/{project_id}/service_accounts`

Operation ID: `list-project-service-accounts`

## Path parameters

- `project_id` (string, required) - The ID of the project.

## Query parameters

- `limit` (integer, optional) - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
- `after` (string, optional) - 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.

## Responses

- `200` - Project service accounts listed successfully.
- `400` - Error response when project is archived.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /organization/projects/{project_id}/service_accounts:
    get:
      summary: Returns a list of service accounts in the project.
      operationId: list-project-service-accounts
      tags:
        - Projects
      parameters:
        - name: project_id
          in: path
          description: The ID of the project.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          schema:
            type: integer
            default: 20
        - name: after
          in: query
          description: >
            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.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Project service accounts listed successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProjectServiceAccountListResponse"
        "400":
          description: Error response when project is archived.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      x-oaiMeta:
        name: List project service accounts
        group: administration
        returns: A list of
          [ProjectServiceAccount](/docs/api-reference/project-service-accounts/object)
          objects.
        examples:
          request:
            curl: |
              curl https://api.openai.com/v1/organization/projects/proj_abc/service_accounts?after=custom_id&limit=20 \
                -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
                -H "Content-Type: application/json"
          response: |
            {
                "object": "list",
                "data": [
                    {
                        "object": "organization.project.service_account",
                        "id": "svc_acct_abc",
                        "name": "Service Account",
                        "role": "owner",
                        "created_at": 1711471533
                    }
                ],
                "first_id": "svc_acct_abc",
                "last_id": "svc_acct_xyz",
                "has_more": false
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    ProjectServiceAccountListResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
          x-stainless-const: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/ProjectServiceAccount"
        first_id:
          type: string
        last_id:
          type: string
        has_more:
          type: boolean
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: "#/components/schemas/Error"
      required:
        - error
    ProjectServiceAccount:
      type: object
      description: Represents an individual service account in a project.
      properties:
        object:
          type: string
          enum:
            - organization.project.service_account
          description: The object type, which is always
            `organization.project.service_account`
          x-stainless-const: true
        id:
          type: string
          description: The identifier, which can be referenced in API endpoints
        name:
          type: string
          description: The name of the service account
        role:
          type: string
          enum:
            - owner
            - member
          description: "`owner` or `member`"
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the service account was
            created
      required:
        - object
        - id
        - name
        - role
        - created_at
      x-oaiMeta:
        name: The project service account object
        example: |
          {
              "object": "organization.project.service_account",
              "id": "svc_acct_abc",
              "name": "Service Account",
              "role": "owner",
              "created_at": 1711471533
          }
    Error:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: false
        param:
          type: string
          nullable: true
        type:
          type: string
          nullable: false
      required:
        - type
        - message
        - param
        - code
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
