---
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.

## Changes

- **2026-07-17** `241fb501b372` — 1 warning, 1 info
  - added the new `none` enum value to the `role` response property for the response status `200`
  - added the new optional request property `create_service_account_only`
- **2026-05-01** `72f65c459c35` — 6 breaking, 1 info
  - the `api_key` response's property type changed from `object` to no type for status `200`
  - removed the required property `api_key/created_at` from the response with the `200` status
  - removed the required property `api_key/id` from the response with the `200` status
  - removed the required property `api_key/name` from the response with the `200` status
  - …3 more
- **2026-04-28** `fa32d6e7d961` — 1 info
  - the endpoint scheme security `AdminApiKeyAuth` was added to the API

[Change history](https://skmtc.dev/openai/apis/openai-api/changes/organization/projects/:project_id/service_accounts/post.md)

---

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