---
title: "Create project service account"
method: POST
path: "/organization/projects/{project_id}/service_accounts"
tags: ["Projects"]
---

# Create project service account

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

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

## Path parameters

- `project_id` string, required

## Request body

- ProjectServiceAccountCreateRequest
  - `name` string, required — The name of the service account being created.
  - `create_service_account_only` boolean, nullable — Create the service account without default roles or an API key.

## Response `200`

Project service account created successfully.

- ProjectServiceAccountCreateResponse
  - `object` 'organization.project.service_account', required
  - `id` string, required
  - `name` string, 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_at` integer, required
  - `api_key` ProjectServiceAccountApiKey, required
    - `object` 'organization.project.service_account.api_key', required — The object type, which is always `organization.project.service_account.api_key`
    - `value` string, required
    - `name` string, required
    - `created_at` integer, required
    - `id` string, required

## Other responses

- `400` — Error response when project is archived.

---

[API](https://skmtc.net/openai/apis/openai-api.md) · [All operations](https://skmtc.net/openai/apis/openai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openai/openai-api/versions/dcd35773a322/schema)
