Skip to content

Commit 0751ab2

Browse files
Krishna ChandraKrishna Chandra
authored andcommitted
feat: add examples in create and update api key
1 parent f41b359 commit 0751ab2

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17362,6 +17362,31 @@ paths:
1736217362
application/json:
1736317363
schema:
1736417364
$ref: "#/components/schemas/CreateApiKeyObject"
17365+
examples:
17366+
create_basic:
17367+
summary: Create a basic service API key
17368+
value:
17369+
name: "API_KEY_NAME_0909"
17370+
scopes: ["completions.write"]
17371+
create_with_rotation:
17372+
summary: Create an API key with automatic monthly rotation
17373+
value:
17374+
name: "Auto-rotating Key"
17375+
scopes: ["completions.write"]
17376+
rotation_policy:
17377+
rotation_period: "monthly"
17378+
key_transition_period_ms: 3600000
17379+
create_with_usage_limits:
17380+
summary: Create an API key with usage limits and alert emails
17381+
value:
17382+
name: "Budget-limited Key"
17383+
scopes: ["completions.write"]
17384+
usage_limits:
17385+
type: "cost"
17386+
credit_limit: 100
17387+
alert_threshold: 80
17388+
periodic_reset: "monthly"
17389+
alert_emails: ["admin@example.com"]
1736517390
responses:
1736617391
"200":
1736717392
description: OK
@@ -17771,6 +17796,21 @@ paths:
1777117796
summary: Reset accumulated usage for this key
1777217797
value:
1777317798
reset_usage: true
17799+
set_rotation_policy:
17800+
summary: Set automatic monthly rotation on an existing key
17801+
value:
17802+
rotation_policy:
17803+
rotation_period: "monthly"
17804+
key_transition_period_ms: 3600000
17805+
update_usage_limits:
17806+
summary: Update usage limits and alert emails
17807+
value:
17808+
usage_limits:
17809+
type: "cost"
17810+
credit_limit: 100
17811+
alert_threshold: 80
17812+
periodic_reset: "monthly"
17813+
alert_emails: ["admin@example.com"]
1777417814
parameters:
1777517815
- name: id
1777617816
in: path

0 commit comments

Comments
 (0)