---
title: "Creates a new service account in the project. By default, this also returns an unredacted API key for the service account."
method: POST
path: "/organization/projects/{project_id}/service_accounts"
tags: ["Projects"]
---

# 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`

## 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-08-05** `ab0c5306e390` — 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-13** `74cbcf73838f` — 8 breaking, 2 info
  - response property `error/code` list-of-types was widened by adding types `null` to media type `application/json` of response `400`
  - response property `error/param` list-of-types was widened by adding types `null` to media type `application/json` of response `400`
  - the `api_key` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `api_key/created_at` from the response with the `200` status
  - …6 more
- **2024-08-06** `8eca3b09b705` — 1 info
  - endpoint added

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

---

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