Skip to main content
PATCH
/api/v1/api_keys

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json

The request body for updating an existing API key. The description, expiration date, consumption limits, limit period (epoch / month / lifetime), model privacy, and IP allowlist can be updated.

id
string
必填

The API Key ID to update

示例:

"e28e82dc-9df2-4b47-b726-d0a222ef2ab5"

consumptionLimit
object

The API Key consumption limits, evaluated against the window selected by limitPeriod.

示例:
limitPeriod
enum<string>

Reset window the consumption limits apply to. EPOCH resets every UTC day (legacy default). MONTH resets on the 1st of each UTC calendar month. LIFETIME never resets, so the limit acts as a permanent cap on the key.

可用选项:
EPOCH,
MONTH,
LIFETIME
示例:

"MONTH"

modelPrivacy
enum<string>

Which models this key may call, by privacy tier. ALL allows every model. PRIVATE_TEXT requires text and embedding models to be Private, TEE, or E2EE while other modalities may be Anonymous or Private. PRIVATE_ONLY requires every model to be Private, TEE, or E2EE; Anonymous models are rejected.

可用选项:
ALL,
PRIVATE_TEXT,
PRIVATE_ONLY
示例:

"ALL"

description
string

The API Key description (max 64 characters)

Maximum string length: 64
示例:

"Updated API Key Name"

expiresAt

The API Key expiration date. Set to empty string or null to remove expiration.

可用选项:
示例:

"2023-10-01T12:00:00.000Z"

ipAllowlist
string[]

Globally reachable IPv4 or IPv6 addresses and CIDR subnets allowed to use this key. An empty list allows requests from any IP address.

Maximum array length: 100
Maximum string length: 64
示例:

响应

OK

data
object
必填
success
boolean
必填