POST
POST /organization/projects/{project_id}/service_accounts — OpenAI API
OpenAI admin key (required); https://api.openai.com/v1
OpenAI APICreate project service account
- Base URL
- https://api.openai.com/v1
- Auth
- Authorization: Bearer <OPENAI_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 259 tokens · Vary: Accept
→ 259 tokens · Vary: Accept
Critical gotchas
The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.
Audio transcription uploads use multipart form data rather than a JSON request body.
cURL
curl -X POST 'https://api.openai.com/v1/organization/projects/project-id/service_accounts' \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H 'Content-Type: application/json' \ -d '{ "name": "example-name"}'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| project_id | path | string | Yes | The ID of the project. |
| name | body | string | Yes | The name of the service account being created. |
| create_service_account_only | body | boolean | No | Create the service account without default roles or an API key. |
| expires_in_seconds | body | integer | No | 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 200 OK
{
"object": "organization.project.service_account",
"id": "string",
"name": "string",
"role": "member",
"created_at": 0,
"api_key": {
"object": "organization.project.service_account.api_key",
"value": "string",
"name": "string",
"created_at": 0,
"expires_at": 0,
"id": "string"
}
} Get a free OpenAI API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.