You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1f05e33
Browse filesBrowse the repository at this point in the historyBrowse files
feat(api): support updating project API key expiry (#4066)
## Summary
Adds support for updating an existing project API key’s expiration.
## Changes
- Add client.admin.organization.projects.api_keys.update to set an
expiry relative to the request time.
- Require a project ID, API key ID, and expires_in_seconds value.
- Return the updated project API key resource.
Co-authored-by: jbeckwith-oai <[email protected]>
description: The project or API key was not found.
13012
+
content:
13013
+
application/json:
13014
+
schema:
13015
+
$ref: '#/components/schemas/ErrorResponse'
13016
+
'429':
13017
+
description: Too many management requests. Reduce the request rate and try again later.
13018
+
content:
13019
+
application/json:
13020
+
schema:
13021
+
$ref: '#/components/schemas/ErrorResponse'
13022
+
x-oaiMeta:
13023
+
group: administration
13024
+
examples:
13025
+
request:
13026
+
curl: |
13027
+
curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/api_keys/key_abc \
13028
+
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
13029
+
-H "Content-Type: application/json" \
13030
+
-d '{"expires_in_seconds": 86400}'
13031
+
response: |
13032
+
{
13033
+
"object": "organization.project.api_key",
13034
+
"redacted_value": "sk-abc...def",
13035
+
"name": "My API Key",
13036
+
"created_at": 1711471533,
13037
+
"expires_at": 1711557933,
13038
+
"last_used_at": null,
13039
+
"id": "key_abc",
13040
+
"owner_project_access": "active",
13041
+
"owner": {
13042
+
"type": "service_account",
13043
+
"service_account": {
13044
+
"id": "svc_acct_abc",
13045
+
"name": "My Service Account",
13046
+
"role": "member",
13047
+
"created_at": 1711471533
13048
+
}
13049
+
}
13050
+
}
12957
13051
/organization/projects/{project_id}/archive:
12958
13052
post:
12959
13053
summary: Archive project
@@ -33651,6 +33745,8 @@ paths:
33651
33745
application/json:
33652
33746
schema:
33653
33747
$ref: '#/components/schemas/UpdateVaultParams'
33748
+
example:
33749
+
name: Research vault
33654
33750
required: true
33655
33751
responses:
33656
33752
'200':
@@ -78301,6 +78397,16 @@ components:
78301
78397
- GB_STORAGE
78302
78398
- AE_STORAGE
78303
78399
- AE_STORAGE_PROCESSING
78400
+
UpdateProjectApiKeyBody:
78401
+
properties:
78402
+
expires_in_seconds:
78403
+
type: integer
78404
+
maximum: 31536000
78405
+
minimum: 1
78406
+
description: Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request.
0 commit comments