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
Copy file name to clipboardExpand all lines: dev/api/openapi3.yaml
+41-7Lines changed: 41 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -283,26 +283,28 @@ paths:
283
283
tags:
284
284
- api-keys-v2
285
285
summary: Create a new hash-based API key
286
-
description: Creates a new OpenAI-compatible API key (sk-oai-* format). If expiresIn is not provided, defaults to API_KEY_MAX_EXPIRATION_DAYS (default 90 days). The plaintext key is shown ONLY ONCE at creation time and cannot be retrieved again.
286
+
description: Creates a new OpenAI-compatible API key (sk-oai-* format). Name is required for regular keys but optional for ephemeral keys. If expiresIn is not provided, defaults to API_KEY_MAX_EXPIRATION_DAYS (default 90 days) for regular keys, or 1 hour for ephemeral keys. The plaintext key is shown ONLY ONCE at creation time and cannot be retrieved again.
287
287
operationId: api-keys-v2#create
288
288
requestBody:
289
289
required: true
290
290
content:
291
291
application/json:
292
292
schema:
293
293
type: object
294
-
required:
295
-
- name
296
294
properties:
297
295
name:
298
296
type: string
299
-
description: Human-readable name for the API key
297
+
description: Human-readable name for the API key. Required for regular keys, optional for ephemeral keys.
300
298
description:
301
299
type: string
302
300
description: Optional description
303
301
expiresIn:
304
302
type: string
305
-
description: Expiration duration (e.g., "30d", "90d", "1h"). Defaults to API_KEY_MAX_EXPIRATION_DAYS if not provided.
303
+
description: Expiration duration (e.g., "30d", "90d", "1h"). Defaults to API_KEY_MAX_EXPIRATION_DAYS for regular keys, 1 hour for ephemeral keys.
304
+
ephemeral:
305
+
type: boolean
306
+
description: Create a short-lived programmatic key. Defaults to false. Ephemeral keys have 1hr default and maximum expiration (enforced), and optional name.
307
+
default: false
306
308
examples:
307
309
default_expiration:
308
310
summary: API key with default expiration (API_KEY_MAX_EXPIRATION_DAYS)
@@ -315,13 +317,25 @@ paths:
315
317
name: my-short-lived-key
316
318
description: 30-day test key
317
319
expiresIn: 30d
320
+
ephemeral_key:
321
+
summary: Ephemeral key for programmatic use (1hr expiration)
322
+
value:
323
+
ephemeral: true
318
324
responses:
319
325
"201":
320
326
description: Created response.
321
327
content:
322
328
application/json:
323
329
schema:
324
330
type: object
331
+
required:
332
+
- key
333
+
- keyPrefix
334
+
- id
335
+
- name
336
+
- createdAt
337
+
- expiresAt
338
+
- ephemeral
325
339
properties:
326
340
key:
327
341
type: string
@@ -343,6 +357,9 @@ paths:
343
357
type: string
344
358
format: date-time
345
359
description: Expiration timestamp (RFC3339)
360
+
ephemeral:
361
+
type: boolean
362
+
description: Whether this is a short-lived programmatic key
346
363
"400":
347
364
description: Bad Request response.
348
365
"401":
@@ -352,7 +369,7 @@ paths:
352
369
tags:
353
370
- api-keys-v2
354
371
summary: Search and filter API keys
355
-
description: Search API keys with flexible filtering, sorting, and pagination. Supports filtering by username (admin-only), status, sorting by multiple fields, and pagination.
372
+
description: Search API keys with flexible filtering, sorting, and pagination. Supports filtering by username (admin-only), status, sorting by multiple fields, and pagination. Ephemeral keys are excluded by default.
356
373
operationId: api-keys-v2#search
357
374
requestBody:
358
375
required: false
@@ -373,6 +390,10 @@ paths:
373
390
type: string
374
391
enum: [active, revoked, expired]
375
392
description: Filter by status (active, revoked, expired). Defaults to active only.
393
+
includeEphemeral:
394
+
type: boolean
395
+
description: Include ephemeral keys in results. Defaults to false.
0 commit comments